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)
Cannot find function setInputParameterValue
elvis_tu
Hi,
Im trying dynamic parameter, I wrote script in beforeOpen:
importPackage(Packages.java.lang);
var customerno = new Integer(104);
this.setInputParameterValue("customer_no", customerno);
Here is my sql & parameter:
[sql] select * from orders where customernumber = ?
[parameter] name: customer_no, type: Integer, direction: Input
When I previewed the report, it showed:
TypeError: Cannot find function getInputParameters
How could I pass parameter value in the script?
createdBy: Eclipse BIRT Designer Version 2.3.2.r232_20090202 Build <2.3.2.v20090304-1357
Thanks,
Find more posts tagged with
Comments
bhanley
The user supplies the parameter, you do not need to set the value in the scripting layer. Did you bind your report parameter (<em class='bbc'>customer_no</em>) to your data set? You do that in the <strong class='bbc'>Parameters</strong> section of the data set editor.<br />
<br />
I would also recommend assigning a default value to your parameter, at least during the design phase, as it makes testing out your work a lot easier.
elvis_tu
Hi, Brian,
I knew I could bind data set parameters with report parameters,
If the data parameter could not be binding with a report parameter directly (i.e. parameter value is the result of some calculation in beforeFactory), may I call setInputParameterValue to set value of the parameter in scripting layer?
JasonW
You should be able to do this in the beforeOpen of the dataset like:
inputParams["mydatasetparm"] = "test value"
Jason