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)
HELP in designing a report
royaditya
<p>Hi All,</p>
<p> I am new to BIRT world and need a design help from experts. I have three tables without common columns such as TABLE AB, TABLE BC, TABLE CD and have the following report parameters.</p>
<p> </p>
<p>param_DATE:- each table has Date column.</p>
<p>param_TYPE- SALES,MARKETING, FINANCE </p>
<p>param_REGION- AB,BC,CD</p>
<p> </p>
<p>So,whenver we select AB in Region and SALES/MKT/FIN with a DATE, data is pulled from AB tables.</p>
<p> When we select BC in Region and SALES/MKT/FIN with DATE , data is pulled from BC tables.</p>
<p> When select CD in Region and SALES/MKT/FIN with DATE , data is pulled from CD tables.</p>
<p> </p>
<p>How we ca achieve this in one report.</p>
<p> </p>
<p>Thanks,</p>
<p> </p>
<p>Andy.</p>
Find more posts tagged with
Comments
micajblock
<p>In the beforeOpen event of the data set you can put script like this. This assumes only one table and your original query uses AB tables. I am sure you can change it to your needs.</p>
<div>
<pre class="_prettyXprint">
if (params["param_REGION"].value=="BC") {
this.queryText=this.queryText.replace("from AB","from AB");
}
else if (params["param_REGION"].value=="CD") {
this.queryText=this.queryText.replace("from AB","from CD");
}</pre>
</div>
royaditya
<p>Thanks Mica. Script looks fine, but these three tables have different column names. Should I go for cross tab or list report. I mean, how column names changes based on you pick AB or BC.</p>
micajblock
<p>You have 2 choices:</p>
<ol><li>Use similar script to above to change column names as well. This will work if the number of columns are the same.</li>
<li>Probably better is to have 3 data sets and 3 tables. One table for each query/table. The in the beforeFactory event of the root of the report drop the tables you do not need. They data sets will not be executed if the are not used. Example of dropping a table can be found here - <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/1069-simple-example-of-dropping-a-tablechart/'>http://developer.actuate.com/community/forum/index.php?/files/file/1069-simple-example-of-dropping-a-tablechart/</a></li>
;
</ol>