views:

148

answers:

3

Hi there

In report design, I have 2 tables (Current and Proposed) the structure like this:

Current

Parameter | Value | Rate | Total

Value ...

Proposed

Parameter | Value | Rate | Total

Value ...

Each bottom of the table (Table Footer), I have something called: "Total: " which is a sum of Total field. I called these textboxes are txtbxCurrent and txtbxProposed and the format is in currency already.

This thing is running well.

But now I need to get a total of these txtbxCurrent and txtbxProposed. How do I do this? Can I take the value of this or not?

BTW .. I am using Ms SQL Server 2005 (ReportViewer - client)

Also here my SINGLE dataset looks like:

RecID | ReportView | Type | Parameter | Value | Rate | Total
1, 'Detail', CURRENT, 'Param1', 100, 0.1, 10
1, 'Detail', CURRENT, 'Param2', 200, 0.2, 10
1, 'Detail', PROPOSED, 'Param1', 100, 0.2, 20
1, 'Detail', PROPOSED, 'Param2', 200, 0.2, 20

The only I can think of is that I could append for another ReportView such as 'Ttl' but I am just wondering I could do from the current dataset.

Thanks

+1  A: 

Could you create a new table that only has the totals for the third table?

ex:

Table 1 Table 2 Table 3 (only has total of Table 1 + Table 2)

You might be able to use parameters to store the totals to add as well, but a 3rd table would be pretty easy to create.

Zachary
That what I am think of actually. But I will append the current data set. Cause we have 'ReportView' field already. But I am trying other way if it's easy.
dewacorp.alliances
+2  A: 

Why you don't use sum function? you can use from sum function for each dataset and add these values in a new textbox.

EDIT :

if txtbxCurrent = Sum(Fields!Total.Value, "CurrentDS") and txtbxProposed = Sum(Fields!Total.Value, "ProposedDS")

then you can use this :

Sum(Fields!Total.Value, "CurrentDS") + Sum(Fields!Total.Value, "ProposedDS")
masoud ramezani
That what I did to get the total of each table. But I cound't work out I want to sum based on each view (current VS proposed) on different area if you know what I mean (like outside these 2 tables)
dewacorp.alliances
Also the data is coming from a single DATASET but we have a field to differentiate this.
dewacorp.alliances
you can use a parameter for specifying your purpose.
masoud ramezani
I give it a go!
dewacorp.alliances
I got the following error: The Value expression for the textbox ‘textbox17’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set.
dewacorp.alliances
do you have 2 dataset or more?
masoud ramezani
If you have 2 dataset or more you must don't have any problem. I use this way in my reports.
masoud ramezani
@masoud ramezani: I only have 1 dataset.
dewacorp.alliances
+1  A: 

If you're using a single dataset for both tables, how are you restricting each of them to current and proposed values respectively?

If you have a table-level filter on each table, the simplest approach might be to add a third table with no table-level filter, with a table footer row only, containing just

Sum(Fields!Total.Value)

Alternatively, it might be more efficient to rewrite the report to use a single table, grouped by ReportView, with footers containing sums of total at both group footer and table footer level.

Mark Bannister