Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic change of crosstab group level
mgrohmann
Hey there,
after 3 months without BIRT-questions, it's time for another discussion on BIRT features:
I want to change the group level inside my crosstab dynamically depending on a parameter.
My idea is to put all group levels in a crosstab and build an expression like:
if (param == "week"){
dimension["date"]["week-of-year"]["DateTime"]
}
else if (param == "day"){
dimension["date"]["day-of-year"]["DateTime"]
}
...
Does anybody has a better idea for realising this requirement?
Thanks:)
Find more posts tagged with
Comments
mwilliams
Hi mgrohmann,<br />
<br />
Here's a link to a devShare post that goes over creating a dynamic crosstab in script. It may help you do what you're wanting to do.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/1181-dynamic-xtab-creation-using-script/#description'>Dynamic
Xtab Creation Using Script - Designs & Code - BIRT Exchange</a>
mgrohmann
thanks once again:)
will dive into it later:)
ncervaen
Hi Michael,
I want to do the same as mgrohmann, but unfortunately I'm limited to BIRT version 2.2.1, as Im doing reports to be used by TCR (Tivoli Common Reporting) that only support this BIRT version
Is there any way that I can with a parameter, change the Y dimension from week-of-year to day-of-year, etc?
Thanks,
Nuno
mwilliams
I'm pretty sure I've changed the grouping in script since the previous answer in this thread was given. I'll have to jump in and take a look at how that was or see if I can find the report design. Another option, since you're doing it by parameter, would be to simply create both crosstabs with the different date groupings and then drop the unneeded one in the beforeFactory script based on the report parameter.
ncervaen
Hi michael,
Many thanks for the repla, so if you could please let me know about your findings it would be great, and btw regarding your second option, what syntax would you use to kill a crosstab?
Cheers,
Nuno
mwilliams
You would have to name the crosstab in the general tab of the property editor for the crosstab. Then, you'd put something like the following in the beforeFactory script. This assumes you have two tables named Customer and Employee.
CustomerTable = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Customer");
EmployeeTable = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Employee");
if (params["Table"].value == "Customer Table"){
EmployeeTable.drop();
}
else{
CustomerTable.drop();
}
ncervaen
Thanks Michael,
Is there any URL where I can get all the classes and functions for the BIRT objects, so I can avoid bother you guys with questions?
cheers,
Nuno
mwilliams
Here is a link to the current docs page:
http://www.birt-exchange.com/be/downloads/documentation/#currentdocs
ncervaen
Thanks,
Nuno
mwilliams
No problem. Let us know whenever you have questions!