Solved

SSRS:  Copying a "Total" Field from a Subreport

Posted on 2013-12-20
4
3,316 Views
Last Modified: 2013-12-23
Hello:

Although my first attachment is called "POOR_RCG_Subreport.rdl", it is actually my main report.  The other attachment is a subreport of this main report, in fact.

I'm trying to pull the "Total" field from the subreport onto the main report, so that I can have a Grand Total on my main report.

I have tried everything, but I can't get this to work.  I even took a copy of the Data Set from the subreport and made it one of the Data Sets on the main report.

How can I get this accomplished?

Thanks!

Much appreciated!

TBSupport
POOR-RCG-Subreport.rdl
POOR-RCG-Detail-Subreport2.rdl
0
Comment
Question by:TBSupport
  • 3
4 Comments
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39733054
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39733066
Also I do alittle research and they said that

Pass value from sub-report to main report is not supported by the current version of Reporting Services.

Please add additional dataset in the main report. How you aggregate in the sub-report, then how you aggregate in the main report.

Hopefully this helps.
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39733068
If On the Main report You create another dataset equal than the dataset that contains the subreport you will be able to accomplish more or less will be like this

Create two datasets - one for the main report one that is the same used in the sub report.

Add your sub report but grab the total from the second dataset on the main report.

I'm not actually taking the info from the sub report. I'm only using the sub report to display the information correctly. I'm using the second dataset just to total what's in the sub report.

=Sum(Fields!Total.Value, "DataSource1") + Sum(Fields!ThinkTotal.Value, "DataSource2")
0
 
LVL 8

Accepted Solution

by:
vr6r earned 500 total points
ID: 39733122
It will depend greatly on the state of your datasets.  If your subreport data is static, then k-designers above response may work very well for you.

However, if your subreport is dynamic and is generated using paramaters from your main report's dataset, things get much more difficult because in that case you wouldn't be able to add those sub-report datasets beforehand.

The best approach in this circumstance would be to re-examine your dataset queries, and the design of your main report and subreport.  For example you could potentially include the Grand Total in your main report dataset by joining and totalling the data on sql, then you wouldn't have to change your subreport at all.

Or you could redesign your subreport and instead make it a detail section of your main report, in which case you could use the normal sum functionality in SSRS without jumping through a bunch of extra hoops.

In most of my reports like this I have used a combination of the two examples I just gave.  Sub-reports can be helpful in cases where you'll need to display the same data in multiple different reports, but for most of my purposes I found that my data was so dynamic that it was easier to just combine all the data into a single report.  I also often calculate the grand totals in my sql queries because I'm already joining to get all the detail anyway, and it shifts that processing load to sql server instead of the reporting server which I have often found to be much faster in large reports with complex data.

Hope that helps!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now