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

Print only the data fields

edited December 2003 in General
Hi,

is it possible, to print only the data fields of a report and leave the rest
(lines, boxes, labels etc) unprinted and still maintain the positions of the
data fields as if the rest was printed?
What I want to have is leave the choice to the user if he/she wants to print
the complete form or just the data on a preprinted form.

Stefan

Comments

  • edited December 2003
    Hi Stefan,

    The easiest way to go about this would be to create a report object loop
    that sets any component on the report that is not data aware to be
    invisible. Below is a quick example of how you might go about this.

    uses
    ppClass;


    procedure HideComponents(aReport: TppCustomReport);
    var
    liBand: Integer;
    liObject: Integer;
    lObject: TppComponent;

    begin

    for liBand := 0 to aReport.BandCount-1 do

    for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do
    begin
    lObject := aReport.Bands[liBand].Objects[liObject];

    if not(lObject.IsDataAware) then
    lObject.Visible := True;
    end;

    end;


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.