Click here to Skip to main content
15,915,975 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm working with an asp.net web form Crystal report. The report generates when I pass the parameter but it fails to print and export to PDF. Nothing happens when I click the export button, and there is no error message.

C#
protected void Button1_Click(object sender, EventArgs e)
{
    SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString);
    ReportDocument test = new ReportDocument();
    cn.Open();
    SqlCommand cmd = new SqlCommand("SELECT_DATA", cn);
    cmd.CommandType = CommandType.StoredProcedure;
    SqlDataAdapter da = new SqlDataAdapter(cmd);
    DataTable ds = new DataTable();
    cmd.Parameters.Add(new SqlParameter("@INPUT", TextBox1.Text));
    da.Fill(ds);
    test.Load(Server.MapPath("EOR.rpt"));
    test.SetDataSource(ds);
    test.SetParameterValue("input", TextBox1.Text);
    CrystalReportViewer1.ReportSource = test;
    CrystalReportViewer1.DataBind();
    cn.Close();
}


What I have tried:

I copied the file to my website project:

C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319 folder and paste to my project folder

but still not working..
Posted
Updated 30-Jul-16 6:31am
Comments
Suvendu Shekhar Giri 30-Jul-16 0:52am    
any observation from debugging?

1 solution

hiii KyLim0211,

I had same problem i surfed many solutions and finally i resolved it by pasting the whole folder of aspnet_client containing 2_0_50727 and 4_0_30319 both folders in my web application then i was able to see the print and export tool bar of crystal reports.
hope it will solve yours too.
 
Share this answer
 
Comments
KyLim0211 31-Jul-16 20:34pm    
copy from local c to my website project?
Member 9994815 31-Aug-16 11:07am    
yes copy it in your web application.and it will work.

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