Skip to main content



      Home
Home » Archived » BIRT » Database independent report
Database independent report [message #72438] Wed, 07 September 2005 10:10 Go to next message
Eclipse UserFriend
Hello,
I am evaluating BIRT(or the commercial Actuate) to see whether it can be
used to create reporting for our B2B application. we are planning on
embedding BIRT and the reports created (*.rptdesign) along with the
products. The rptdesign file contains the data source info, report layout
and the actual data retrieval (query) logic. In our case, the data can be
in Oracle or in Sybase or in any other database. We want to ship the
rptdesign along with our base product and expect it to work with any
database. How to achieve this? Is there any mechanism in which we can
dynamically update the data source and any other database specific
information? In other words, how the database independence would be
achieved when we want to have one rptdesign to work with multiple databases?

Thanks

Srinivasan Sairam
Re: Database independent report [message #72627 is a reply to message #72438] Wed, 07 September 2005 20:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Srinivasan,

Firstly if you plan to use one report design against multiple databases. What
about the database field names that will be used in the report layout. Would
they have same name?

If your answer to the above question is yes one way of achieving this would be
by defining the dataset and datasource in the library file.
- The library feature will be available in BIRT 2.0
- Create the dataset and datasource in the library file.
- Let the report designs use the datasets from the library file.
- The library file can be changed to refer to different databases.

--Rima


Sai wrote:

> Hello,
> I am evaluating BIRT(or the commercial Actuate) to see whether it can be
> used to create reporting for our B2B application. we are planning on
> embedding BIRT and the reports created (*.rptdesign) along with the
> products. The rptdesign file contains the data source info, report layout
> and the actual data retrieval (query) logic. In our case, the data can be
> in Oracle or in Sybase or in any other database. We want to ship the
> rptdesign along with our base product and expect it to work with any
> database. How to achieve this? Is there any mechanism in which we can
> dynamically update the data source and any other database specific
> information? In other words, how the database independence would be
> achieved when we want to have one rptdesign to work with multiple databases?
>
> Thanks
>
> Srinivasan Sairam
Re: Database independent report [message #72820 is a reply to message #72627] Thu, 08 September 2005 16:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi Rima,
The database field names and table names that will be used in the report
layout will have same names across all the databases (Oracle, Sybase, MySQL,
PostGress,...).

Since BIRT 2.0 release is going to be by December 2005, is there any code
snippets / sample available that will show how to define and use library
feature (based on the mile stone builds)?

Thanks

Srinivasan

"Rima Kanguri" <rkanguri@actuate.com> wrote in message
news:431F80A1.554FC8EF@actuate.com...
> Hi Srinivasan,
>
> Firstly if you plan to use one report design against multiple databases.
What
> about the database field names that will be used in the report layout.
Would
> they have same name?
>
> If your answer to the above question is yes one way of achieving this
would be
> by defining the dataset and datasource in the library file.
> - The library feature will be available in BIRT 2.0
> - Create the dataset and datasource in the library file.
> - Let the report designs use the datasets from the library file.
> - The library file can be changed to refer to different databases.
>
> --Rima
>
>
> Sai wrote:
>
> > Hello,
> > I am evaluating BIRT(or the commercial Actuate) to see whether it can be
> > used to create reporting for our B2B application. we are planning on
> > embedding BIRT and the reports created (*.rptdesign) along with the
> > products. The rptdesign file contains the data source info, report
layout
> > and the actual data retrieval (query) logic. In our case, the data can
be
> > in Oracle or in Sybase or in any other database. We want to ship the
> > rptdesign along with our base product and expect it to work with any
> > database. How to achieve this? Is there any mechanism in which we can
> > dynamically update the data source and any other database specific
> > information? In other words, how the database independence would be
> > achieved when we want to have one rptdesign to work with multiple
databases?
> >
> > Thanks
> >
> > Srinivasan Sairam
>
Re: Database independent report [message #72873 is a reply to message #72438] Thu, 08 September 2005 19:20 Go to previous message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------030801050502040206030502
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Sai,

I think I have a report that will do what you want. I have attached the
report design to this post. Essentially the report has four parameters
sourceUser
sourcePassword
sourceUrl
sourceDriver

You set the parameters to the values that you want at run time. Then I
have the following code in the beforeOpen method of the DataSource.

extensionProperties.odaUser = params["sourceUser"];
extensionProperties.odaPassword = params["sourcePassword"];
extensionProperties.odaURL = params["sourceUrl"];
extensionProperties.odaDriverClass = params["sourceDriver"];

That's all there is to it. I have validated that this report can run
against a table with the same schema in either Oracle or MySql.

A nice enhancement would be to read the param values out of a config
file, but I have not gotten around to doing that yet. If you do add a
config file, please post the code back so I can take a look.

Hope this helps,

Scott Rosenbaum
BIRT PMC


Sai wrote:

>Hello,
>I am evaluating BIRT(or the commercial Actuate) to see whether it can be
>used to create reporting for our B2B application. we are planning on
>embedding BIRT and the reports created (*.rptdesign) along with the
>products. The rptdesign file contains the data source info, report layout
>and the actual data retrieval (query) logic. In our case, the data can be
>in Oracle or in Sybase or in any other database. We want to ship the
>rptdesign along with our base product and expect it to work with any
>database. How to achieve this? Is there any mechanism in which we can
>dynamically update the data source and any other database specific
>information? In other words, how the database independence would be
>achieved when we want to have one rptdesign to work with multiple databases?
>
>Thanks
>
>Srinivasan Sairam
>
>
>
>

--------------030801050502040206030502
Content-Type: text/xml;
name="script_connection.rptdesign"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="script_connection.rptdesign"

<?xml version="1.0" encoding="UTF-8"?>
<!-- Written by Eclipse BIRT 1.0 -->
<report xmlns=" http://www.eclipse.org/birt/2005/design" version="2">
<property name="createdBy">Eclipse BIRT Designer Version 1.0.1 Build &lt;20050729-0746></property>
<property name="units">in</property>
<method name="initialize"><![CDATA[java.lang.System.out.println("test ");]]></method>
<list-property name="configVars">
<structure>
<property name="name">sourceUrl</property>
<property name="value">jdbc:oracle:thin:@localhost:1521:actdevo</property >
</structure>
<structure>
<property name="name">sourcePassword</property>
<property name="value">tiger</property>
</structure>
<structure>
<property name="name">sourceUser</property>
<property name="value">scott</property>
</structure>
<structure>
<property name="name">sourceDriver</property>
<property name="value">oracle.jdbc.driver.OracleDriver</property>
</structure>
</list-property>
<parameters>
<parameter-group name="db">
<parameters>
<scalar-parameter name="sourceUrl">
<property name="dataType">string</property>
<property name="format">&lt;</property>
<property name="controlType">list-box</property>
<property name="mustMatch">false</property>
<expression name="defaultValue">"jdbc:mysql://localhost/test"</expression>
<list-property name="selectionList">
<structure>
<property name="value">jdbc:mysql://localhost/test</property>
</structure>
<structure>
<property name="value">jdbc:oracle:thin:@localhost:1521:actdevo</property >
</structure>
</list-property>
</scalar-parameter>
<scalar-parameter name="sourcePassword">
<property name="dataType">string</property>
<property name="allowBlank">false</property>
<property name="allowNull">false</property>
<property name="format">Unformatted</property>
<property name="controlType">list-box</property>
<property name="mustMatch">false</property>
<expression name="defaultValue">"root"</expression>
<list-property name="selectionList">
<structure>
<property name="value">root</property>
</structure>
<structure>
<property name="value">tiger</property>
</structure>
</list-property>
</scalar-parameter>
<scalar-parameter name="sourceUser">
<property name="dataType">string</property>
<property name="allowNull">true</property>
<property name="format">Unformatted</property>
<property name="controlType">list-box</property>
<property name="mustMatch">false</property>
<expression name="defaultValue">"root"</expression>
<list-property name="selectionList">
<structure>
<property name="value">root</property>
</structure>
<structure>
<property name="value">scott</property>
</structure>
</list-property>
</scalar-parameter>
<scalar-parameter name="sourceDriver">
<property name="dataType">string</property>
<property name="format">Unformatted</property>
<property name="controlType">list-box</property>
<property name="mustMatch">false</property>
<expression name="defaultValue">"org.gjt.mm.mysql.Driver"</expression >
<list-property name="selectionList">
<structure>
<property name="value">oracle.jdbc.driver.OracleDriver</property>
</structure>
<structure>
<property name="value">org.gjt.mm.mysql.Driver</property>
</structure>
</list-property>
</scalar-parameter>
</parameters>
</parameter-group>
</parameters>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="srcJdbcScript">
<method name="beforeOpen"><![CDATA[extensionProperties.odaUser = params["sourceUser"];
extensionProperties.odaPassword = params["sourcePassword"];
extensionProperties.odaURL = params["sourceUrl"];
extensionProperties.odaDriverClass = params["sourceDriver"];]]></method>
<property name="odaDriverClass">oracle.jdbc.driver.OracleDriver</property >
<property name="odaURL">jdbc:oracle:thin:@localhost:1521:actdevo</property >
<property name="odaUser">scott</property>
<encrypted-property name="odaPassword">dGlnZXI=</encrypted-property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet " name="setSimpleTest">
<property name="dataSource">srcJdbcScript</property>
<property name="queryText">select *
from simple_test
</property>
</oda-data-set>
</data-sets>
<page-setup>
<simple-master-page name="Simple MasterPage">
<page-footer>
<text>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<grid>
<property name="width">100%</property>
<column>
<property name="width">1.041in</property>
</column>
<column>
<property name="width">1.458in</property>
</column>
<column>
<property name="width">1.385in</property>
</column>
<row>
<cell/>
<cell>
<text>
<property name="contentType">plain</property>
<text-property name="content"><![CDATA[Parameter]]></text-property>
</text>
</cell>
<cell>
<text>
<property name="contentType">plain</property>
<text-property name="content"><![CDATA[DataSource]]></text-property>
</text>
</cell>
</row>
<row>
<cell>
<text>
<property name="contentType">plain</property>
<text-property name="content"><![CDATA[SourceDriver]]></text-property>
</text>
</cell>
<cell>
<data>
<expression name="valueExpr">params["sourceDriver"]</expression>
</data>
</cell>
<cell>
<data>
<expression name="valueExpr">report.design.findDataSource("srcJdbcScript ")["odaDriverClass"];</expression>
</data>
</cell>
</row>
<row>
<cell>
<text>
<property name="contentType">plain</property>
<text-property name="content"><![CDATA[SourcePassword]]></text-property>
</text>
</cell>
<cell>
<data>
<expression name="valueExpr">params["sourcePassword"]</expression>
</data>
</cell>
<cell>
<data>
<expression name="valueExpr">report.design.findDataSource("srcJdbcScript ")["odaPassword"];
</expression>
</data>
</cell>
</row>
<row>
<cell>
<text>
<property name="contentType">plain</property>
<text-property name="content"><![CDATA[SourceUrl]]></text-property>
</text>
</cell>
<cell>
<data>
<expression name="valueExpr">params["sourceUrl"]</expression>
</data>
</cell>
<cell>
<data>
<expression name="valueExpr">report.design.findDataSource("srcJdbcScript ")["odaURL"];
</expression>
</data>
</cell>
</row>
<row>
<cell>
<text>
<property name="contentType">plain</property>
<text-property name="content"><![CDATA[SourceUser]]></text-property>
</text>
</cell>
<cell>
<data>
<expression name="valueExpr">params["sourceUser"]</expression>
</data>
</cell>
<cell>
<data>
<expression name="valueExpr">report.design.findDataSource("srcJdbcScript ")["odaUser"];</expression>
</data>
</cell>
</row>
</grid>
<table>
<property name="borderBottomColor">#000000</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftColor">#000000</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thin</property>
<property name="borderRightColor">#000000</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thin</property>
<property name="borderTopColor">#000000</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="width">100%</property>
<property name="dataSet">setSimpleTest</property>
<column/>
<column/>
<column/>
<header>
<row>
<cell>
<label>
<text-property name="text">colString</text-property>
</label>
</cell>
<cell>
<label>
<text-property name="text">colInteger</text-property>
</label>
</cell>
<cell>
<label>
<text-property name="text">colDate</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row>
<cell>
<data>
<expression name="valueExpr">row["colString"]</expression>
</data>
</cell>
<cell>
<data>
<expression name="valueExpr">row["colInteger"]</expression>
</data>
</cell>
<cell>
<data>
<expression name="valueExpr">row["colDate"]</expression>
</data>
</cell>
</row>
</detail>
<footer>
<row>
<cell/>
<cell/>
<cell/>
</row>
</footer>
</table>
</body>
</report>

--------------030801050502040206030502--
Previous Topic:Master page header and footer on PDF, only displayed on first page
Next Topic:Can I bind a report parameter to many data set parameters ?
Goto Forum:
  


Current Time: Fri Jul 18 15:49:45 EDT 2025

Powered by FUDForum. Page generated in 0.07787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top