Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Accessing dataset input paramter inside onrender script of a control
Migrateduser
<p>Hi,</p>
<p>I have a dataset with an input parameter "timezone" along with start time and start date. My use case is when report generates, it uses the provided timezone.</p>
<p> </p>
<p>So,When i am rendering the start time, inside onrender method i tried doing something like below</p>
<p>with no success</p>
<p> </p>
<p>importPackage(Packages.java.text.*);<br>
var dfmt = new java.text.SimpleDateFormat("MM/dd/yyyy");</p>
<p><span style="color:#ff0000;"><strong>var tz=inputParams["timeZone"] ; </strong></span></p>
<p><span style="color:#ff0000;"><strong>var tz1= params["timeZone"] ;</strong></span></p>
<p>
dfmt.setTimeZone(java.util.TimeZone.getTimeZone("America/New_York"));<br>
this.setDisplayValue( dfmt.format(this.getValue()) );</p>
<p> </p>
<p>Is there a diff way to access the dataset parameter?</p>
<p> </p>
<p>Also i am trying to format the date using the timezone hard coded as below, but i running into below error</p>
<p> </p>
<p>Caused by: org.mozilla.javascript.EvaluatorException: The choice of Java constructor format matching JavaScript argument types (null) is ambiguous; candidate constructors are:<br>
class java.lang.String format(java.lang.Object)<br>
class java.lang.String format(java.util.Date)</p>
<p> </p>
<p>Is there a better way to display date based on different timezones?</p>
<p> </p>
<p>Thanks,</p>
<p>Ahmed</p>
<p> </p>
<p>P.S : I cannot update default timezone for the report because it can have multiple timezones for various sections.</p>
<p> </p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
There are no comments yet