Printing a report
I have a one page report that takes a while to generate. After it's
generated and sent to the viewer for display I then click the print button
to print it, why does the report recalculate everything before sending it to
the printer?
Is there a way to simply send what's in the viewer to the printer with out
going through the report generation again?
David
generated and sent to the viewer for display I then click the print button
to print it, why does the report recalculate everything before sending it to
the printer?
Is there a way to simply send what's in the viewer to the printer with out
going through the report generation again?
David
This discussion has been closed.
Comments
When I print this report, all the values are now doubled, if I print it
again they are trippled. How would I keep the calculations from happening
with each print event?
David
The reason ReportBuilder needs to regenerate all the pages again when
printing is that they are not saved in memory when previewing. To increase
the speed, try turning the Report.CachePages to True and see if that helps.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
between prints jobs.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
inside the template. In the Report.BeforePrint event in the template I
added the line
Report.Reset; and then tried to run the report, that's when I got the error.
Is there anyway to reset the report from inside the template?
David
David
Please send an example of this to support@digital-metaphors.com and I'll
take a look at it.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
insite. I have a deposit table that has 58 fields in it that contain
various values for things such as late charges, bad checks, interest paid,
principal paid and other things as well. I need to build a section of the
report dynamically based on weather or not these fields do not equal 0.
Right now I'm using 4 TStringList components created in the GlobalOnCreate
event of the report, then they are initialized in the Report.OnPrint event.
One string list contains the description of the accounting entry, one holds
a count of the entries in this type and the other two hold the accumulated
total and average of the entries for each type. I'm using report templates
because there are so many different reports that I didn't want to have 50 or
so report objects on the form. All the code for each report is stored in
the template, which is where all the calculations are summing the above
string lists. When I preview the report the values appear to be correct for
each type, however, if I print the report, the values are again calculated
making the printed report values that are twice what they should be. If I
then print the report again the values are trippled and so on.
Is there away to insure, from inside the template, that when I click the
print button the report starts fresh as if this were the first time is was
run?
David
Sorry, I was unaware you were using RAP to construct your reports. How are
you populating the StringLists? Be sure you are freeing the TStringList
objects once you are finished with them. How are you displaying the values
inside the StringLists? My first suggestion would be to get this working
without RAP, just using Delphi event handlers. This will allow you to debug
our/your code using Delphi to find the issue. Then once it is working, you
can port the code over to RAP.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
initializes the stringlists (clears them then populates them with the base
data). I am now calling this routine from the OnPrintDialogClose event
which appears to be working. I also re-initialize any needed global
variables in this event as well.
Thanks for your replies!
David Looney