cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set the printer for a report at runtime in vb.net?

Former Member
0 Kudos

I have a crystal report template that prints labels from information held in my sql server 2005 database on a server, using vb.net 2005 and the version of crystal reports that ships with it.

I supply login details to my data sever to the report so that it can access the table to get the label details but when I come to assign crLabel.PrintOptions.PrinterName this is a printer on the users PC, possibly networked, not on the server where my sql database is held.

To test it, I put in the name of my printer ( a Label printer that appears in my Printer settings just as "Label" ) as follows:

crLabel.PrintOptions.PrinterName = "Label"

But it gives me an "invalid printer" error.

What am I doing wrong? Or should I be using a different method to change the printer?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

See page 249 in this White paper:

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

Also, I'd recommend downloading this file:

https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe

Once you've run the above file you will get a number of sample apps. I'd recommend looking at vbnet_win_printtoprinter.

This may be a good resource also:

https://boc.sdn.sap.com/developer/library

Ludek

Former Member
0 Kudos

Thanks, looking at all of those right now!

Answers (0)