Home DADE

Dataconnection

edited October 2007 in DADE
Hi!

I want to load all my reports dynamically through a common unit that
consists only
of a TppReport. I would like to call a report like this.

PrintReport('Test');

procedure PrintReport(RName: String);
begin
with MyReport do
begin
SaveAsTemplate := true;
Template.SaveTo := stDatabase;
Template.DatabaseSettings.Name := RName;
Template.DatabaseSettings.NameField := 'item_name';
Template.DatabaseSettings.TemplateField := 'template';
LoadFromDataBase;
Print;
end;
end;


How do i tell MyReport where it should search for the report, as there is no
way to set
a connection on a TppReport? The TppReport should have a connection
property. We have several sql-servers and several databases on each server
and they all have their own copy of the reports in their databases. Our
customers use the same software but have different dataconnections.

Please help!

Best regards,
Terje

Comments

  • edited October 2007
    Hi Terje,

    In order to successfully load your report(s) from database, you will need to
    assign the Template.DatabaseSettings.Datapipeline property. This
    datapipeline is to be directly connected to a dataset with your report
    templates and names. Otherwise you might consider using the Report Explorer
    to navigate the templates on your database as it is demonstrated in the
    End-User demos located in the \RBuilder\Demos\... directory.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.