I am new to Crystal report, using a tutorial i have created a report in VS.2012 and Crystal Report "CRforVS_13_0_5". When i run this report, it shows nothing but a bank page. Even the toolbar of "Crystal Report Viewer" is not shown.
I have searched a lot on google and in Stackoverflow, but none of the solutions given helped me with this.
The steps i have followed to create this report is as below:
My code:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection CN;
String MyConnectionString = "";
MyConnectionString = "data source=.; initial catalog=Test; user id=sa; password=Abc1234";
CN = new SqlConnection(MyConnectionString);
CN.Open();
string SQL = null;
SQL = "SELECT * FROM UserInformation ORDER BY Username";
SqlDataAdapter myDA = new SqlDataAdapter(SQL,CN);
CN.Close();
DatasetEmp DS = new DatasetEmp();
myDA.Fill(DS,"UserInformation");
ReportDocument myRPT = new ReportDocument();
myRPT.Load(Server.MapPath("~/CrystalReportEmp.rpt"));
myRPT.SetDataSource(DS);
CrystalReportViewer1.ReportSource = myRPT;
}
You need to keep aspnet_client folder to your application directory. You will be find this aspnet_client folder in C:\inetpub\wwwroot location.