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

Printing empty on-demand subreports

Status
Not open for further replies.

DianeJ

Programmer
Sep 22, 2000
15
0
0
CA
I'm using Crystal 7 MR1 API Print Engine calls in my VC++ app to print the report that is open in the viewer window.

The series of print engine calls that I make to print are:
(1) PEGetSelectedPrinter to get the printing info from the report, and I use the returned info to set the page orientation for the default printer
(2) PESelectPrinter
(3) PEOutputToPrinter
(4) PESetPrintOptions(m_hJob, NULL) to prompt the user for print options
(5) PEPrintWindow to print the open report window in the viewer - main report or an on-demand subreport

The above steps work no problem for a main report whether it is empty or not, and for an on-demand subreport if it is not blank.

But if the on-demand subreport is blank (sql for it doesn't return any records) then the following error occurs when I try to execute step #4.

'Unhandled exception in ReportViewer.exe (CRPAIG32.DLL): 0xC0000094: Integer Divide by Zero'

Does anyone know of a solution to this problem?

I know that there is a round-about way to suppress a blank/empty on-demand subreport, but I have quite a few reports, and if there is a way to fix this problem through my app it would be faster.

Thanks,
Diane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top