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

Problem with version and templates

edited July 2005 in General
Hi,

I use an application similar to Demo End User -> Report Explorer, so I
can edit reports without changing the application. My reports are stored in
DB.

I?ve saved many reports using ReportBuilder version 6.03. Now I migrated
to 7.0 and realized that the Demo End User -> Report Explorer changed it?s
query component from TSQLClientDataSet to TSimpleDataSet.

It happens that when I try to open some template saved with version 6.03
in version 7 it gives me this error message: "Class TdaSQLQueryDataView not
found". And all my pipelines are lost.

Any help?
Thanks
Ricardo Acras

Comments

  • edited July 2005

    You are referring to the DADE plug-in for dbExpress (see
    RBuilder\Source\daDBExpress.pas).

    For Delph i y Borland replaced TSQLClientDataSet with TSimpleDataSet.

    In daDBExpress.pas, you will see that the code is conditionally compiled
    (i.e. look for IFDEF Delphi7).

    You can either recompile it (remove the conditionals).

    Or you will need to convert your reports.





    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2005
    I will see what you mentioned, just one question.
    Is there any way to convert programaticaly my reorts?

    thanks

  • edited July 2005
    Some of the concepts in this article would apply to your situation as well.
    At the bottom of the article are links to downloadable examples of loading
    templates and converting them to ascii text for editing.

    -------------------------------------------------
    Tech Tip: Convert BDE Template Dataviews To ADO
    -------------------------------------------------

    Currently when DADE is used to create dataviews, the DatabaseName is stored
    as part of the query definition. (This is consistent with Delphi's approach
    to specifying a database connection for a Query object).

    When you created the reports originally, the daDBBDE.pas BDE DADE plugin was
    used. Now you want to use ADO. You've already changed the
    Designer.Datasettings but this had no effect on the old reports. They still
    try to use the BDE connection. Changing the Designer.DAtaSettings only works
    for new dataviews that are created, because the new query dataviews are
    using the daADO.pas ADO DADE plugin.

    In order to convert the templates from BDE to ADO, at the minimum you have
    to change the database name and the DADE plugin class names that are stored
    in the templates. When a BDE dataview is created, its class type is a
    TdaBDEQueryDataview. When an ADO dataview is created, its class type is
    TdaADOQueryDataview. These class types are stored in the template. These
    have to be changed before the template is loaded into a report.

    First, compare a BDE report template to an ADO report template which both
    connect to the same database table. Save a BDE and an ADO based report
    template to separate ASCII text files. Now compare the dataview definitions.
    Change the TdaBDEQueryDataview class name to TdaADOQueryDataview in the BDE
    template. Change the BDE alias to your ADOConnection object. Then compare
    the table name and field names of the BDE template to the ADO template and
    change them accordingly, removing the .db extension on the table name is
    necessary. Now load the converted BDE template in your ADO end user
    application.

    The first step is to make a backup of all your templates before continuing
    with a programatic approach. You can convert the templates programatically
    by loading the ASCII template files to a TStringList object. Then loop
    through the lines of the list and change the text programatically. You can
    loop through the files in a directory using ppFileUtils.pas calling the
    GetFileNamesForDirectory procedure to load the file names.

    If you have binary report templates, you'll also be able to convert these
    with an extra couple of steps. You can load the binary template file into
    ASCII format, modify it, and then save it back to binary as shown in the
    example links below. Keep in mind the conversion is performed without
    loading the report template into a TppReport.


    This example shows how to load reports stored to the ReportExplorer database
    tables and convert them to ascii text.

    http://www.digital-metaphors.com/tips/EditTemplatesAsText.zip


    This example shows how to convert an .rtm file to asii text


    http://www.digital-metaphors.com/tips/ConvertBinaryTemplateToASCII.zip



    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2005
    Hi Nard,

    I'm sure all this information you provided me will be really usefull and I
    aprecite very much your help here.
    I have other issue related to this topic and i rather to ask you before I
    proceed converting all my reports. With new version of RB Designer, when I
    create a new report and try to set up the database configuration, the only
    session type available is BDE session. How can I make dbExpressSession
    available?

    Thabks again
    Ricardo Acras



  • edited July 2005
    Hi Ricardo,

    Be sure the "ReportBuilder Data Access for dbExpress" entery is checked in
    the Delphi Installed Packages. If it is not present, you can recompile and
    install the package into the Delphi IDE using the rbDBExx.dpk locaten in
    your \RBuilder\Source directory.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2005
    OK, It worked fine, but now I don't know how to set up the connection to the
    database.

    In previous version (6.03) I just set my Designer.DataSettings.DatabaseName
    to my SQLConnection in FormCreate event and then when I Click File->New in
    the Data Tab it gives to me two options and then I can create my pipelines.

    Otherwise, In 7.0 when I do the same assignment in FormCreate (and My
    SQLConnection is connected at this momment), but when I click File->New in
    the Data Tab it doesn't gives me any option and then I can't create my
    pipelines.

    I think I'm close to the solution.
    Thank You very much.

    --

    -----
    Ricardo Acras
    Acras Desenvolvimento de Sistemas
    www.acras.net
    ricardo@acras.net
    +41-223-9109
    +41-9974-3201
    +42-9108-5672


  • edited July 2005
    I solved the issue, it was just necessary to add the daDBExpress unit to the
    uses clause.
    But what is shaking my head is that no conversion of the templates was
    necessary after adding the unit to the uses...

    Thanks to Nico and Nard for the very helpfull attention.

    --

    -----
    Ricardo Acras
    Acras Desenvolvimento de Sistemas
    www.acras.net
    ricardo@acras.net
    +41-223-9109
    +41-9974-3201
    +42-9108-5672
This discussion has been closed.