PageChange, PageSummary, OnBeforePrint called on wrong Page

dschuchdschuch Dresden,Germany
edited February 2011 in FastReport 4.0
Hy, there seems to be a bug that should be solved at least in FR 5. ;o)

A) you have a OnBeforePrint Event in a MasterBand, e.g. to calculate a PageSum.

[img]style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> your page is nearly full, there are about 5 pixel left on lets say Page 1 C) It seems that the OnBeforePrint event is Fired on Page 1. After that, FR seems try to Draw the row and now FR notices, the page is full. So the Row is Paint on Page 2, but, you remember OnBeforePrint was called Before Paint on Page 1, so the Value of that Row is still in the Sum of Page 1. (notice that allow split is true, perhaps thats the reason ....) Actually we solve that problem with a code like this: If Engine.CurY>950 ...; //not enough space left. btw: i did not check the with a simple case. in our case the structure is like this: Page 1 -Header -MasterDataBand (just one row) --SubReport in that MasterData <-> here are the DataRows that will behave like above. -Footer with Page Sum --Page SubReport -Header -MasterDataBand (n rows, stretch true [there is a memo column],[/img]allow split)

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:27PM
    the subreport takes control of the engine so you may need to use the oad event of a memo to gather values
    and you will need to use the obp event of the footer with the page sum to retrive the gathered value

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.