OnCreate does not fire in 10.05
Hi,
We upgraded from 10.02 to 10.05 a few months ago, before 10.06 was released.
And we have now noticed that the report's OnCreate does not fire as it did
before. With 10.02 with a report with AutoSearch turned on, if you request
a Print Preview from the report explorer the following happens:
1. OnCreate fires
2. The Search dialog appears.
3. The user clicks OK
4. OnDestroy fires
5. OnCreate fires
6. The report is generated and preview.
With 10.05 step 5 does not happen, so in the case of our particular report
the TStringList created in OnCreate and freed in OnDestroy does not exist
when the GroupAfterPrint event tries to access it.
Was the removal of the call to the OnCreate event intentional? I have the
source, is there a code change I could make to restore the call? Is this
related to the fix listed in the 10.05 changes as "Preview page now calls
Report.InitializeParameters prior to calling Preview.BeforePreview"
Thanks,
William
We upgraded from 10.02 to 10.05 a few months ago, before 10.06 was released.
And we have now noticed that the report's OnCreate does not fire as it did
before. With 10.02 with a report with AutoSearch turned on, if you request
a Print Preview from the report explorer the following happens:
1. OnCreate fires
2. The Search dialog appears.
3. The user clicks OK
4. OnDestroy fires
5. OnCreate fires
6. The report is generated and preview.
With 10.05 step 5 does not happen, so in the case of our particular report
the TStringList created in OnCreate and freed in OnDestroy does not exist
when the GroupAfterPrint event tries to access it.
Was the removal of the call to the OnCreate event intentional? I have the
source, is there a code change I could make to restore the call? Is this
related to the fix listed in the 10.05 changes as "Preview page now calls
Report.InitializeParameters prior to calling Preview.BeforePreview"
Thanks,
William
This discussion has been closed.
Comments
The GlobalOnCreate is now called from the Report.InitializeParameters
method. This change was made because it was firing too late (after the
autosearch dialog had been displayed). It needs to fire before any other
events.
- The Report.Print method internally calls Report.InitializeParameters as
the first line of code.
- The DesignPreview has this code
if FReport.InitializeParameters then
FReport.PrintToDevices;
- If you are calling PrintToDevices, add a line of code like the one shown
above. That should fix it.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com