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

Controlling Print To File at Print Time

edited April 2009 in General
Using ReportBuilder 7.X

Question

Is it possible to Control Print to File.

I need to change the Length of a field at print time

Example:

label2

In the setup - I set its length to 800 which is the max possible this field
should ever be.
However, in many cases the record is less than that and i need to set it to
the calculated size before printing to file.

Is this possible?

Is it possible to control any portions of this Print to file...at print time
(before Print, after print)?
Are the objects avaiable?


We are registered users of the 10.x and above i believe, but have still not
gotten around to recompiling are application in Delphi 2009 and the new
ReportBuilder....so, that is not an option at this point.


Thanks

Shane

Comments

  • edited April 2009
    I'm thinking i need access to the Print to File Setup Dialog (or its
    properties)...so i can access "Save Length"


  • edited April 2009


    Yes, you can confgure the relevant properties via code.

    The PrintToFile dialog manipulates the Band.Save, Component.Save, and
    Component.SaveLength properties. The Component.SaveLength property is used
    when exporting a file of type ftFixedLength. It is /not/ used for
    Comma-delimited, Tab-delimited type files.

    Typically the SaveLength value is the same for the entire report, however,
    if you want to modfy SaveLength for each line, try using the
    Band.BeforePrint event.

    There are some good PrintToFile examples installed with the product. Run
    RBuilder\Demos\Reports\Demo.dpr and check out the PrintToFile section. There
    are examples of exporting several types of text files, including custom
    formatted files.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.