Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
Hi Frnds,
In my Web Application,I am going to generate multiple Reports for different purpose.How to use single crystalreportviewer to show all the reports whenever i need.Is it possible or not.Using Separate crystalreportviewer for every Report is good or single crystalreportviewer for All Report.Give Some Examples.
Posted

1 solution

generate multiple Reports for different purpose.How to use single crystalreportviewer
Well, that's the general way - have one reportviewer and show the needed report in it. All you have to do is define the reportviewer source report at runtime.

Viewer is a control that will show a report that we ask it to. You can change the report as per need for the single viewer. You will view one report at a time as defined by you in it.

Example:
C#
ReportDocument _rdStudents = new ReportDocument();
string reportPath = Server.MapPath("Students_CrystalReport.rpt");
_rdStudents.Load(reportPath);
	 
_rdStudents.SetDataSource(dt);
CrystalReportViewer1.ReportSource = _rdStudents;

If needed refer: Runtime dynamically bind data into a crystal report using Asp.net C#[^]
 
Share this answer
 
Comments
Vani Kulkarni 28-Dec-12 4:52am    
Crisp and clear information! ::thumbsup:: 5+
Sandeep Mewara 28-Dec-12 6:12am    
Thanks Vani :)

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