Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi!
I am New to Crystal Reports, and I have some issue. I am working with ASP.NET 4.5 Using VS2012. I have created the Crystal Report but that is not showing in the Crystal Report Viewer, It shows the blank page.
Crystal Report Data Source and Report Parameter every thing goes well but when i go to the report viewer page it shows nothing only the blank page.

Here is the Code


C#
ReportDocument rpt = new ReportDocument();

rpt.Load(Server.MapPath("ReportEngine.rpt"));

CrystalReportViewer1.ReportSource = rpt;

rpt.SetDatabaseLogon("sa", "123");

ReportDataSet DS = new ReportDataSet();

using (SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["DbConnectionString"]))
{
con.Open();
string query = "SELECT ID As Column1,NameEn As Column2, NameAr As Column3, Email As Column4, Email As Column5";

SqlCommand cmd = new SqlCommand(query, con);
SqlDataAdapter adapter = new SqlDataAdapter(query, con);
adapter.Fill(DS, "ReportTable");
rpt.SetDataSource(DS);
}
string[] cols = { "ID", "NameEn", "NameAr", "Email", "Email" };

for (int i = 0; i < cols.Length; i++)
{
rpt.SetParameterValue(i, cols[i].ToString());
}
CrystalReportViewer1.ReportSource = rpt;



Thanks in Advance
Posted
Comments
Jigar Sangoi 20-Oct-13 3:22am    
Is crystal report comes on localhost?

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900