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

RB + DB-Changes

edited January 2003 in General
Hi,

I'd like to change a certain field in the DetailDB when the record was
printed to the printer. I resolve this in the OnTraversal-event of the
Detail-TppDBPipeline testing, if DeviceType is set to dtPrinter. This works
fine as long as all pages are printed; when the User selects e.g. page 5
only, then the first 4 pages a traversed (internally) but DeviceType is
already set to dtPrinter what leads to my DB is being changed for these (not
printed) pages as well.

Does anybody know how to address this problem?

cu

Toni

Comments

  • edited January 2003
    Add a check in the OnTraversal to see what the page request is. If it is in
    the range, then you can update the database record if the current page is
    one of the requested pages.

    Check if Report.PrinterDevice <> nil.

    Then check the page request on the printer device to see what pages should
    be going to the printer. In the OnTraversal you can check the
    Report.Engine.Page.AbsolutePageNo property to see what the currently
    generating page number is. Then reference the
    Report.PrinterDevice.PageRequest object.

    Here are the properties onthe page request. Chekc the PageSetting first,
    then use the PageRequested if psSinglePage or check the PageList if
    psPageList. This is the PageRange type as well:

    TppPageSettingType = (psAll, psPageList, psSinglePage, psFirstPage,
    psLastPage, psPageRange);
    TppPageRangeType = (prAll, prOddPages, prEvenPages);

    TppPageRequest = class..
    ..
    published
    property PageList: TStrings read FPageList write SetPageList;
    property PageRequested: Integer read FPageRequested write
    FPageRequested;
    property PageSetting: TppPageSettingType read FPageSetting write
    FPageSetting;
    property PageRange: TppPageRangeType read FPageRange write FPageRange;


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.