Heavy bug w/ BackgroundImages
I've created a two-page report which has different background images their pages. Now I create multiple reports (using PreprareReport(True/False)) and I get AV's or the images where sometimes shuffled (image1 on page2, image2 on page1, no image, ...).
Any ideas?
Any ideas?
Comments
- One report for multiple outputs (yearcalendar, monthcalendar, weekplan, ...)
- A 'main' page containing the header & footer as well as a masterband with one row containing all subreports as 'cross'-reports
- Each cross-report has it's own groupheaders & masterbands
- Some objects & variables were created using scripts
- The 'main' page should have a variable background image
- The 'legend' page (with detailed adress-informations) should have a variable background image
A single report contains the 'main'-page including the 'cross'-subreport (multiple pages) and an additional legend page.
A batch functionality in my app (loop) creates several of these 'single'-reports by using '.PrepareReport(True/False). The background images are references by global variables (initialized with '.FindObject()').
Now - and only sometimes - if the second report is being created, the reference of the background image seems to be invalid:
Unit: frxClass
Method: TfrxPictureView.SetPicture
But, the variable itself isn't 'nil'!
I think, redesigning a background image on the second report (merging) fails sometimes - maybe only on complex reports using several pages with cross-reports and report-merging (PrepareReport(True) -> PrepareReport(False) -> PrepareReport(False) -> ...)
Please help!?!?!?!?
- I assign "Pic1" on the first report (= 1 Page using '.PrepareReport(True)')
- I assign "Pic2" on the second report (= 1 Page using '.PrepareReport(False)')
The created report shows:
- Page1: Pic1
- Page2: Pic1 (and sometimes NO PIC)
If I use the following code snippet just before creating a new report:
...it seems that 'MyPage' sometimes didn't points to the valid address of 'MainPage'. If I trace the source, the 'SetImage' method occurs into an AV cause the passed object (value) seems to be invalid.
BTW: This happens only if I create more than one report using 'PrepareReport(True)' and then (using the same report template) 'PrepareReport(False)'.