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?

Comments

  • edited 8:20AM
    It works well for me. Could you send me a demo project with this error? tz@fast-report.com
  • edited 8:20AM
    If I create a simple demo app loading different images, all seems to work well - aaarrrgghhh! But my report in my 'life' application is more complex and very hard to extract, but this is, what it contains:

    - 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!?!?!?!?
  • edited 8:20AM
    ...and what also happens:

    - 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)
  • edited 8:20AM
    Sorry, I cannot reproduce this behaviour on my test project.
  • edited 8:20AM
    If I get more 'spare'-time, I try to extract the necessarry code into a sample app. For now, I had to disable the background images if I use the '.PrepareReport(True/False)' feature, o/w my app crashes all three times ;)
  • edited November 2004
    ...maybe it's a reference pointer problem. Sometimes, I got a 'pointer' A/V, sometimes an 'Abstract'-Error.

    If I use the following code snippet just before creating a new report:
     ? MyPage := TfrxReportPage(FastReport.FindObject('MainPage'));
     ? MyPage.BackgroundImage.LoadFromFile('xxxx');
    

    ...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)'.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.