PageChange, PageSummary, OnBeforePrint called on wrong Page
dschuch
Dresden,Germany
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)
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
and you will need to use the obp event of the footer with the page sum to retrive the gathered value