How do I set the printer for a report at runtime in vb.net?
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?