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

How To Fire Rap ppVariable Without Printing Report

edited January 2002 in General
Hello All:

RB 6.01/Delphi 5. Our reports are one record/one page reports with a few
variables. We have successfully created an "Alternative Raw Print" method
for directly printing to Dot Matrix printers. We simply pull the Datafields
out of the report, format them, and mix them with our printer escape codes.

PROBLEM: We want to get the text out of the ppReport Variables. We want
to do this without calling ppReport1.Print. Our current solution is as
follows:

lDevice := TppDevice.Create(Self);
lDevice.PageSetting := psLastPage; // See ppTypes
lDevice.Publisher := ppReport1.Publisher;
ppReport1.CachePages := True;
ppReport1.PrintToDevices;


Is it possible to directly fire the ppVariable calculations themselves
without doing the above ( If so Can you provide an example ) ??? DO you have
any suggestions on the above ???



Thank you.


Neil Huhta

Comments

  • edited January 2002
    After looking at the source, you'll have to create the TppVariable
    descendent, THuhtaVariable, which overrides the function Printing so that it
    always returns true. This is necessary because, in the method
    TppVariable.Compute, there is an exit to check if printing. If it is
    printing, then it will trigger the private OnCalc method. The only
    downside, is that all of your templates will have to be modified to use
    THuhtaVariables.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    I forgot to clarify, that the public method which triggers the OnCalc, is
    the Variable.Compute method.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.