Click here to Skip to main content
16,004,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working in Crystal report at a project. I have a requirement and I need Help On following metter:

I have crystal Report in my webpage. The .net Crystal report viewer views this report. But when I click the print button on crytal report viewer it exports the report in .pdf format. I don't want to click again and again. I want to open the print dialog Box instead of exporting at .pdf formet.

Is it Possible??? if yes How???
Posted
Updated 19-Dec-17 20:26pm

connect printer to that system
 
Share this answer
 
SqlCommand addcmd = new SqlCommand(addstr, con);

SqlDataAdapter addda = new SqlDataAdapter(addcmd);

DataTable adddt = new DataTable();

addda.Fill(adddt);



ReportDocument crystalReport = new ReportDocument();

crystalReport.Load(Server.MapPath("reportname.rpt"));
crystalReport.SetDataSource(adddt);

CrystalReportViewer1.ReportSource = crystalReport;
crystalReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "anyname");
con.Close();
 
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