FindBand of type TFrxColumnReport cause error

Hello

With Delphi 10.4 on a relatively complicated report with script, i have intermittent errors on PrepareReport, in debug mode i can stop on a source line that cause the problem, the sequence of calls in script use a TFrxEngine.FindBand(Band: TfrxBandClass) function that return a TfrxBand, and who knows why, the Engine search a TFrxColumnFooter BandClass, not present in my report, this call generates an error, as a workaround i put a TFrxColumnFooter in my report with visible = false, and I no longer have the error even with a large number of calls to PrepareReport.

It's a bit annoying to add a TFrxColumnReport band to each of my reports

So what is the problem


Bruno

Comments

  • PolomintPolomint Australia

    It is a bit hard to know how to help you!

    Our "relatively complicated reports" don't cause any problems.

    Can you post a cut down version / demo here to give us an idea where to look?

    Have you raised a Support Ticket?

    Cheers, Paul

  • No I did not submit any tickets, maybe i should start with that,

    but i have difficulty reproducing a "cut down version" of a problem.

    I'm working on it this morning, then i will come back here


    Au revoir

    Bruno

  • I tried to make the simplest version, the error occurs only once in a while but it occurs. (maybe after about twenty launches)

    I think the problem begin in the initialization of a script with the engine.PageHeight invocation as a final result the call to TFrxReportPage.FindBand as you can see on Call stack capture, and the ClassType Band : TFrxBandClass is TFrxColumnFooter

    The TFrxReportPage.FObjects appears to be an empty reference


    I'm a little disappointed I can't make it more visible


    Cheers, Bruno

  • Finally I found a solution, the problem was in calling Engine.Pageheight in the initialzation section of the script, I moved it on a OnBeforePrint event of my 3 report pages and the error no longer occurs.

    The Engine .PageHeight requires the height of the current page that is processing by the engine, and during certain times this page is not defined.

    This code worked like this since at least delphi 2007 why not anymore, I didn't look any further


    Bruno

  • PolomintPolomint Australia
    edited August 2020

    Magic 😎


    Cheers, Paul

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.