cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports XI PDF Export Options

Former Member
0 Kudos

Can someone point me to a list of the ExportOptions for a PDF? I'm trying to print a report and export it to a PDF and I'm running into the "page header and page footer too big for the page" error. I'm able to generate the printout fine, but the PDF is giving me the error. Code is wrriten in Progress 4GL.

An additional question that has me even more perplexed. This code generates the printout correctly on one server but no PC, and on my PC it generates the PDF but not the printout. Any ideas on that one?

IF SEARCH(cStartDirectory + "BOLTEST.rpt") EQ ? THEN DO:

MESSAGE "Could not find report: " + cStartDirectory + "BOLTEST.rpt".

RETURN (FALSE).

END.

chCrystalRep = chCrystalApp:OpenReport(cStartDirectory + "BOLTEST.rpt",1).

/* Generate PDF */

chCrystalRep:ExportOptions:DestinationType = 1.

chCrystalRep:ExportOptions:DiskFileName = cExportLoc + "boltest.pdf".

chCrystalRep:ExportOptions:FormatType = 31.

chCrystalRep:ExportOptions:PDFExportAllPages = TRUE.

chCrystalRep:DisplayProgressDialog = TRUE.

chCrystalRep:EXPORT(FALSE).

/* Print Copy */

chCrystalRep:SelectPrinter(cDriverName, cPrinterName, cPort).

chCrystalRep:PrintOut(FALSE).

RETURN(TRUE).

END FUNCTION.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I've tested a solution that I believe will fix the issue. Using a Windows API call to "SetDefaultPrinter" from my code, I change the default printer to a preset one that I know is correct. Then I generate the pdf. Then, at the end of the prorgram, I use "SetDefaultPrinter" to set it back to the original printer.

Former Member
0 Kudos

Hi, have had the same problem you have to go in to the crystal reports go to file, page setup click printer and select the printer that you want, ie the one it was designed for. Then save the report. This solved it for me.

Former Member
0 Kudos

Indeed I can. But the formatting that it uses is based on the default prnter currently set on the PC. When the default printer is set to a regular printer using 8.5 by 11 sheets, it prints correctly and leaves the page formatting alone.

However, if the default printer is set for a label printer or soemthing with a different paper input, the crystal report tries to shrink the page to fit that size of a printout. Then information gets cut off at both the sides and the bottom.

Former Member
0 Kudos

Digging through the forums, I found this little guy:

Change default printer in CrystalReportViewer:

It's not quite what answering my problem, but I suspect the issue here is the same one I'm having. Originally designed a report on a printer, and when it tries to print on another PC (or a server), it grabs the default printer instead of the same printer I designed it on. The printer I designed this using is a default printer for the entire company so every PC and server has it installed on there.

Any thoughts?

Former Member
0 Kudos

Just wondering if you are able to export the report to a PDF file from within the crystal report designer?