Creating components at run-time
Hello,
I have a report whose summary band contains two lines and three
section-style subreports. At run-time I create TppDBCalc components that
also go in the summary band, ideally between the two lines. One line is set
to Top 0, and the other has a Top of 0.5. The dbcalc components are created
as follows:
with TppDBCalc.Create(Self) do
begin
Band := bndSummaryBand;
Left := rLeft;
Width := iWIDTH;
DataPipeline := plDetailPipeline;
DataField := cdsIn.Fields[iLoop].FieldName;
DBCalcType := dcSum;
DisplayFormat := '#,0';
TextAlignment := taRightJustified;
Top := 0.2;
end;
When the report preview opens, I get the two lines, but no dbcalc components
within them. The dbcalc components show up on a new page AFTER all three
section-style subreports.
What am I doing wrong here?
Thanks,
Natalie
I have a report whose summary band contains two lines and three
section-style subreports. At run-time I create TppDBCalc components that
also go in the summary band, ideally between the two lines. One line is set
to Top 0, and the other has a Top of 0.5. The dbcalc components are created
as follows:
with TppDBCalc.Create(Self) do
begin
Band := bndSummaryBand;
Left := rLeft;
Width := iWIDTH;
DataPipeline := plDetailPipeline;
DataField := cdsIn.Fields[iLoop].FieldName;
DBCalcType := dcSum;
DisplayFormat := '#,0';
TextAlignment := taRightJustified;
Top := 0.2;
end;
When the report preview opens, I get the two lines, but no dbcalc components
within them. The dbcalc components show up on a new page AFTER all three
section-style subreports.
What am I doing wrong here?
Thanks,
Natalie
This discussion has been closed.
Comments
the way you describe. One solution is to place the lines and the DBCalcs in
a region component. Then set the subreports to ShiftRelativeTo the region.
When creating the DBCalc make sure to set it's Region property to the region
component.
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
they are section style subreports. I need each subreport to start on a new
page.
Natalie
"Alexander Kramnik (Digital Metaphors)" wrote
subreports. You should still be able to place the lines and the dbcalcs in
the region which can be statically sized with the subreports following the
region. Do the dbcalcs still print after the subreports by doing this? If
so, can you provide us with a sample project that reproduces the problem?
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com