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?

Comments

  • edited 12:15AM
    looks like this does the tric in the Band.OnAfterCalcHeight

    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.
  • edited 12:15AM
    I was too optimistic. The thing goes bananas with subreports. I'm trying to walk the way of creating a new component and override its draw method now. In this method I would have access to the excact position where I'm on? In't it?

    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...
  • edited January 2005
    I tried the achors but this doesn't work eighter. They link to the start of a band so if a band spans 2 pages... bad..

    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.

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.