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)
Parameter Passing Dynamically
RiaR
Hi
Im using the following Script in my report to get the parameter dynamically. When I give numbers the report is generated correctly using the script but for Strings the script is not working. can u help me out and can u tel me where to read these functions..
importPackage(Packages.org.eclipse.birt.report.model.api.elements);
importPackage(Packages.org.eclipse.birt.report.model.api.simpleapi);
importPackage(Packages.java.util);
myList = new ArrayList();
myList.add(params["State"].value);
fc = SimpleElementFactory.getInstance().createFilterCondition();
fc.setExpr("row[\"State\"]");
fc.setOperator(DesignChoiceConstants.FILTER_OPERATOR_IN);
fc.setValue1(myList);
this.addFilterCondition(fc)
Thanks In Advance
Find more posts tagged with
Comments
mwilliams
What does your parameter value look like when it's a string? Is your parameter a multi-select parameter?
mwilliams
What does your parameter value look like when it's a string? Is your parameter a multi-select parameter?
kabilan_n
Hi William,
Its not a multi-select parameter. Its a single string parameter. for eg. State value - 'California'.
Regards,
Kabil
kabilan_n
This same script is working for integer value but not for String.
-- kabil
mwilliams
Where are you putting this script? Do you get any errors with the string values?
kabilan_n
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="91483" data-time="1323723970" data-date="12 December 2011 - 02:06 PM"><p>
Where are you putting this script? Do you get any errors with the string values?<br /></p></blockquote>
Hi, <br />
<br />
Here i have attached a sample report. In which i am passing productcode as parameter in table-onprepare script. I am getting non fatal error.
mwilliams
Need to add a single tic to the parameter value when you add it to the list, if it's a string, then it works.
myList.add("'" + params["State"].value + "'");
kabilan_n
Thanks Guru !!
--kabil
mwilliams
No problem. Let us know whenever you have questions!