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

Subreport order problem

edited September 2001 in General
Dear Digital-metaphors,

Thanx for your previous help!!!!

I have a new problem. I working in code ONLY!
I don't arrange my subriports.

Main riport definition:

procedure CreateMainReport;
var MainReport: TppReport;
begin
MainReport:= TppReport.Create(nil);
FMainReport.CreateDefaultBands;
end;

First subriport definition:

procedure CreateSubReport1;
var lSubReport1: TppSubReport;
lReport1: TppChildReport;
lLabel: TppLabel;
begin
lSubReport1:= TppSubReport.Create(nil);
lSubReport1.CreateReport(MainReport);
lSubReport1.Band:= MainReport.DetailBand;

lReport1:= TppChildReport(lSubReport1.Report);
lReport1.CreateDefaultBands;
lReport1.DetailBand.PrintHeight:= phDynamic;

lLabel:= TppLabel.Create(nil);
lLabel.Band:= lReport1.DetailBand;
lLabel.Caption:= 'Portrait';
lLabel.Font.Name:= 'Times New Roman';
lLabel.Font.Size:= 48;
end;

Second subriport definition:

procedure CreateSubReport2;
var lSubReport2: TppSubReport;
lReport2: TppChildReport;
lLabel: TppLabel;
begin
lSubReport2:= TppSubReport.Create(nil);
lSubReport2.CreateReport(MainReport);
lSubReport2.PrintBehavior:= pbSection;
lSubReport2.ParentPrinterSetup:= False;
lSubReport2.Band:= MainReport.DetailBand;

lReport2:= TppChildReport(lSubReport2.Report);
lReport2.CreateDefaultBands;
lReport2.PrinterSetup.Orientation:= poLandscape;
lReport2.DetailBand.PrintHeight:= phDynamic;

lLabel:= TppLabel.Create(nil);
lLabel.Band:= lReport2.DetailBand;
lLabel.Caption:= 'Landscape';
lLabel.Font.Name:= 'Times New Roman';
lLabel.Font.Size:= 48;
end;

Main report printed order is Subriport2, SubRiport1 when procedure calls
order is:

begin
CreateMainReport;
CreateSubReport1;
CreateSubReport2;
end;

Why?

I read your previous message in article about Z-order in design time but
Z-order doesn't work for me...

Thanx for your help,
Attila

Comments

This discussion has been closed.