Click here to Skip to main content
15,867,851 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Hi All,

I can not populate my Crystal Report. Could you please see my C# code and let me know what's wrong I did.

ReportDocument reportCaseByAgency = new ReportDocument();
reportCaseByAgency.Load(Server.MapPath(@"~/Reports/RPT_CaseByAgency.rpt"));
reportCaseByAgency.FileName = Server.MapPath(@"~/Reports/RPT_CaseByAgency.rpt");
reportCaseByAgency.SetParameterValue("@Num2", num2); // @UserId is the parameter you added at the design of the crystalReport and userid is the value for the parameters
reportCaseByAgency.SetParameterValue("@Year", year);
ReportViewer1.ReportSource = reportCaseByAgency;

Please help me! Any suggestion also highly appreciated.
Thanks in Advance
SHafik
Posted
Updated 5-Jun-15 3:41am
v2
Comments
Dianne Ramos 8-Jun-15 3:52am    
have you set a datasource somewhere in your code for your report?

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