Karthik K

Karthik K

  • 813
  • 738
  • 186.4k

Crystal Report Not Showing No bugs ?.

Sep 12 2019 9:41 PM
Hi,
 
I am using vs 2010 and I installed crystal Report 13. Crystal Report not showing and not showing any error too. I couldn't fix this issue. I don't know why it's not crystal Report Not working. If anyone knows, guide me with a suitable solution. I share my code which uses crystal Report.
 
Database : mysql
 
Design :
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportExample.aspx.cs" Inherits="ReportExample" %>  
  2. <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"  
  3. Namespace="CrystalDecisions.Web" TagPrefix="CR" %>  
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  5. <html xmlns="http://www.w3.org/1999/xhtml">  
  6. <head runat="server">  
  7. <title></title>  
  8. </head>  
  9. <body>  
  10. <form id="form1" runat="server">  
  11. <div>  
  12. <asp:Button ID="btnReport" runat="server" Text="Report"  
  13. onclick="btnReport_Click"/>  
  14. </div>  
  15. <div>  
  16. <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />  
  17. </div>  
  18. </form>  
  19. </body>  
  20. </html>  
Back end :
  1. public void loadcry()  
  2. {  
  3. TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();  
  4. TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();  
  5. ConnectionInfo crConnectionInfo = new ConnectionInfo();  
  6. Tables CrTables;  
  7. string q2 = "SELECT * FROM " + Cmb_BranchName + ".Stk_View1;";  
  8. DS = ObjMain.GetData_DS(q2);  
  9. rep = new ReportDocument();  
  10. rep.Load(Server.MapPath("CrystalReport.rpt"));  
  11. rep.SetDataSource(DS.Tables[0]);  
  12. CrTables = rep.Database.Tables;  
  13. foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)  
  14. {  
  15. crtableLogoninfo = CrTable.LogOnInfo;  
  16. crtableLogoninfo.ConnectionInfo = crConnectionInfo;  
  17. CrTable.ApplyLogOnInfo(crtableLogoninfo);  
  18. }  
  19. rep.Refresh();  
  20. CrystalReportViewer1.ReportSource = rep;  
  21. Session["Report"] = rep;  
  22. CrystalReportViewer1.DataBind();  
  23. CrystalReportViewer1.RefreshReport();  
  24. )  
Thanks in Advance
Karthik K

Answers (3)