简体   繁体   中英

crystal report is not printing online

http://avas.hexaperkeducation.com/demo/Default.aspx

i built this application which print crystal report directly to printer.its working fine on my local system but when i upload it to online server page load keep running .

 con.Open();
 string sql = "select * from Student_Master";
 System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter(sql, con);
 DataSet ds = new DataSet();
 da.Fill(ds, "Student_Master");
 ReportDocument Report = new ReportDocument();
 Report.Load(Server.MapPath("CrystalReport.rpt"));
 Report.SetDataSource(ds);
 CrystalReportViewer1.ReportSource = Report;
 CrystalReportViewer1.DataBind();

 Report.PrintToPrinter(1, true, 1, 1);

Which version of crystal reports runtime you are using on server and on local system? Runtime should be 32bit. You need to setup those two properties.

Report.PrintOptions.NoPrinter = false;
Report.PrintOptions.PrinterName = <printername>;

And printer should be available in network via this name. If you are using IIS then application pool also need access to printer. In app pool advanced settings you need to switch boolean prop "Enable 32-bit apps" to true. If this still does not help you can try change Identity to "LocalService" in those advanced settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM