Click here to Skip to main content
15,909,325 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Everything goes good but The printer never print the report.


Reportes rep = new Reportes();
               DataTable dt = new DataTable();

               dt = rep.GetDataReporRQ(id, TipoDoc);

               Rpt_Requisicion rpt = new Rpt_Requisicion();
               rpt.SetDataSource(dt);
               rpt.PrintOptions.PrinterName = printer;
               rpt.PrintToPrinter(1,true, 0, 0);

               EventLog.WriteEntry("Impreso" + TipoDoc + "_" + id.ToString());



What I have tried:

Reportes rep = new Reportes();
               DataTable dt = new DataTable();

               dt = rep.GetDataReporRQ(id, TipoDoc);

               Rpt_Requisicion rpt = new Rpt_Requisicion();
               rpt.SetDataSource(dt);
               rpt.PrintOptions.PrinterName = printer;
               rpt.PrintToPrinter(1,true, 0, 0);

               EventLog.WriteEntry("Impreso" + TipoDoc + "_" + id.ToString());
Posted
Comments
RickZeeland 10-Nov-19 15:45pm    
We have no idea what library or software you are using, please add more information to your question.
Dave Kreskowiak 10-Nov-19 20:55pm    
First off, the printers that you see on your account do not exist for the System account. The System account doesn't have any printers defined.

To get around this, you have to create a user account to run your service. Login to the console with this account, setup the printers you want, then logout. Log back in with your account and setup the service to LogOn with the account you created for this purpose.

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