Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all;
Already I've designed crystal report is named : "CrystalReport1" inside my project is named :"Strore"
Also I've designed crystal report is named : "CrystalReport2" inside my project is named :"Strore"
Now : I want to call every one by public variable which I want to put this variable in Module inside my project : "Store"
I tried to create pubic variable in my module of type report ... not name :"crystalRepott1" or "crystalReport2" ...
I have tried for example : public rpt as new crystalReport (without 1 or 2 )
but it's not accept .
what the corecct way I can declare it .
thanks
Posted

1 solution

I'm not sure why you want to do that, however if you want to view any report in a specific report viewer, something like this will work:

C#
public void ShowReport(string ReportFileName, DataSet MyDataSource)
{
    ReportDocument _report = new ReportDocument();
    _report.Load(Server.MapPath(ReportFileName));
    _report.SetDataSource(MyDataSource);
    MyViewer.ReportSource = _report;
    MyViewer.Visible = true;
    MyViewer.RefreshReport();
}
 
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