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

Variable at preview <> at print ??

edited January 2002 in General
I have apparently put something in the wrong place on one of my
reports. When previewing, the total in a variable is correct. When
that same page is then printed, the total is different.

What might cause a variable to change values during the printing
process? What events fire at that point?

Thanks,

Gene Weinbeck
gene@FundRaiserSoftware.com
Professional Support Software

Comments

  • edited January 2002
    The OnCalc is the only event which should be used to calculate a value for a
    TppVariable.

    When the report is sent to the printer, after the preview, then the report
    pages are regenerated (if Report.CachePages is False). If you are using
    Delphi variables, make sure that you are reinitializing them in the
    Report.BeforePrint event.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    "Jim Bennett \(Digital Metaphors\)"
  • edited January 2002
    A little more information about the report layout...

    It uses a group that is based on a customer ID sort of field. The
    variable in question is not in the group footer, but is in the summary
    band, and the CalcComponent is in the detail band of the subreport.

    It's a two-pass report.

    And, I'm using RB 6.03 now.

    Gene Weinbeck
    gene@FundRaiserSoftware.com
    Professional Support Software
  • edited January 2002
    You setting the OnCalc assignment to nil in the BeforePrint event of the
    Report, or in the DetailBand...? Have a look in the main reports demo
    project. There is an event tracker demo. You can use this example to see
    when the events are firing in relation to each other. Perhaps the OnCalc is
    getting triggered before the method pointer is assigned a value other than
    nil.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    (I found a solution, but it indicates either a bug in your product, or
    a flaw in my understanding... read on.)

  • edited January 2002
    Gene Weinbeck wrote:


    Further testing found that the total is 99.9% correct, but still
    wrong. I will send the code to you by email.

    Thanks,

    Gene Weinbeck
    gene@FundRaiserSoftware.com
    Professional Support Software
  • edited January 2002
    Thanks, I received your demo.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.