CrystalReport not displays in browser

Posted by Klbaiju under Others on 10/6/2015 | Points: 10 | Views : 686 | Status : [Member] | Replies : 1
Hi, Iam using CrystalReport in my application.iam using VS2010. connections are working fine and . my problem is after adding crystal report and set connection, add a webpage and drag a CrystalReportViewer from tool box and wrote following code in load event

ReportDocument reportdocument = new ReportDocument();

reportdocument.Load(Server.MapPath("~/CrystalReport.rpt"));

CrystalReportViewer1.ReportSource = reportdocument;



it is not showing crystalreport in browser. and not showing any error.

How to solve this

Regards

Baiju




Responses

Posted by: Rajnilari2015 on: 10/7/2015 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
Your existing code looks fine ; however you may need to add

reportdocument.SetDataSource(<YOUR DATASOURCE>) // Missing


So just try this

ReportDocument reportdocument = new ReportDocument(); 


reportdocument.Load(Server.MapPath("~/CrystalReport.rpt"));

reportdocument.SetDataSource(<YOUR DATASOURCE>) // Missing

CrystalReportViewer1.ReportSource = reportdocument;


You can also refer : https://msdn.microsoft.com/en-us/library/aa691464(v=vs.71).aspx

--
Thanks & Regards,
RNA Team

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response