All--
Is it possible, from within the context of a main report that contains
several subreports, to write code in the main report that refers to field
values within one or more of the contained subreports? (I would like to
display totals in the main report that are sums of quantities displayed in
several subreports.)
TIA,
mattyseltz in Queens, NYOn May 7, 1:24 pm, mattyseltz <mattyse...@.discussions.microsoft.com>
wrote:
> All--
> Is it possible, from within the context of a main report that contains
> several subreports, to write code in the main report that refers to field
> values within one or more of the contained subreports? (I would like to
> display totals in the main report that are sums of quantities displayed in
> several subreports.)
> TIA,
> mattyseltz in Queens, NY
The closest you can get to that is to include the same datasets in the
main report that exist in the subreports and use an expression similar
to the following:
=Sum(Fields!Quantity.Value, "SameDataSetAsUsedInSubReport")
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi, Enrique,
Thanks for your reply. I see that you answered a similar question on
April 18, sorry to make you repeat yourself.
Best,
Matt
"EMartinez" wrote:
> On May 7, 1:24 pm, mattyseltz <mattyse...@.discussions.microsoft.com>
> wrote:
> > All--
> > Is it possible, from within the context of a main report that contains
> > several subreports, to write code in the main report that refers to field
> > values within one or more of the contained subreports? (I would like to
> > display totals in the main report that are sums of quantities displayed in
> > several subreports.)
> >
> > TIA,
> >
> > mattyseltz in Queens, NY
>
> The closest you can get to that is to include the same datasets in the
> main report that exist in the subreports and use an expression similar
> to the following:
> =Sum(Fields!Quantity.Value, "SameDataSetAsUsedInSubReport")
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On May 8, 8:16 am, mattyseltz <mattyse...@.discussions.microsoft.com>
wrote:
> Hi, Enrique,
> Thanks for your reply. I see that you answered a similar question on
> April 18, sorry to make you repeat yourself.
> Best,
> Matt
> "EMartinez" wrote:
> > On May 7, 1:24 pm, mattyseltz <mattyse...@.discussions.microsoft.com>
> > wrote:
> > > All--
> > > Is it possible, from within the context of a main report that contains
> > > several subreports, to write code in the main report that refers to field
> > > values within one or more of the contained subreports? (I would like to
> > > display totals in the main report that are sums of quantities displayed in
> > > several subreports.)
> > > TIA,
> > > mattyseltz in Queens, NY
> > The closest you can get to that is to include the same datasets in the
> > main report that exist in the subreports and use an expression similar
> > to the following:
> > =Sum(Fields!Quantity.Value, "SameDataSetAsUsedInSubReport")
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
You're welcome. No problem. Glad I could be of assistance.
Regards,
Enrique Martinez
Sr. Software Consultant
Showing posts with label write. Show all posts
Showing posts with label write. Show all posts
Wednesday, March 21, 2012
Tuesday, March 20, 2012
Referencing textbox name in expression
I would like to reference a textbox name in an expression. When I write the
following expression, I get an error saying that the textbox name is
"private":
=ReportItems!txtPatientName.Name
Error: The value expression for the textbox â'textbox1â' contains an error:
[BC30390]
'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem.Private
ReadOnly Property Name() As String' is not accessible in this context because
it is 'Private'.I should probably mention that I am trying to ultimately reference the NAME
of the column/field returned from the stored procedure. Since that seems
impossible, I was hoping to set the name of the textbox to the name of the
column/field and then reference that. For example:
SELECT AdmitDate as [AdmitDate],
DischargeDate as [DischargeDate]
FROM Table_Name
In the report I would set the name of the textbox that displays the
AdmitDate field to "AdmitDate" so that I could reference the name of the
column/field being returned by the procedure with this statement:
=ReportItems!AdmitDate.Name
Is there any way to reference the name of the field/column being returned by
the procedure or the name of a textbox?
"mssarahlynn" wrote:
> I would like to reference a textbox name in an expression. When I write the
> following expression, I get an error saying that the textbox name is
> "private":
> =ReportItems!txtPatientName.Name
> Error: The value expression for the textbox â'textbox1â' contains an error:
> [BC30390]
> 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem.Private
> ReadOnly Property Name() As String' is not accessible in this context because
> it is 'Private'.
>
>
following expression, I get an error saying that the textbox name is
"private":
=ReportItems!txtPatientName.Name
Error: The value expression for the textbox â'textbox1â' contains an error:
[BC30390]
'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem.Private
ReadOnly Property Name() As String' is not accessible in this context because
it is 'Private'.I should probably mention that I am trying to ultimately reference the NAME
of the column/field returned from the stored procedure. Since that seems
impossible, I was hoping to set the name of the textbox to the name of the
column/field and then reference that. For example:
SELECT AdmitDate as [AdmitDate],
DischargeDate as [DischargeDate]
FROM Table_Name
In the report I would set the name of the textbox that displays the
AdmitDate field to "AdmitDate" so that I could reference the name of the
column/field being returned by the procedure with this statement:
=ReportItems!AdmitDate.Name
Is there any way to reference the name of the field/column being returned by
the procedure or the name of a textbox?
"mssarahlynn" wrote:
> I would like to reference a textbox name in an expression. When I write the
> following expression, I get an error saying that the textbox name is
> "private":
> =ReportItems!txtPatientName.Name
> Error: The value expression for the textbox â'textbox1â' contains an error:
> [BC30390]
> 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.ReportItem.Private
> ReadOnly Property Name() As String' is not accessible in this context because
> it is 'Private'.
>
>
Referencing a text box
Hello,
If I have a text box with the following value : =Sum(Fields!Sales.Value)
Can I then in another text box write something like:
=textbox30.Value + textbox50.Value
Is this possible?Try:
=ReportItems!textbox30.Value + ReportItems!textbox50.Value
--
-- John H. Miller [MSFT]
-- SQL Server BI Product Group
----
--
"This posting is provided 'AS IS' with no warranties, and confers no
rights."
----
--
"ashvsaod" <ashvsaod@.hotmail.com> wrote in message
news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> Hello,
> If I have a text box with the following value : =Sum(Fields!Sales.Value)
> Can I then in another text box write something like:
> =textbox30.Value + textbox50.Value
> Is this possible?
>|||When I do this I receive the following error:
The value expression for the textbox 'WIP_4' refers to the report item
'Textbox30'. Report item expressions can only refer to other report items
within the same grouping scope or a containing grouping scope.
So what can I do now? I must admit I don't even know what this means.
"John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
news:410994a0$1@.news.microsoft.com...
> Try:
> =ReportItems!textbox30.Value + ReportItems!textbox50.Value
> --
> -- John H. Miller [MSFT]
> -- SQL Server BI Product Group
> ----
--
> --
> "This posting is provided 'AS IS' with no warranties, and confers no
> rights."
> ----
--
> --
> "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > If I have a text box with the following value : =Sum(Fields!Sales.Value)
> >
> > Can I then in another text box write something like:
> >
> > =textbox30.Value + textbox50.Value
> >
> > Is this possible?
> >
> >
>|||You can find some details on how scope works in RS BOL - see
http://msdn.microsoft.com/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_1l6b.asp
--
-- John H. Miller [MSFT]
-- SQL Server BI Product Group
----
--
"This posting is provided 'AS IS' with no warranties, and confers no
rights."
----
--
"ashvsaod" <ashvsaod@.hotmail.com> wrote in message
news:u3R3ZBddEHA.1644@.tk2msftngp13.phx.gbl...
> When I do this I receive the following error:
> The value expression for the textbox 'WIP_4' refers to the report item
> 'Textbox30'. Report item expressions can only refer to other report items
> within the same grouping scope or a containing grouping scope.
> So what can I do now? I must admit I don't even know what this means.
> "John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
> news:410994a0$1@.news.microsoft.com...
> > Try:
> >
> > =ReportItems!textbox30.Value + ReportItems!textbox50.Value
> >
> > --
> > -- John H. Miller [MSFT]
> > -- SQL Server BI Product Group
> ----
> --
> > --
> > "This posting is provided 'AS IS' with no warranties, and confers no
> > rights."
> ----
> --
> > --
> >
> > "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> > news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> > > Hello,
> > >
> > > If I have a text box with the following value :
=Sum(Fields!Sales.Value)
> > >
> > > Can I then in another text box write something like:
> > >
> > > =textbox30.Value + textbox50.Value
> > >
> > > Is this possible?
> > >
> > >
> >
> >
>|||Yeah, I found it and all is solved. Thanks for all the assistance.
"John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
news:4109b720$1@.news.microsoft.com...
> You can find some details on how scope works in RS BOL - see
>
http://msdn.microsoft.com/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_1l6b.asp
> --
> -- John H. Miller [MSFT]
> -- SQL Server BI Product Group
> ----
--
> --
> "This posting is provided 'AS IS' with no warranties, and confers no
> rights."
> ----
--
> --
> "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> news:u3R3ZBddEHA.1644@.tk2msftngp13.phx.gbl...
> > When I do this I receive the following error:
> >
> > The value expression for the textbox 'WIP_4' refers to the report item
> > 'Textbox30'. Report item expressions can only refer to other report
items
> > within the same grouping scope or a containing grouping scope.
> >
> > So what can I do now? I must admit I don't even know what this means.
> >
> > "John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
> > news:410994a0$1@.news.microsoft.com...
> > > Try:
> > >
> > > =ReportItems!textbox30.Value + ReportItems!textbox50.Value
> > >
> > > --
> > > -- John H. Miller [MSFT]
> > > -- SQL Server BI Product Group
> >
> ----
> > --
> > > --
> > > "This posting is provided 'AS IS' with no warranties, and confers
no
> > > rights."
> >
> ----
> > --
> > > --
> > >
> > > "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> > > news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> > > > Hello,
> > > >
> > > > If I have a text box with the following value :
> =Sum(Fields!Sales.Value)
> > > >
> > > > Can I then in another text box write something like:
> > > >
> > > > =textbox30.Value + textbox50.Value
> > > >
> > > > Is this possible?
> > > >
> > > >
> > >
> > >
> >
> >
>
If I have a text box with the following value : =Sum(Fields!Sales.Value)
Can I then in another text box write something like:
=textbox30.Value + textbox50.Value
Is this possible?Try:
=ReportItems!textbox30.Value + ReportItems!textbox50.Value
--
-- John H. Miller [MSFT]
-- SQL Server BI Product Group
----
--
"This posting is provided 'AS IS' with no warranties, and confers no
rights."
----
--
"ashvsaod" <ashvsaod@.hotmail.com> wrote in message
news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> Hello,
> If I have a text box with the following value : =Sum(Fields!Sales.Value)
> Can I then in another text box write something like:
> =textbox30.Value + textbox50.Value
> Is this possible?
>|||When I do this I receive the following error:
The value expression for the textbox 'WIP_4' refers to the report item
'Textbox30'. Report item expressions can only refer to other report items
within the same grouping scope or a containing grouping scope.
So what can I do now? I must admit I don't even know what this means.
"John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
news:410994a0$1@.news.microsoft.com...
> Try:
> =ReportItems!textbox30.Value + ReportItems!textbox50.Value
> --
> -- John H. Miller [MSFT]
> -- SQL Server BI Product Group
> ----
--
> --
> "This posting is provided 'AS IS' with no warranties, and confers no
> rights."
> ----
--
> --
> "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > If I have a text box with the following value : =Sum(Fields!Sales.Value)
> >
> > Can I then in another text box write something like:
> >
> > =textbox30.Value + textbox50.Value
> >
> > Is this possible?
> >
> >
>|||You can find some details on how scope works in RS BOL - see
http://msdn.microsoft.com/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_1l6b.asp
--
-- John H. Miller [MSFT]
-- SQL Server BI Product Group
----
--
"This posting is provided 'AS IS' with no warranties, and confers no
rights."
----
--
"ashvsaod" <ashvsaod@.hotmail.com> wrote in message
news:u3R3ZBddEHA.1644@.tk2msftngp13.phx.gbl...
> When I do this I receive the following error:
> The value expression for the textbox 'WIP_4' refers to the report item
> 'Textbox30'. Report item expressions can only refer to other report items
> within the same grouping scope or a containing grouping scope.
> So what can I do now? I must admit I don't even know what this means.
> "John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
> news:410994a0$1@.news.microsoft.com...
> > Try:
> >
> > =ReportItems!textbox30.Value + ReportItems!textbox50.Value
> >
> > --
> > -- John H. Miller [MSFT]
> > -- SQL Server BI Product Group
> ----
> --
> > --
> > "This posting is provided 'AS IS' with no warranties, and confers no
> > rights."
> ----
> --
> > --
> >
> > "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> > news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> > > Hello,
> > >
> > > If I have a text box with the following value :
=Sum(Fields!Sales.Value)
> > >
> > > Can I then in another text box write something like:
> > >
> > > =textbox30.Value + textbox50.Value
> > >
> > > Is this possible?
> > >
> > >
> >
> >
>|||Yeah, I found it and all is solved. Thanks for all the assistance.
"John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
news:4109b720$1@.news.microsoft.com...
> You can find some details on how scope works in RS BOL - see
>
http://msdn.microsoft.com/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_1l6b.asp
> --
> -- John H. Miller [MSFT]
> -- SQL Server BI Product Group
> ----
--
> --
> "This posting is provided 'AS IS' with no warranties, and confers no
> rights."
> ----
--
> --
> "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> news:u3R3ZBddEHA.1644@.tk2msftngp13.phx.gbl...
> > When I do this I receive the following error:
> >
> > The value expression for the textbox 'WIP_4' refers to the report item
> > 'Textbox30'. Report item expressions can only refer to other report
items
> > within the same grouping scope or a containing grouping scope.
> >
> > So what can I do now? I must admit I don't even know what this means.
> >
> > "John H. Miller" <jhmiller@.online.microsoft.com> wrote in message
> > news:410994a0$1@.news.microsoft.com...
> > > Try:
> > >
> > > =ReportItems!textbox30.Value + ReportItems!textbox50.Value
> > >
> > > --
> > > -- John H. Miller [MSFT]
> > > -- SQL Server BI Product Group
> >
> ----
> > --
> > > --
> > > "This posting is provided 'AS IS' with no warranties, and confers
no
> > > rights."
> >
> ----
> > --
> > > --
> > >
> > > "ashvsaod" <ashvsaod@.hotmail.com> wrote in message
> > > news:em00MfcdEHA.3412@.TK2MSFTNGP11.phx.gbl...
> > > > Hello,
> > > >
> > > > If I have a text box with the following value :
> =Sum(Fields!Sales.Value)
> > > >
> > > > Can I then in another text box write something like:
> > > >
> > > > =textbox30.Value + textbox50.Value
> > > >
> > > > Is this possible?
> > > >
> > > >
> > >
> > >
> >
> >
>
Monday, February 20, 2012
Reduce the Database size
Hi,
I have a database with size 20 GB.
The DB contains 550 tables, 2110 stored procedures.
I need to write this DB in a DVD. So I have to reduce the DB size around 6 GB.
It is not necessary that all the data should be in DB. Some sample data is
enough.
Is there any way to do it with less administrative effort?
Please advise me,
Soura
Soura - this is such a propriety requirement, you'll have to code this
yourself. One posibility is to restore a backup of the database and choose a
central table to the schema and do a delete. If you previously turn on
cascading deletes throughout the database then this'll be a convenient way
of removing related data. Do this the required amount of times and then
shrink the database before copying the database to the DVD.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Hi Paul,
Thanks for your reply.
I enabled 'cascade delete' and saved it through Enterprise manager
and closed that window but then i re-opened that the table design the
'cascade delete' is unchecked ie., it is not saved.
Please guide me,
Soura
"Paul Ibison" wrote:
> Soura - this is such a propriety requirement, you'll have to code this
> yourself. One posibility is to restore a backup of the database and choose a
> central table to the schema and do a delete. If you previously turn on
> cascading deletes throughout the database then this'll be a convenient way
> of removing related data. Do this the required amount of times and then
> shrink the database before copying the database to the DVD.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
|||SouRa,
please can you run the following type of script in query analyser to change
the FK to be a cascade-delete one, and post back any error messages you are
seeing.
ALTER TABLE dbo.Territories WITH NOCHECK ADD CONSTRAINT
FK_Territories_Region FOREIGN KEY
(
RegionID
) REFERENCES dbo.Region
(
RegionID
) ON DELETE CASCADE
NOT FOR REPLICATION
GO
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Thanks for your reply Paul.
Can i have a query to run for whole database.
Advise me
Soura
"Paul Ibison" wrote:
> SouRa,
> please can you run the following type of script in query analyser to change
> the FK to be a cascade-delete one, and post back any error messages you are
> seeing.
> ALTER TABLE dbo.Territories WITH NOCHECK ADD CONSTRAINT
> FK_Territories_Region FOREIGN KEY
> (
> RegionID
> ) REFERENCES dbo.Region
> (
> RegionID
> ) ON DELETE CASCADE
> NOT FOR REPLICATION
> GO
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
>
|||There are scripts out there that you could modify slightly to do this
(http://www.sqlservercentral.com/scri...p?scriptid=971) but
I'd get EM to help you out here. Have EM script out all the FKs to a
textfile. Do a find-and-replace on
") NOT FOR REPLICATION" with ") ON DELETE CASCADE NOT FOR REPLICATION"
and ") GO" with ") ON DELETE CASCADE GO".
Have EM also create a drop script for the FKs.
At this stage you should have everything you need.
Obviously try this out on a test database first
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
I have a database with size 20 GB.
The DB contains 550 tables, 2110 stored procedures.
I need to write this DB in a DVD. So I have to reduce the DB size around 6 GB.
It is not necessary that all the data should be in DB. Some sample data is
enough.
Is there any way to do it with less administrative effort?
Please advise me,
Soura
Soura - this is such a propriety requirement, you'll have to code this
yourself. One posibility is to restore a backup of the database and choose a
central table to the schema and do a delete. If you previously turn on
cascading deletes throughout the database then this'll be a convenient way
of removing related data. Do this the required amount of times and then
shrink the database before copying the database to the DVD.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Hi Paul,
Thanks for your reply.
I enabled 'cascade delete' and saved it through Enterprise manager
and closed that window but then i re-opened that the table design the
'cascade delete' is unchecked ie., it is not saved.
Please guide me,
Soura
"Paul Ibison" wrote:
> Soura - this is such a propriety requirement, you'll have to code this
> yourself. One posibility is to restore a backup of the database and choose a
> central table to the schema and do a delete. If you previously turn on
> cascading deletes throughout the database then this'll be a convenient way
> of removing related data. Do this the required amount of times and then
> shrink the database before copying the database to the DVD.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
|||SouRa,
please can you run the following type of script in query analyser to change
the FK to be a cascade-delete one, and post back any error messages you are
seeing.
ALTER TABLE dbo.Territories WITH NOCHECK ADD CONSTRAINT
FK_Territories_Region FOREIGN KEY
(
RegionID
) REFERENCES dbo.Region
(
RegionID
) ON DELETE CASCADE
NOT FOR REPLICATION
GO
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Thanks for your reply Paul.
Can i have a query to run for whole database.
Advise me
Soura
"Paul Ibison" wrote:
> SouRa,
> please can you run the following type of script in query analyser to change
> the FK to be a cascade-delete one, and post back any error messages you are
> seeing.
> ALTER TABLE dbo.Territories WITH NOCHECK ADD CONSTRAINT
> FK_Territories_Region FOREIGN KEY
> (
> RegionID
> ) REFERENCES dbo.Region
> (
> RegionID
> ) ON DELETE CASCADE
> NOT FOR REPLICATION
> GO
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
>
|||There are scripts out there that you could modify slightly to do this
(http://www.sqlservercentral.com/scri...p?scriptid=971) but
I'd get EM to help you out here. Have EM script out all the FKs to a
textfile. Do a find-and-replace on
") NOT FOR REPLICATION" with ") ON DELETE CASCADE NOT FOR REPLICATION"
and ") GO" with ") ON DELETE CASCADE GO".
Have EM also create a drop script for the FKs.
At this stage you should have everything you need.
Obviously try this out on a test database first
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
Subscribe to:
Posts (Atom)