Home Subreports
New Blog Posts: Merging Reports - Part 1 and Part 2

Data prints twice

edited July 2003 in Subreports
RB7.02, D7

Data is traversed twice in some rare cases in my report. I have a subreport
with a detailband that has this event:

procedure TReportReceivingWorksheetForm.ppDetailBand3BeforePrint(
Sender: TObject);
begin
WOLORegion.Visible := qWOL.FieldByName('Order_no').AsInteger <> 0;
if WOLORegion.Visible then
ppDetailBand3.Height := 0.9
else
ppDetailBand3.Height := 0.5;
end;

This detailband has printHeight = phStatic. (I need it to be static because
if WOLORegion is not visible, then I need for there to be some blank space
to print out under the band; thus, Height := 0.5.)

Anyway, the main detailband in my report has a group around it to keep it
together. When there are just the right number of records in my subreport
to take it almost to the end of the page, the next record in my main
detailband seems to not recognize this keeptogether property, and it prints
out halfway, and subsequent pages re-traverse a lot of data and are just
very, very wrong.

Is there anything I could be doing differently to fix this? (These problems
are extremely frustrating.)

Thanks,
George

Comments

  • edited July 2003
    Use the BottomOffset property instead of trying to change the height of the
    detail band if you want extra space. Set it on either the region or the
    detail band itself. The data shouldn't be traversed twice. What other event
    handlers do you have? Try disconnecting them and get this bottom offset
    requirement working first. Then we'll try to figure out why the data is
    appearing to be traversed twice.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    If WOLORegion is visible, then I don't want a BottomOffset, so that property
    is not what I need.

    The main detail band has a before print event, which just sets the visible
    property on the subreports that are in it. All the other events are simple
    gettext events.

    Thanks,
    George

  • edited July 2003
    Does your dataset support bookmarks properly- ie. is it a proper TDataset
    descendent?

    Can you send an example to support@digital-metaphors.com using DBDemos data
    that exhibits this data traversal problem?


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.