Smithy888 0 Newbie Poster

Hi,

I have the following code in a D2005 .Net winform.

ReportDoc := ReportDocument.Create;
ReportDoc.Load(ReportPath);
ReportDoc.PrintOptions.PrinterName := PrinterName;
ReportDoc.PrintToPrinter(1,true,0,0);

I get the message "Invalid printer specified" only if I try to print to a printer that is not the current default(CD) one. Having PrinterName as the CD one prints fine.

The PrinterName I pass is the simple one ie. "hp LaserJet 1010 Series Driver".

Please can you help?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.