Home
Designing Analytics Reports
Default Parameter using Javascript created using expression builder
Migrateduser
<p>Hello Everyone,</p>
<p> </p>
<p>Newbie here trying to create an Eclipse report that prompts for values from user at run time, there are two *required* parameters and one *optional* parameter. For the required parameters I have tried to set a default value at run time, my problem is that I am not able to get the values to show in the parameter field when I try to preview the report.</p>
<p> </p>
<p>The parameter I have is *BirtDateTime.year(BirtDateTime.Now()) + BirtDateTime.month(BirtDateTime.Now())*</p>
<p>This is creating a value that is a combination of year and month (Financial Period) YYMM so the user can run the report for the current period or adjust them accordingly.</p>
<p> </p>
<p>As far as I am aware (assumption) the expression is valid as there is no error when I use the validation option in the expression builder.</p>
<p> </p>
<p>The two parameters I have created are called FinStart and FinEnd both use their own version of the expression pasted above as the default value. Due to this missing information the values are not being populated at run time causing the report to fail.</p>
<p> </p>
<p>var where = params["where"];<br>
if (params["FinStart"].value)<br>
where = " R.FINANCIALPERIOD BETWEEN " + params["FinStart"].value;<br>
if (params["FinEnd"].value)<br>
where = where + " AND " + params["FinEnd"].value;<br>
if (params["vendor"].value)<br>
where = where + where + " AND " + params["vendor"].value;</p>
<p> </p>
<p>This is the (clumsy) attempt at getting values into the parameters then into the query.</p>
<p> </p>
<p>Thanks.</p>
Find more posts tagged with
Comments
There are no comments yet