I have a report that I load from an rtm file (because it is web-based).
At run time, I would like to load a jpg (client logo) onto the title
page. Jpg files vary by client, so the logo can't be stored with the rtm.
Can anyone point me toward how to do this?
Thanks.
Comments
I am unclear about how you are loading these .rtm files. Are you using the
server edition of ReportBuilder or are you simply loading .rtm files from
the internet stored on a separate server (ftp perhaps)? If you are not
using the Server edition, you can utilize the template events, specifically
the OnLoadEnd event to load a custom image object before the template is
loaded. Check out the article below for more information on using these
events.
----------------------------------------------
Tech Tip: Using Template Events
----------------------------------------------
The Report.Template object has several events that can be used for
customizing what happens when a report is loaded or saved:
- OnLoadStart
- OnLoadEnd
- OnNew
- OnSaveStart
- OnSaveEnd
The OnLoadEnd and OnNew events are often used to perform actions related
to report and data initialization.
The OnSaveEnd event is often used to save additional descriptive
("meta") data to the database each time the report is saved.
Example:
The Report.Template events are public and therefore must be assigned at
run-time.
1. In the private section of your form declaration you can declare an
event-handler method:
TForm = class(TForm)
private
procedure myTemplateOnLoadEndEvent(Sender: TObject);
public
end;
2. In the Form.OnCreate event, you can assign the event-handler to the
event:
procedure TForm1.FormCreate(Sender: TObject);
begin
ppReport1.Template.OnLoadEnd := myTemplateOnLoadEndEvent;
end;
3. Implement the event-handler method:
procedure TForm1.myTemplateOnLoadEndEvent(Sender: TObject);
begin
{add code here to initial the report or data, etc. }
ppReport1.PrinterSetup.MarginTop := 0.5;
end;
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I am using the server edition. One of the problems here is that I'm new
to the server edition (though I have been using RB for several years).
Is there an easier way to do this with the server edition?
We are assigning string values at run time using parameters:
oReport.Parameters.Items[ 'rpParameter_Name' ].Value
I can't figure out how to assign an image this way. Or am I on the
wrong track?
Sorry I'm not able to describe the situation adequately.
If you are not
Where are the image files stored?
For future reference, you might want to post server related questions to the
Server newsgroup. Specify what type of server app you are building - for
example are using the WebTier to published reports to a browser or the
ClientReport to build a client app.
There is no built-in way to pass an image as a parameter from a client app
(WebTier or ClientReport) to the Server. You could pass the file name of the
jpeg and on the server load the JPEG from a file on a local or netword
driver. Or you could store the JPEG's i in a database and do it that way.
On the Server side you can use the ReportVolume.BeforePublishReport event to
configure the report.
--
Nard Moseley
Digital Metaphors Corporation
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com