On what page did I get printed...
I add an keyword index to my documents which could have hundreds of items. I do it by calling my function which adds it to a clientdataset based on several criterea. The clientdataset gets grouped pinted via an TFrxDBDataset. This is allright, did it always like this in quickreport, however I'm having a problem:
The element to index can be anyware on the band. Top, bottom, in the middle etc. I'm also let the bands split if they are to big to print in the free space. Problem is now the pagenumber. In the before print or after calc height of the element I'm to early, as it is done before bandprinting and in the afterprint of the element I'm to late because it is done after the band has printed. If the band was split over 2 pages I don't know where my element has gone...
So what to do... use the anchors...? Than I must add hundreds of unique anchors, aggegrate them (for example country Russia was on page 3, 8, 16) etc, seems not attractive. Calculate with X, Y etc where my thing possibly could have been printed? Looks less work as the rest of the train stays the same...
Anyone any thoughts?
The element to index can be anyware on the band. Top, bottom, in the middle etc. I'm also let the bands split if they are to big to print in the free space. Problem is now the pagenumber. In the before print or after calc height of the element I'm to early, as it is done before bandprinting and in the afterprint of the element I'm to late because it is done after the band has printed. If the band was split over 2 pages I don't know where my element has gone...
So what to do... use the anchors...? Than I must add hundreds of unique anchors, aggegrate them (for example country Russia was on page 3, 8, 16) etc, seems not attractive. Calculate with X, Y etc where my thing possibly could have been printed? Looks less work as the rest of the train stays the same...
Anyone any thoughts?
Comments
If memo.Top + memo.Height > Engine.FreeSpace Then
PageNo := (<Page#> + 1 )
Else
PageNo := <Page#>;
If someone who longer works with fastreport sees that I must add some spacingheight or other things, please let me now, but for now it works in my report.
What a shit, just because an element.onbeforePrint / onafterprint is something complete different as I was used to in quickreport! I'm trying the onbeforedraw...
If someone has a more simple solution... please... for now I see the new component, see the draw event, kan add code but after running the link with the code is gone... there has work to be done somewhere...
The reason I choose Fastreport were the wrong onces. Subreports looked so nice but it is useless for me if I can't get the right pagenumbers. I rebuild everything in using only bands but this gives a complecated structure. The same complicity I had in Quickreport so the advantage has gone.