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
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