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 :
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportExample.aspx.cs" Inherits="ReportExample" %>
- <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
- Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:Button ID="btnReport" runat="server" Text="Report"
- onclick="btnReport_Click"/>
- </div>
- <div>
- <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
- </div>
- </form>
- </body>
- </html>
Back end :
- public void loadcry()
- {
- TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
- TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
- ConnectionInfo crConnectionInfo = new ConnectionInfo();
- Tables CrTables;
- string q2 = "SELECT * FROM " + Cmb_BranchName + ".Stk_View1;";
- DS = ObjMain.GetData_DS(q2);
- rep = new ReportDocument();
- rep.Load(Server.MapPath("CrystalReport.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