Click here to Skip to main content
15,900,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi sir,
I am using a Visual studio 2010 for developing ASP.NET in that using a crystal report viewer to display report in web page in that i got error ,
"Invalid Report Source".
in this line error got ... "CrystalReportViewer1.ReportSource = oRpt;"

Coding:
C#
oRpt.Load(Server.MapPath("CrystalReport2.rpt;));
//set dataset to the report viewer.
oRpt.SetDataSource(ds);

CrystalReportViewer1.ReportSource = oRpt;

//CrystalReportViewer1.RefreshReport();
//CrystalReportViewer1.DataBind();
 }

please tell what is the error in that line of report source
please reply......

Thanks in advance.......
Posted
Updated 1-Oct-11 10:51am
v3
Comments
Sander Rossel 14-Oct-11 8:53am    
Wow, after several weeks you decided to NOT accept my answer after all? :s

There is nothing wrong in the code that you have. This error usually is seen when you have different versions of CR dlls being referenced in your project. Check and verify again that you are using correct version..that should solve your problem.
 
Share this answer
 
As an addition to prdshukla's answer you might want to check if the Server.MapPath("CrystalReport2.rpt") is an actual folder path and exists. It sounds so obvious, but you don't want to know how many people have lost afternoons debugging filename's such as C:\MyFolder\\MyFile.rpt or C:\MyFolderMyFile.rpt (no \) or even C:\MyFolder\MyFile.rpt\
Also make sure the report is not open in CrystalReports when trying to load it. Not sure if it's a problem with all versions, but you'd best make sure.
 
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