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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Garbled Printout with RDC and RPT.PaperOrientation 1

Status
Not open for further replies.

JNeave

Programmer
Jan 28, 2002
125
GB
Hi,

Using VB and the RDC I'm having real problems with printing reports. Heres the story.

User selects printer

Ori = rptMain.PaperOrientation
Call rptMain.SelectPrinter("", strPrinterName, "") Calling this resets the PaperOrientation
If Ori <> CRDefaultOrientation Then
rptMain.PaperOrientation = Ori
End If
rptMain.PrintOut

This produces a seriously messed up print out, all the text is a garbled mess.

Now, the line in Red is where it all goes wrong. When you select the printer and then set .PaperOrientation it all goes wrong. We fixed this problem in another location by selecting the printer and orientation before we exported the report and some saved data to a *.rpt file.

This code is for reloading and printing that report at a later date, but selecting the printer will garble the report again. We could re-export the report to another file, but thats crap and we're not going to do that.

Two possible solutions I have but can't implement wthout help

1) In Crystal Reports, you can refresh a report from the saved data, how can you do this programatically? (Will force Crystal to re-draw the data, thus fixing the garbage print out?)

2) Does anybody have or know where I can find the latest version of the Crystal Automation Print Engine, CPEAUT32.DLL? On the Crystal support site is states that this file has a problem when you call .SelectPrinter and then .PaperOrientation (it GPF's), same cause, different symptoms maybe?

Or any other solutions will be nice ;-)

Cheers,

Jim.
 
Back to the top, I need this answer! ;-)
 
We had a similar problem... long, long story short... it appears that the select printer funstion is trashing a few variables...

Backup the paper orientation, paper size, and paper source prior to calling the select printer function... then restore them upon return. It appeared to fix it for us...

Hope it works,

David
 
Yep, we solved it with that too after much trial & error coding [curse][curse][curse][curse][curse]

Ta,

Jim.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top