Question : SSRS Combine two datasets into one data region - Must be in report not in SQL server

Hello,

I'm using Visual Studio 2008 to develop a report that needs to combine the results of two data sets in a dataregion.  I need to group my results into two groups (group1 and Group2) and add the values from the amount fields from both datasets so my final result seems as follows:

Group1: MajorCategory1
                Group2: Category1        sum(Itemcost) + sum(ExpenseCost)
                Group2: Category2        sum(Itemcost) + sum(ExpenseCost)            
                Group2: Category3        sum(Itemcost) + sum(ExpenseCost)          
                 Group1 TOTAL               XXXX.XX                      
Group1: MajorCategory2
                Group2: Category4        sum(Itemcost) + sum(ExpenseCost)
                Group2: Category5        sum(Itemcost) + sum(ExpenseCost)  
                 Group2 TOTAL               XXXX.XX  
                     
Please note I must do this on the report side, given architectural constrains in my solution, as opposed to using a union query on the SQL server side.  Here  are my datasets:

Dataset 1
Group1                            Group2      Amount
MajorCategory1      Category1      ItemCost
MajorCategory1      Category1      ItemCost
MajorCategory1      Category2      ItemCost
MajorCategory1      Category3      ItemCost
MajorCategory2      Category4      ItemCost
MajorCategory2      Category4      ItemCost
MajorCategory2      Category5      ItemCost

Dataset2
Group1                           Group2      Amount
MajorCategory1      Category1      ExpenseCost
MajorCategory1      Category1      ExpenseCost
MajorCategory1      Category2      ExpenseCost
MajorCategory1      Category3      ExpenseCost
MajorCategory2      Category4      ExpenseCost
MajorCategory2      Category5      ExpenseCost
MajorCategory2      Category5      ExpenseCost

Any ideas on how to achieve this will be eternally appreciated.
Chris

Answer : SSRS Combine two datasets into one data region - Must be in report not in SQL server

Sorry, but I don't actually have a computer these days that has SSRS on it, such that I can test anything beyond my memory... As initially indicated, I would have normally accomplished this via a union query to create a single dataset that could readily respond to grouping levels (vs. as you've indicated, the resulting values from combining the 2 datasets only produces grand totals...)
Certainly wish that I could be of more help beyond the obvious suggestion to talk to whoever created the initial datasets and have them create a combined version for you to use as well? Sure hope that something works out for you. best wishes!
Random Solutions  
 
programming4us programming4us