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

Configuring template for end-user report

edited June 2002 in General
Hi.

For my end-user report, I would like to configure it so when someone creates
a new report, the header is already configured with an icon and some text.
This material should be the same for every report.

Questions are:

1. What is the best way to configure it so when someone starts a new report,
it loads with this template (but will not change the template if the user
changes something)

2. How can I stop the user changing the template part of the report (image,
text) while allowing them to change the rest of the report

3. Can I allow an administrator (in my security schema) to edit the template
analogously to editing a report so all new reports created with the report
explorer will see this modified template as the starting point for designing
a report?

Thanks,

Lauchlan M.

Comments

  • edited June 2002
    1. To get the standard header load a predesigned template into the report.
    See RBuilder\Demos\End User\Dynamic Subreport Loading demo.

    2. Since the design of the header is in a whole separate template, simply
    restricting access to the template (whether in a separate file or in a
    database) should do the trick. For example, make the file read only. You
    still can't prevent the user from placing additional content into the header
    but at least they can't change the standart template. Of course you can
    always delete any of additional content from the report during the process
    of loading the header template.

    3. Same idea as 2, allow the admin to edit this file.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited June 2002
    > 1. To get the standard header load a predesigned template into the report.

    OK, I've seen that. But assuming I want one standard report template to load
    on each new report (as the whole report, not just as a subreport band), how
    do I do it?

    I figure I set up the filename for the template proerty of the report, then
    have in the ReportDesigner CreateReport handler

    procedure TDataModuleReportExplorer.ReportDesignerCreateReport(
    Sender: TObject; const aDataName: String; var aReport: TObject);
    begin
    Report.Template.LoadFromFile;
    end;

    {all the report components and pipes are in a datamodule)

    This doesn't however seem to load the file into the report.

    I also have in the DataModule Create Handler:

    begin

    Report.Template.OnLoadEnd := LoadEndEvent;

    end;

    procedure TDataModuleReportExplorer.LoadEndEvent(Sender: TObject);
    begin
    Report.OnPreviewFormCreate := PreviewFormCreateEvent;
    end;

    procedure TDataModuleReportExplorer.PreviewFormCreateEvent(Sender: TObject);
    begin
    ppReport1.PreviewForm.WindowState := wsMaximized;

    TppViewer(Report.PreviewForm.Viewer).ZoomSetting := zsPageWidth;
    end;

    Thanks,

    Lauchlan Mackinnon.
  • edited June 2002
    You must specify the file to load from. ie.

    Report.Template.FileName := 'mytemplate.rtm';
    Report.Template.LoadFromFile;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited June 2002
    > You must specify the file to load from. ie.

    I have a filename set up in the design time properties . . . do I need to do
    it in runtime as well?

    Thanks,

    Lauchlan M.
  • edited June 2002

    "Alexander Kramnik (Digital Metaphors)" wrote
This discussion has been closed.