birt connection profiles-1
TRANSCRIPT
BIRT Connection Profiles 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.
2010
Paul Bappoo [email protected]
http://www.BirtReporting.com
February 2010
BIRT – Connection Profiles
Page | 2
CONTENTS
How To Contact The Author .......................................................................................................................... 4
Connection Profiles ...................................................................................................................................... 5
Setting up a connection profile ................................................................................................................. 6
Using the Data Source ............................................................................................................................. 10
Conclusion .............................................................................................................................................. 15
More Information ....................................................................................................................................... 16
BIRT – Connection Profiles
Page | 3
Paul Bappoo – BIRT Connection Profiles
© COPYRIGHT 2009 by Paul Bappoo, all rights reserved.
This guide is furnished under license and may be used or copied only in accordance with the terms of such license. The content of this guide
is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by the author. The
author assumes no responsibility or liability for any errors or inaccuracies that may appear in this guide.
Except as permitted by such license, no part of this publication may be reproduced, stored in a retrieval system or transmitted, in any form or
by any means, electronic, mechanical, recording or otherwise, without the prior written permission of the author.
All product and company names are trademarks or registered trademarks of their respective holders.
BIRT – Connection Profiles
Page | 4
HOW TO CONTACT THE AUTHOR
Email: [email protected]
Web Site: http://www.BirtReporting.com
Paul Bappoo has been an international technical software consultant and involved with computers for over
30 years and has an interest in BIRT reporting, enterprise application integration, automated software
testing, computer based training and enterprise system implementation. He would be delighted to hear from
you with your tips, tricks and stories about your usage of BIRT. If you have a great tip to share with the
community drop him a line.
BIRT – Connection Profiles
Page | 5
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.
BIRT – Connection Profiles
Page | 6
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.
BIRT – Connection Profiles
Page | 7
You will see that the Data Source Explorer tab and it’s contents appears in the lower pane of the designer
window.
BIRT – Connection Profiles
Page | 8
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...
BIRT – Connection Profiles
Page | 9
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. As a quick reminder, here is the completed screen.
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.
BIRT – Connection Profiles
Page | 10
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.
BIRT – Connection Profiles
Page | 11
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\
BIRT – Connection Profiles
Page | 12
Once I have browsed to here I select the ServerProfiles.dat file
BIRT – Connection Profiles
Page | 13
BIRT opens up the data profiles store and shows me all the profiles I have previously created.
BIRT – Connection Profiles
Page | 14
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!
BIRT – Connection Profiles
Page | 15
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.
BIRT – Connection Profiles
Page | 16
MORE INFORMATION
If you would like to 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
http://www.BIRTReporting.com