0
votes

I successfully created Crystal Report doc in asp.net(C#) 4.0 , Crystal Report 13 by SAP but problem is that after clicking export button, it doesn't export neither it prints, why ?

enter image description here

Code:

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack) 
    {
        Dataset_load();
    }
}

protected void Dataset_load() 
{
    SqlConnection sqlcon = new SqlConnection(conStr);
    SqlCommand sqlCom = new SqlCommand("select * from Login", sqlcon);
    SqlDataAdapter sqlDA = new SqlDataAdapter(sqlCom);
   // DataSet ds = new DataSet("CRDataSet");

    try
    {
        sqlcon.Open();
        //sqlCom.ExecuteNonQuery();
        //sqlDA.Fill(ds,"Login");

        DataSet1 ds = new DataSet1();
        DataTable dt = new DataTable("DT_CR");
        sqlDA.Fill(dt);
        ds.Tables[0].Merge(dt);
        ReportDocument rd = new ReportDocument();
        rd.Load(Server.MapPath("CrystalReport.rpt"));
        rd.SetDataSource(ds);
        CrystalReportViewer1.ReportSource = rd;


    }
    catch (Exception exc)
    {
        Response.Write(exc.Message);
    }
    finally 
    {
        sqlcon.Close();
    }
1
Your code doesn't show anything about exporting. Do you want to use the Viewer's export and print buttons? Do you get any errors?campagnolo_1

1 Answers

0
votes

Check to make sure that your browser doesn't have a pop-up blocker enabled.