`
Par2: Appending reports 2001-05-21 -- Rick Martin What you need to do is: 1) Run first report. 2) In the AskPreview method of the first report, call the second report. Pass in a Self.PreviewQueue to the second report. Declare the parameter as a pointer to a PreviewQueue. 3) In the second report, go to the AskPreview method. If the second report was called via the first, Loop through the Self.PreviewQueue and add a copy of each record to the passed in queue. Make sure to add them to the end, not the beginning of the queue. 4) Now Free(Self.PreviewQueue) in the second report and don't call the parent.AskPreview method. 5) Back in the first report, make note of the extra records added to the PreviewQueue. The system won't automatically delete the temp. files for these extra report pages. I keep a separate queue just for this. 6) Let the Preview for the first report happen. You'll have page from both reports combined. 7) In the .Kill for the first report delete the extra report pages from the second report. I know this works. There may be a simpler way. I haven't reviewed this code in a couple of years so the requirement of deleting the extra pages may not be necessary anymore. This would definitely simplify the code. Printed November 21, 2024, 11:02 am This article has been viewed/printed 35218 times. |