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

Wrong data when printing multiple copies of a report

edited January 2002 in General
I am designing a dispatch label print. The user selects the record in a
table that they want be print one or more Dispatch Labels for. If they
select a record and only print one label then all is OK the fields on the
label are populated from the selected record. If they print more than one
record then the first label is OK however the second and subsequent labels
print details of a record from the previous customer.

Before printing I set:

ppDispatchlabels.PrinterSetUp.Copies := iNoLabels;
ppDBPiplnSaDispat.RangeBegin := rbCurrentRecord;
ppDBPiplnSaDispat.RangeEnd := reCurrentRecord;
ppDispatchLabels.Print;

Have tried using the BeforePrint, AfterPrint and EndOfPage events to ensure
that the correct record is active, with no luck.

I'm sure the answer is simple but have spent hours on this and am running
out of ideas.

Comments

  • edited January 2002
    Everytime you call print, the datapipeline clears its bookmarks, and runs
    through the dataset from the first record. You are gonna want to change the
    query, to onyl return the records that should be in the report. You are
    using a TTable, you could traverse the datapipeline with bookmarks, as shown
    in the installed main reports demo project #112.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Thanks for that!! Got it working.
This discussion has been closed.