Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SelectPrinter problem

Status
Not open for further replies.

Frank336

MIS
Aug 6, 2002
41
CA

Hi, im using CR8.5 (RDC), VB6, Access 2000, Windows 2000.

Im trying to use the SelectPrinter method but it crash my system. I'm using the following code :


Report.SelectPrinter Thedriver, Thedevice, Theport
CRViewer1.ReportSource = Report
CRViewer1.ViewReport

(NOTE : Thedriver, Thedevice and Theport values are correct)

(Im previewing the report)
If i dont use SelectPrinter in my code (and print to the default printer) everything is fine. But if I use the method, the report will crash after a certain amount of data have been display... Let me explain.

Im using dynamic report so the formating of the report change depending on the options choose by the user.

With the default options, in the preview, the first page appear, but if i change pages, when the 4th page appear, the program crash (and VB crash). And if I change options, there is less data displayed on each page and the report will crash after maybe the 8th page...

What the problem ? Am I using the method correctly ?

Thanks,
Frank

(sorry for my bad english)

 

Sorry, just solve my problem... SelectPrinter reset some properties. So I have to save some values.

Dim a, b, c

a = Report.PaperSource
b = Report.PaperOrientation
c = Report.PaperSize

Report.SelectPrinter Thedriver, Thedevice, Theport

Report.PaperSource = a
Report.PaperOrientation = b
Report.PaperSize = c
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top