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

CREATE Subreports Dynamically at Runtime

edited February 2003 in Subreports
Hi, Does anybody know how to dynamically create + Load Sub Reports at
runtime. I have created a small sampler to try and perform this but I get an
exception upon loading the main report (this only happens after I assign the
subreport to the band in either of the prescribed ways)

Ctrl:=TppSubReport.Create(Designer);

etc....

Band.AddObject(Ctrl);
or
Ctrl.Band:=Band;

Also in a similar vein can anyone tell me why when dynamically creating
controls at runtime I have to perform the last line of code in order to
prevent an exception upon loading the report (all the controls appear fine!)
Incidentally I have tried this with the above code and it doesn't solve my
problems.


Ctrl:=TppLabel.Create(Designer);
etc
Band.AddObject(Ctrl);
Band.RemoveObject(Ctrl);


Any help would be most welcome

Regards

Conrad Rowlands
Callards Technology Ltd

Comments

This discussion has been closed.