Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to display multiple reports in single report viewer.

What I have tried:

I have use this
if(combobox.seletedindex == 0)
{
reportViewer1.LocalReport.SetParameters(reportParameter);
                ReportDataSource rd = new ReportDataSource("",dt);

                reportViewer1.LocalReport.ReportEmbeddedResource ="GenerateReport.rdlc";
                reportViewer1.RefreshReport();
}
else
{
same code for next report..........
}
Posted
Updated 7-May-18 6:57am
v2
Comments
Maciej Los 3-May-18 14:11pm    
And what's your question?
Member 11776570 4-May-18 4:37am    
i have to show multiple reports in single report viewer.

You can use subreports in such cases where you want to display multiple reports in a consolidated form.

Add a Subreport and Parameters (Report Builder and SSRS) | Microsoft Docs[^]
 
Share this answer
 
Comments
Member 11776570 4-May-18 4:42am    
sorry but i not understand your answer.
Rajat-Indiandotnet 4-May-18 7:13am    
As per my understanding, there is no direct way to show all your different reports in a single view using report viewer. The alternate solution is to create an SSRS report and add your all other reports as a subreport in the main report.
Member 11776570 4-May-18 7:26am    
Yes i have to do this only. if you have solution of SSRS then tell me.
reshma sai 2-May-19 12:25pm    
How to show the single report for multiple records. I mean how to generate the 5 reports at a time for 5 different records instead of running the report 5 times
This is the proper solution.

if(...)
{
reportViewer1.LocalReport.ReportPath = "GenerateReport1.rdlc";
reportViewer1.LocalReport.SetParameters(reportParameter);
reportViewer1.LocalReport.DataSources.Clear();
ReportDataSource rd = new ReportDataSource("DataSet1", datasource1);
reportViewer1.LocalReport.DataSources.Add(rd);
}
else
{
reportViewer1.LocalReport.ReportPath = "GenerateReport2.rdlc";
reportViewer1.LocalReport.SetParameters(reportParameter);
reportViewer1.LocalReport.DataSources.Clear();
ReportDataSource rd = new ReportDataSource("DataSet2", datasource2);
reportViewer1.LocalReport.DataSources.Add(rd);
}
......
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900