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)
Render Task with different Timezones
PaulCooper
<p>I have had a look at the BIRT Engine API but I can seem to find out if you can render the same rptdocument with different time zones to get the output to display different times for different users. Is this possible?</p>
<p> </p>
<p>Paul Cooper</p>
<p> </p>
Find more posts tagged with
Comments
mwilliams
<p>You might take a look at this old thread:</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/20792-displaying-time-in-correct-time-zone-for-user/'>http://developer.actuate.com/community/forum/index.php?/topic/20792-displaying-time-in-correct-time-zone-for-user/</a></p>
;
PaulCooper
<p>Unfortunately, that post references URL parameters for the viewer and how to handle time zones within the report but not how to use the BIRT engine to render a rptdocument from the Java API with different timezones. We are not using the viewer so the URL method isn't applicable.</p>
mwilliams
<p>Sorry. I referred you to it for what you'd need to do within the report designs to get your times working correctly. Looking into it more, you'd likely still have to change your designs, but you can change the date time values in the entire report by setting the offset in the initialize method with something like:</p>
<p> </p>
<p>reportContext.getTimeZone().rawOffset = offset</p>
<p> </p>
<p>The rawOffset is in ms, so you'll need to remember to adjust your -6, -8, etc. values for that. There are other properties that can be set after the getTimeZone() call, so something else there might help you out.</p>
<p> </p>
<p>The problem with this might be that you're just rendering .rptdocuments. You'll have to try it out and let me know if it works.</p>
PaulCooper
<p>Sorry I haven't got back you before now.</p>
<p> </p>
<p>Are you saying that there is no global offset parameter inbuilt for run & rendering rptdesigns or just rendering rptdocuments? In which case we would have create our own and then use that to update the reportContext.getTimeZone().rawOffset value in the report?</p>
<p> </p>
<p>If there is no such parameter for the offset how does the BIRT Report Web Viewer handle it as it does have a timezone parameter (i.e "__timezone")? Or is that because there a way to specifiy the offset when you run & render rptdesigns but it does not exist for rendering rptdocuments?</p>
<p> </p>
<p>It would be useful if there was some documentation to say what is stored in and what is done to render a report from a rptdocument as it is very unclear how useful the intermediate rptdocument is.</p>
<p> </p>
<p>To just make it clearer I am looking to see if rptdocuments allow us to run the report at point in time X and then render it at point in time Y but change the timezone (and maybe localization) depending on the user without the need to rerun the report (as the data may have altered since point in time X).</p>
<p> </p>
<p>Please note we are using the Birt Report Engine via Java and no viewer is involved. We are saving outputs as bitmaps so I am looking to find a sensible solution to fix the fact that with bitmaps you can not see slight different versions depending on the timezone and language the user uses.</p>
<p> </p>
<p>Regards,</p>
<p> </p>
<p>Paul Cooper</p>
mwilliams
You might try something on the task, like:<br><br>TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");<br>task.setTimeZone(tz);<br><br>I wasn't able to try it myself. I'm having an issue with Eclipse, right now. Let me know.