How do I create TppGroup´s in run-time?
In my project I do need to create some TppGroup´s in run-time, did I
try to run the code below, where do I attribute the property Parent of
TppGroup to my TppReport, is which defining the break field and did I
also create the GroupHeader and GroupFooter of TppGroup, defining in the
two the property Parent equal to TppGroup that I want to create, however
when running the program the TppGroup doesn't appear, did I also verify
that the property GroupCount doesn't also change when I create a new
group, as I should do?
The code is:
Groups : array of TppGroup; (* Actually I use a
dynamic-array of objects, that perfectly worked for TppLabels,
TppDBText, etc *)
Headers : array of TppGroupHeaderBand;
Footers : array of TppGroupFooterBand;
.
.
.
for i:=0 to TotalGroups do (* TotalGroups indicate how many groups I
want to create *)
SetLength(Groups, length(Groups)+1);
SetLength(Headers, length(Headers)+1);
SetLength(Footers, length(Footers)+1);
Groups[i] := TppGroup.Create (MyForm);
with Groups[i] do
begin
Parent := MyReport;
BreakName := 'BREAK'+inttostr(i+1);
DataPipeline := ppMyDataPipeline;
KeepTogether := True;
end;
Headers[i] := TppGroupHeaderBand.Create (Groups[i]);
with Headers[i] do
begin
Parent := Groups[i];
BottomOffset := 0;
Height := 50;
end;
Footers[i] := TppGroupFooterBand.Create (Groups[i]);
with Footers[i] do
begin
Parent := Groups[i];
BottomOffset := 0;
Height := 50;
end;
end;
try to run the code below, where do I attribute the property Parent of
TppGroup to my TppReport, is which defining the break field and did I
also create the GroupHeader and GroupFooter of TppGroup, defining in the
two the property Parent equal to TppGroup that I want to create, however
when running the program the TppGroup doesn't appear, did I also verify
that the property GroupCount doesn't also change when I create a new
group, as I should do?
The code is:
Groups : array of TppGroup; (* Actually I use a
dynamic-array of objects, that perfectly worked for TppLabels,
TppDBText, etc *)
Headers : array of TppGroupHeaderBand;
Footers : array of TppGroupFooterBand;
.
.
.
for i:=0 to TotalGroups do (* TotalGroups indicate how many groups I
want to create *)
SetLength(Groups, length(Groups)+1);
SetLength(Headers, length(Headers)+1);
SetLength(Footers, length(Footers)+1);
Groups[i] := TppGroup.Create (MyForm);
with Groups[i] do
begin
Parent := MyReport;
BreakName := 'BREAK'+inttostr(i+1);
DataPipeline := ppMyDataPipeline;
KeepTogether := True;
end;
Headers[i] := TppGroupHeaderBand.Create (Groups[i]);
with Headers[i] do
begin
Parent := Groups[i];
BottomOffset := 0;
Height := 50;
end;
Footers[i] := TppGroupFooterBand.Create (Groups[i]);
with Footers[i] do
begin
Parent := Groups[i];
BottomOffset := 0;
Height := 50;
end;
end;
This discussion has been closed.
Comments
http://www.digital-metaphors.com/tips/DynamicReportCreation.zip
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com