Template... Help please.
Dears,
I have a report in a file RTM. In execution time I load this report like
this:
ppReport1.Template.FileName := 'test.rtm';
ppReport1.Template.LoadFromFile;
In this report, I have a component ppLabel for which I need to allocate the
return of an existent function in my unit in Delphi. Is that possible? How
do I do?
Thanks,
[]s,
Alessandro Ferreira
I have a report in a file RTM. In execution time I load this report like
this:
ppReport1.Template.FileName := 'test.rtm';
ppReport1.Template.LoadFromFile;
In this report, I have a component ppLabel for which I need to allocate the
return of an existent function in my unit in Delphi. Is that possible? How
do I do?
Thanks,
[]s,
Alessandro Ferreira
This discussion has been closed.
Comments
Options:
1. Use RAP code (i.e. the Calc workspace included with ReportBuilder
Enterprise) to code an event-handler for the Label.OnPrint event. In the RAP
event-handler call your Delphi function. Note: You can easily extend RAP
with your custom functions that are registered to the CodeToolbox.
2. Use Delphi code to code an event-handler for the Label.OnPrint event. The
event-handler method must be a published method of the form/datamodule upon
which the Report component resides. When the template is loaded, then the
event-handler will be re-attached by the Delphi streaming system.
3. Set the Label.Caption after loading the report template. The report and
all components within it are Owned by the Form/DataModule. You can use the
FindComponent method of the Form/DataModule to retrieve the object by name.
var
lLabel: TComponent;
begin
lLabel := FindComponent('myLabel');
if (lLabel is TppLabel) then
TppLabel(lLabel).Caption := 'myCaption';
// or attach an event-handler
TppLabel.OnPrint := myLabelOnPrintHandler;
end;
--
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks,
[]s,
Alessandro