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

Incorrect total when printing from preview dialog

edited May 2004 in General
I was wonder if anyone has had a similar problem that could maybe
give me some idea as to what might be my problem.

When I preview the report at run time the total in the preview is
correct, but when I print from the preview the total is off by the
amounts on the last page. If I print without previewing the total
is correct.

The total is stored in a TppVariable in the Summary Band, the
OnCalc event of the TppVariable is basically
Value := Value + DataPipline['Value'];

I'm using Delphi 5, ReportBuilder Professional Edition 7.01.

Comments

  • edited May 2004
    Hi Charley,

    As a test, try commenting out all your event code, and re-running the
    report. If this solves the problem, periodically begin adding the code back
    to isolate the problem. Usually when the printed output does not match the
    preview output, it is due to some event code being executed at an
    inopportune time while the report is trying to print.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004
    The TppReport component prints in more than one format, I copied the
    component to a blank form and set the properties of the label, variable
    dbedit and any other components on the report component to how they
    would be for when the report format that causes this problem is to be
    printed.
    The only event needed is the OnCalc event for the TppVariable
    component that accumulates the totals.The total still prints correctly
    in the Preview Dialog but not on the hard copy.

    If I only have a one page report, the individual amounts are on the report
    but the total is 0. If I have more than one page the total is always off by
    the amounts on the last page. I've tried setting the ResetType property of
    the TppVariable to veReportStart and veReportEnd and get the same results.

    There is one result that I cannot reproduce consistently and that is the
    total
    on the Preview Dialog is the same as the hard copy but both are off by the
    amounts on the last page.

    I emailed the sample application to DM's support, hopefully you can find my
    problem.

This discussion has been closed.