Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Choose database and populate combo box
Choose database and populate combo box [message #1030221] Sat, 30 March 2013 21:54 Go to next message
José Litux is currently offline José LituxFriend
Messages: 52
Registered: March 2013
Member
hi

I'm new to Birt and i'm impressed for such a piece of software. It's awesome!

In a pair of weeks I'm fairly good at using datasets and parameters but today i'm stuck on finding a way to allow the user to choose a Database and after this, populate the content of a combobox from a query that involves a table, and depending on that selection, load a bunch of datasets for a very complex report.

My server offers 3 databases depending on the zone you want to report: America, Europe, Asia.
The user selects continent, and then a combo-box offers countries from that continent. So far, so good.
The problem is that when the country is selected, 27 different Datasets use the country parameter to populate the report queryng to the right continent Database.

Seems to be a simple cascading parameters report but i'm stuck. I've tried the approach from this thread succeeding on continent selection:

http://www.eclipse.org/forums/index.php/m/891673/

but notice that I have to generate the same 27 Datasets for every continent because Dataset depends on Datasource. 27 x 3 equals 81 datasets to be made !!!!

What I need is a way to change the Database the connection reads upon continent user selection. Nothing more (well, and force refreshing the countries combo) because the 27 querys are the same no matter country or continent.

Any hint o small tutorial would be very much appreciated (coding is not my cup of tea, so I will appreciate an easy "wizardly" approach)

Thanks in advance

[Updated on: Sun, 31 March 2013 08:58]

Report message to a moderator

Re: Choose database and populate combo box [message #1032052 is a reply to message #1030221] Tue, 02 April 2013 14:06 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

So, you have three different databases? So, you'd need to change the dataSource for the different zones? Have you looked into using the property binding tab in the dataSource editor to change the database URL, using your zone parameter value? If everything with the databases is the same, after that, that would be the only change you should need to only use 27 dataSets, rather than 81. Let me know if I missed something.

Michael

Developer Evangelist, Silanis
Re: Choose database and populate combo box [message #1032968 is a reply to message #1032052] Wed, 03 April 2013 17:42 Go to previous messageGo to next message
José Litux is currently offline José LituxFriend
Messages: 52
Registered: March 2013
Member
Thanks Michael

Tried that, the problem is when selected the main zone, combo with countries not updating
Re: Choose database and populate combo box [message #1033539 is a reply to message #1030221] Thu, 04 April 2013 10:48 Go to previous message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Quote:
the problem is when selected the main zone, combo with countries not updating


It is probably because you use a separate report parameter to select the database, and this parameter is not in the "countries" cascading group.

Combobox datasets work in a different manner than other report datasets. A report parameter used in a property binding to select a database will be ignored by combobox datasets: the default database will always be taken, unless this parameter is additionally the first level of a cascading combobox group.

So the only way to introduce a dependency between 2 parameters is the "cascading" feature, even for a database connection: If the "continent" parameter is the parent of "countries" in a cascading group, and is also used in the datasource property bindings to build a connection URI, then your countries combobox should be correctly updated.


Previous Topic:parameter passed to subreport in arabic letters
Next Topic:Fix color for series in bar chart
Goto Forum:
  


Current Time: Mon Oct 14 16:45:56 GMT 2024

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

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

Back to the top