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

Dynamic Report

edited September 2002 in General
Hi,

I want to create a report at runtime:

First Follow the tech-tip to create the report .

In order to keep all the control together in the detailband, I dynamic
create a region

with the following code:

FRegion_Detail := TppRegion.Create(Self);
FRegion_Detail.spHeight := 40;
FRegion_Detail.Stretch := True;
FRegion_Detail.KeepTogether := True;

and with following Code to add Object( include TppDBText and TppDBMemo) into
it:

tmp_Text := TppDbText.Create(Self);
Region_Detail.AddObject(tmp_Text);
With tmp_Text Do
Begin
Band:=ReportObject.DetailBand;
AutoSize:=False;
Alignment:=FDataSource.DataSet.FieldByName(sFieldName).Alignment;
spTop:=FRegion_Detail.spTop;
spLeft:=x+2;
spWidth:=nTmpWidth-5;
DataPipeLine:=DbPipe;
DataField:=MyFieldName;
End;


However, one of the rows is printed on seperate two page. If I don't create
it at runtime, Just create it thorught the Report designer. It works.

Please indicate what is the problem with above code.

Comments

This discussion has been closed.