Solved

SSRS:  Copying a "Total" Field from a Subreport

Posted on 2013-12-20
4
3,424 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 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

17 Experts available now in Live!

Get 1:1 Help Now