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

Creating components at run-time

edited May 2002 in General
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

Comments

  • edited May 2002
    I tried recreating your setup but was unable to make the DBCalcs behave in
    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

  • edited May 2002
    I tried that, and the subreports cannot shift relative to the region because
    they are section style subreports. I need each subreport to start on a new
    page.

    Natalie


    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited May 2002
    Sorry, I didn't notice that you mentioned that they were section style
    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

This discussion has been closed.