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

Problem while converting database-stored reports to .rtm files.

edited March 2003 in End User
Dear Mr, Mrs,

I've got a problem.

When I convert my reports that are stored in a databasefield (blob) to a
file, my Report Data (in designer click Report, then data) settings are
lost! When I restore this setting manualy and save the report again, the
problem is gone.

I use the following method:

with Dm.ppReport do
begin
Application.ProcessMessages;
//DataPipeline, Name, NameField, and TemplateField properties.
Template.DatabaseSettings.DataPipeline := Dm.ppReportTool;
Template.DatabaseSettings.NameField := 'Description';
Template.DatabaseSettings.Name := ReportName;
Template.DatabaseSettings.TemplateField:= 'ReportFile';
Template.LoadFromDatabase;
//Report loaded from database, let's save it to a RTM file.
Template.DatabaseSettings.DataPipeline := Nil;
Template.DatabaseSettings.NameField := '';
Template.DatabaseSettings.TemplateField:= '';
Template.FileName :=
IncludeTrailingBackslash(ExtractFilePath(Application.ExeName)) +
'Reports\' + ReportName + '.rtm';

Template.SaveToFile;
end; //with Dm.ppReport

I am using Delphi 5 with ReportBuilder 7.01 Enterprise.

What is going wrong? Some setting forgotten or......?

Thanks in advance and best regards,


Mischa E.J. Hoogendoorn

Comments

  • edited March 2003
    They should not get lost. Are you using DADE? I am guessing that you are.
    The pipelines should get created by the template. The only thing that could
    happen is that during your process of converting the reports, the
    datapipeline names changes cause a name conflict and the report saves down a
    different datapipeline nam than the actual datapipeline name defined in the
    template. Are there any other reports that are in existence other than the
    DM.ppReport? Try removing other report objects and remove the datapipelines
    from this datamodule, if they exist, and retest the conversion logic.
    Before you save the report to a file, launch the designer to check to see if
    the report could find the datapipeline that it should be connected to from
    the database version of the template.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.