Click here to Skip to main content
15,882,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.. I want to generate crystal report in asp .net in Visual studio 2012. But it doesn't giving any error instead browser showing an empty page(No crystal report page).

Steps I have followed to generate a crystal report is as of follows:
1. Took a DataSet. Then added a DataTable. Added three columns as of my sql database table i.e. id,pname,price.
2. Took a CrystalReport.rpt and Selected Use Report Wizard. Added dataset.

C#
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    private SqlConnection cn = new SqlConnection("user id=sa;password=chiklu;database=SRS;server=CHIKLU-PC");
    protected void Page_Load(object sender, EventArgs e)
    {
        cn.Open();
        SqlCommand cmd = new SqlCommand("SELECT abcd.id,abcd.pname,qwer.price FROM abcd JOIN qwer ON abcd.id=qwer.id",cn);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        da.Fill(ds);
        ReportDocument rpd = new ReportDocument();
        rpd.Load(Server.MapPath("CrystalReport.rpt"));
        rpd.SetDatabaseLogon("sa","chiklu","CHIKLU-PC","SRS");
        rpd.SetDataSource(ds);
        CrystalReportViewer1.ReportSource = rpd;
        cn.Close();
    }
} 
Posted
Updated 11-Feb-19 22:54pm
v2

try this:

Have a look here this help me....
1) Go to the C\inetpub\wwwroot folder on any machine that has either/or crystal report runtime engine installations.
2) Copy the aspnet_client folder in the wwwroot directory.

3) Paste this folder in the website directory folder. I assume this would work with a web application that was created from a virtual directory as well, just paste it into the virtual directory.


Crystal-Reports-not-rendering
 
Share this answer
 
v3
Hi Chiklu,

Which version of Crystal Report are you using?
I believe if you add reference of Crystal Reports 13.0.2000.0 version, it should work fine.

Indeed, I'm using it so.

Regards,
Abhi
 
Share this answer
 

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



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