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)
How to change styling via report parameter ?
zlyLew
Hi.
I've made a report that displays data/time when somebody completed his tasks. I did all the coding, I have added all the report parameter. But unfortunatly my boss came and tell me that he wants to have choose to display date with or without time zone.
I would like to add an extra checkbox to my report parametrs. Depends if check box is checked or not, I would like to display date with or withouth timezone. I thouth to add scripts for style, however there are no scripts for styles.
Any ideas how to solve the problem?
Find more posts tagged with
Comments
mwilliams
In your onCreate script of your date data element, you can set the format of the date with:
this.getStyle().dateFormat = "stringFormatCode"
You can write a simple if/else statement to change it based on your parameter.
zlyLew
Hi I have done as you told me but unfortunatly it doesnt work. It seams that the platform that we are using ignores onCreate event. I'm wondering is it problem with platform or is it just problem with BIRT. Actualy we are working on special implementaion of BIRT used in PLATEAU system. <br />
<br />
I have build simple reportm, I put:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if(params["FullDate"].value == true)
{
this.getStyle().dateFormat = "YYYY-MM-DD hh:mm:ss z"
}
else
{
this.getStyle().dateFormat = "YYYY-MM-DD hh:mm:ss"
}
</pre>
<br />
insiede onCreate script on the item that i want to stylize<br />
<br />
But it just don't work
mwilliams
What happens? Nothing? You could also put it in the onRender method.