I am using Crystal Reports Automation Server in my application. I have create a modal form with an optiongroup control to allow the user the choice of previewing or printing the report. In the Click event of the OK button I have this code:
local oCrystal, oReport
oCrystal = CreateObject("Crystal.CRPE.Application")
oReport = oCrystal.OpenReport(ThisForm.cFileName)
do case
case ThisForm.optDestination.Value = 1
oReport.Preview
case ThisForm.optDestination.Value = 2
oReport.PrintOut
endcase
The problem is, when the user previews the report, the preview window is displayed and immediately closes.
How do I make the preview window remian viewable until the user chooses to close it?