Hi All ,
I am using crystal report in vs 2008 . When I load the report in cystal viewer.
its shows like Load report failed exception
* I have checked the sql authentication. That's also correct. I am sharing my code.
anybody knows suggest me with example ..
Sample Code :
- public void loadcry(string DCNO,string VID)
- {
- TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
- TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
- ConnectionInfo crConnectionInfo = new ConnectionInfo();
- Tables CrTables;
- string q2="SELECT * FROM VIEW_DCREPORT WHERE DCNO="+DCNO +" AND VID="+VID +"";
- Ds = SqlObj.GetData_DS(q2);
- rep = new ReportDocument();
- rep.Load(Server.MapPath("~/DCRPT.rpt"));
- rep.SetDataSource(Ds.Tables[0]);
- CrTables = rep.Database.Tables;
- foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
- {
- crtableLogoninfo = CrTable.LogOnInfo;
- crtableLogoninfo.ConnectionInfo = crConnectionInfo;
- CrTable.ApplyLogOnInfo(crtableLogoninfo);
- }
- rep.Refresh();
- CrystalReportViewer1.ReportSource = rep;
- Session["Report"] = rep;
- CrystalReportViewer1.DataBind();
- CrystalReportViewer1.RefreshReport();
- }
Thanks in advance ,
Karthik k