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

Multiple databases? Possible?

edited September 2004 in End User
I currently have an end user reporting solution that uses Report Builder
with a RemObjects/DataAbstract server. The Reports/Folders pipelines are
linked to DataAbstract tables, and the only thing that a direct connection
to the databases is still required for is the actual traversal of the data
during a print/preview.

I would like to extend the RemObjects/DataAbstract server to support
multiple dataase types (currently the app uses MSSQL Server, we want to add
support for Interbase/Firebird, so that we can use an embedded database).
What I wanted to do was create a database connection, in code, when my End
User Reporting application fired up, depending on what kind of database the
user had configured - so if they were configured to use Firebird then I'd
create an IBX database connection, if they were configured to use MSSQL then
I'd create an ADO database connection, I'd then set the connection strings
etc. accordingly and modify the Dictionary.BuilderSettings and the
Designer.DataSettings to match this and voila: bob's your uncle... at least
that was my idea.

So, essentially, I'd like one End User Reporting tool that could be used
with Firebird OR MSSQL. To start with, can you see any problems with that
(possible)?

After that, I wanted to know if it would be possible to have these share the
same report designs. Currently, we allow users to export reports to files
and install reports (from files), and we ship a number of report packs for
our software (basically just zips containing lots of rtm files), which users
can install. What I'm wondering is, if we build a report while using MSSQL,
and export this to a file, could someone who is using the software with
Firebird then install that report? I imagine, out of the box, the answer
would be no, but I was reading "Updating the DatabaseName of a DADE Query"
in the tech-tips newsgroup, and I wondered if I could extend this concept to
simply reassign the databasename, type, dialect etc on report load to match
that of the currently configured database... does this sound technically
feasible?

Maybe what I should be doing is writing a DADE driver for DA, I imagine this
would resemble the MIDAS DADE driver that you already have... but it sounds
like writing a DADE driver would be a lot of work, and hacking around with
ReportEndLoad events might be quicker.


--

Best Regards,

James Crosswell
Software Engineer
Microforge.net Limited
http://www.microforge.net

Comments

  • edited September 2004

    REM Objects and Digital Metaphors are planning to develop a DADE plug-in for
    Data Abstract. However I do not have a time frame for completion - it might
    be a month or two or three down the road. (We have to carve out some time to
    dedicate to the task. )

    There is no automated way to change existing DADE dataviews from one
    database connectivity to another. Below is an article that explains the
    issues related to converting DADE dataviews from one database to another.
    The article discusses BDE to ADO, but the concepts are applicable.

    -------------------------------------------------
    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
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2004
    "Nard Moseley (Digital Metaphors)" a ?crit
  • edited November 2005
    hi

    we have been doing what you want since version 7. we are now using v9. you
    dont have to change anything in the report templates to get them working on
    different dbs, just create db connectison in code and change the designer
    settings etc.

    one difference is that we dont use ado and IBX etc depending on the db
    type - we simply use only dbexpress and connect to any database supported
    by dbexpress (which is heaps considering there are dbexpress ODBC drivers
    available)

This discussion has been closed.