BIRT CONNECTION PROFILES

154 views
Skip to first unread message

Paul Bappoo

unread,
Feb 10, 2010, 11:38:56 PM2/10/10
to IBM Maximo, MXES
Synopsis: Fed up creating new data sources each time you create a new
BIRT report, or simply too lazy to remember the connection strings
every time? This guide shows you how to set up any number of pre-
defined connection strings that you can call upon at any time in BIRT
Designer.

BIRT CONNECTION PROFILES

OK hands up if you have a rubbish memory like me! OK there are a
number of things I can remember, like my wifes birthday, our wedding
anniversary and other such things that are essential to survival but
there are certain things that I simply can’t (or maybe don’t want to)
keep in my head.

One example of this is the JDBC connection string for SQL Server
databases that I use within my BIRT data sources. You know the thing
that looks like this:

jdbc:jtds:sqlserver://server[:port][/database];

I can remember the server name (usually) and for some strange reason
(although I hate to admit it) I can remember that SQL Server lives on
port 1433 and I can also sometimes remember the name of the database
that I want to connect to. What I seem dismally unable to remember is
the structure of the connection string itself.

Ultimately this means that every time I create a new BIRT report I
have to create a new data source and lookup the connection string from
one of my own texts on the subject. This makes me feel rather silly
and so I eventually resorted to keeping a text file on the desktop of
my BIRT machine, containing just the connection string! This way I can
easily access the connection string and copy it into my report.

Well, I have found a better way! It’s called Connection Profiles and
it allows you to store away connections to all your databases,
including the login credentials, in a central location that can be
accessed directly from within the BIRT designer whenever you need
them.

SETTING UP A CONNECTION PROFILE

In the BIRT designer, open the Window menu, select Show View and
Other. Then from the dialogue that appears, expand the Data Management
section and highlight the Data Source Explorer item, then press OK.

You will see that the Data Source Explorer tab and it’s contents
appears in the lower pane of the designer window.

To create a data source, select the appropriate data source type, in
this example I am going to create a SQL Server source, so I highlight
JDBC Data Source, right click and select New...

I name the data source and give it a description, then click next. Now
we are in familiar territory, looking at the standard data source
creation screen. If you are not familiar with this please refer to my
guide “The complete getting started guide to BIRT Reporting” where you
will find a full description of how to create a data source.

The test connection button tells me that I have entered the correct
information. On clicking finish I see that my SQL Server connection is
saved to the Data Source Explorer.

USING THE DATA SOURCE

Now when I want to create a data source it is simplicity itself, with
no remembering to do!
All I have to do is right click on the Data Sources item in the Data
Explorer pane and select New Data Source

And in the next screen select the radio button called “Create from a
connection profile in the profile store” and click next.

Now I just browse to my profile store, which by default is saved in a
sub folder of the BIRT workspace. When I installed BIRT I made my
workspace C:\BIRT, so the full path to my profile is:

C:\BIRT\.metadata\.plugins\org.eclipse.datatools\connectivty\

Once I have browsed to here I select the ServerProfiles.dat file

BIRT opens up the data profiles store and shows me all the profiles I
have previously created.

So now all I have to do is select the one I want to use, in my example
“My local SQL server” and on clicking next I see the data source
screen pre-filled with my data connection details!

Click finish and that’s it, a few easy steps to adding my saved data
source to my new BIRT report.

CONCLUSION

If you have a number of different databases that you report on
regularly then creating connection profiles makes the task of setting
up data sources that much easier. Give it a try and let me know how
you get on and what you think of this tip.

MORE INFORMATION

If you would like to download the full version of this report with
screen shots in PDF format or find out more about BIRT reporting and
the BIRT User Group UK then please visit

http://www.BIRTReporting.com

Please feel free to share this address with your colleagues and
inspire them to use BIRT to create great looking reports.

I look forward to your feedback so please feel free to send me an
email and let me know how you get on with BIRT, provide feedback on
this guide, share your tips and tricks, or request help for specific
problems. I can’t guarantee to personally solve everyone’s problems
but there are some great BIRT related forums out there and you can
find a growing list of links and resources on my site.

Paul Bappoo

Pa...@BirtReporting.com
http://www.BIRTReporting.com

Reply all
Reply to author
Forward
0 new messages