In the Destroy Event of the form, you should do
This.oReport = NULL
This.oCrystal = NULL
>Yes, the control is on the form, called .oleCrystalViewer
>
>
>>>How are you actually instantiating the viewer? Do you have it dropped on a form?
>
>
>>We have a reports form with the CR 9 viewer control. When a report is chosen, parameters chosen/set, and then run we populate form properties for the report like this...
>>
>>.oCrystal = CREATEOBJECT("CrystalRuntime.Application")
>>.oReport = .oCrystal.OpenReport(.cReport)
>>
>>... where .cReport is the name of the report from a table. When we open the CR viewer we also display button to close the preview so the user can return to the reports form to pick another report.
>>
>>The question is this, what is the best way to close the viewer and release the report? We've tried a couple of different things, like set the .oCrystal and .oReport properties to .NULL., but if the report has parameters the CR "Enter Parameter Values" dialog appears. If we release the report shouldn't the report, and its parameter requirements, be gone?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer