Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Data Set
kosta
Hello BIRT community,<br />
<br />
how many data set should be defined for one report? (see next question)<br />
<br />
1. Does it depends from the number of used tables or charts?<br />
2. Should the "data set" filter have to be used rather than the data binding filter or otherwise?<br />
3. Does the "join data set" connects the data sets on SQL (over JDBC) level or tries to binds them in java as lists/maps? <br />
4. How can I create dynamic data set depend on some incoming parameter like:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>SELECT *
FROM CUSTOMERS
WHERE COUNTRY = ? //<- parameter</pre>
<br />
Thanks for the answers and suggestions.
Find more posts tagged with
Comments
thuston
It depends upon your report requirement how many DataSets you want.<br />
<br />
1) There is some optimization to reuse data, however in most cases DataSet will be re-run for every object (Table,Grid,Chart) that is directly bound to it.<br />
<br />
2) The sooner you can filter the better (== less data processed where not needed), but it all depends on report requirement. If you use DataSet in two different Tables, you cannot filter until the Table. If both tables would use the same filter, you can filter at DataSet.<br />
<br />
3) Join DataSet in BIRT happens in Java memory. Joint dataset (to same DB) in Actuate Information Objects is done in SQL when possible.<br />
<br />
4) I don't know much about dynamic DataSet in BIRT. General rule is prepare, bind parameters, execute. I don't know what is automatic in BIRT API and what you must call. <span style='color: #FF0000'>Maybe someone else can post an example.</span>
kosta
Thank you thuston,
yeah, maybe someone else can post an example.
Cheers.
mwilliams
Hi kosta,
You're just wanting an example to show how to use a parameter to make your dataSet dynamic to what the user wants to see?
thuston
I think he wants a dynamic query that uses a parameter. How does he setup the parameter variable and bind it to his query statement in the API or script.
mwilliams
kosta,
Here's a design that shows a couple different ways to ask the user for a value and use it in a "where" statement. One uses the '?' dataSet parameter and is linked to the report parameter that the user enters the value for. The other dataSet has a simple select/from query and the where statement based on the user's input into the report parameter is added in script in the dataSet's beforeOpen method. Let me know if you're looking for something else.
This report was designed in BIRT 2.6.0
kosta
Thank you very much BIRT Guru
,
the trick with the scripting was new for me.
What is the difference between those two different solutions?
The result is the same or are there any special cases where the first way is much better to use than the other? :blink: :wacko:
Cheers.
mwilliams
Both solutions work great if the parameter is a single value and is required. If you don't require that a parameter value be given, you can dynamically add the where clause in script when necessary. The script way is also used if you want to include an "All" parameter on a list box parameter. If they choose all, you wouldn't have a where clause. Also, if you allow multiple select on a list type parameter, the '?' can't handle the array object that is returned by the multi-select parameter, so you'd have to split the array into the appropriate comma separated string to use in an IN clause in your script. Hope this helps.