Creating a ppShape or ppLabel at Runtime
Hi there,
I've looked through the newsgroup, searched Codenewsfast.com and also looked
through the RB demos but I still can't get a shape to appear on my detail
band by creating it at runtime.
I've been trying some code I found online to create a ppLabel but it just
isn't working for me... does anyone know what I'm doing wrong? I would have
thought that it should be quite simple to create shapes/labels at runtime...
procedure TfrmReport_0012.ppDetailBand1BeforePrint(Sender: TObject);
var
my_Label: TPpLabel;
begin
inherited;
my_Label:=TppLabel.Create(Self);
my_Label.spTop:=10;
my_Label.spLeft:=10;
my_Label.caption:=' This is a teststring..';
my_Label.Band:= ppDetailBand1;
end;
I've tried moving the code to the various Before/After Print/Generate events
but still don't seem to be having any luck.
Kind regards,
Graham
I've looked through the newsgroup, searched Codenewsfast.com and also looked
through the RB demos but I still can't get a shape to appear on my detail
band by creating it at runtime.
I've been trying some code I found online to create a ppLabel but it just
isn't working for me... does anyone know what I'm doing wrong? I would have
thought that it should be quite simple to create shapes/labels at runtime...
procedure TfrmReport_0012.ppDetailBand1BeforePrint(Sender: TObject);
var
my_Label: TPpLabel;
begin
inherited;
my_Label:=TppLabel.Create(Self);
my_Label.spTop:=10;
my_Label.spLeft:=10;
my_Label.caption:=' This is a teststring..';
my_Label.Band:= ppDetailBand1;
end;
I've tried moving the code to the various Before/After Print/Generate events
but still don't seem to be having any luck.
Kind regards,
Graham
This discussion has been closed.
Comments
I forgot to mention that I'm running the latest version of ReportBuilder 11.
Kind regards,
Graham
I've just found the ppPaintbox component which appears to give me the
flexibility to do exactly what I need.
Kind regards,
Graham
Great, glad you were able to utilize the PaintBox component. Below is an
article on how this feature can be used.
As for your label code, I believe you need to either define a width and
height or set AutoSize to True to see the text.
http://www.digital-metaphors.com/rbWiki/RCL/Fundamentals/How_To...Use_the_PaintBox_Component
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com