Groups | Blog | Home
all groups > sql server reporting services > april 2005 >

sql server reporting services : Textbox Calculation Help


chang
4/1/2005 2:17:02 PM
I have 2 textbox within my detail table that has 2 subreport. Then in each
subreport, it contains 1 stored procedure. Is it possible to do some
calculation with those two textboxes?

Example: Textbox1 - Textbox2 = 1234

Can someone tell me if this is possible? If not will RS 2 might have this
option. So far I have no luck in doing calculation from one textbox with
another. I can only use fields to do calculation if it exists, but just
Mary Bray [SQL Server MVP]
4/3/2005 5:53:01 PM
try:
=ReportItems!Textbox1.Value - =ReportItems!Textbox2.Value

[quoted text, click to view]
Robert Bruckner [MSFT]
4/3/2005 6:20:16 PM
There is one "=" too much in Mary's expression. Try this instead:
=ReportItems!Textbox1.Value - ReportItems!Textbox2.Value

Note: there are scope limitations on which textboxes within a report can be
referenced.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Mary Bray [SQL Server MVP]"
[quoted text, click to view]

chang
4/4/2005 11:33:02 AM
Thanks Robert and Mary. I tried what you guys suggested but this is the
error that I'm getting:

Object reference not set to an instance of an object.

Each of the textbox is a detail list item, but I want to be able to subtract
it.

Here's what my looks like:

=ReportItems!Sales_SubReport.Values - ReportItems!Cost_SubReport.Values

PLease advise. Thanks.

[quoted text, click to view]
Robert Bruckner [MSFT]
4/7/2005 11:18:38 PM
There is no "Values" property defined for textboxes, only a "Value"
property. Also it seems like you want to "reach inside" a subreport and
reference a set of textbox values there - this is not possible.


-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

chang
4/8/2005 3:01:02 PM
Robert,

Is it possible to use code behind to reach what's already been output and
display it to a new text box? I would've thought that this would be possible
because the data are already been outputed to the detail list textboxes. I'm
not too experience with RS so if it's possible to use custom code, please
advise or possibly provide some examples.

Thanks.

[quoted text, click to view]
Robert Bruckner [MSFT]
4/10/2005 6:14:51 PM
As mentioned in my previous response, this is not supported. Subreports are
completely independent of main reports. You could add a dataset to the main
report which calculates the values you try to get from the sub report and
just show them in the main report.

-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

chang
4/19/2005 6:14:02 AM
Robert,

Is it possible to use another dataset as you mentioned and pass variable
from one to the other? I need to be able to pass object fields as parameters
so that I can use the parameters in my where clause to filter out data. Is
this possible?

[quoted text, click to view]
AddThis Social Bookmark Button