Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Passing multiple values to a report parameter from Java
priyanka.k
Hi,
I am trying to send multiple values to a report parameter. The report parameter is of input type String and display type 'list box'. When i preview ,it works fine.But i am not able to pass the values from my java code.Does anyone know how to do this?
Find more posts tagged with
Comments
arunkumarb
Hi,
Let me clarify one doubt.
Are you constructing Report URL in your Java Class?
If so, when you are crating list box parameter there is one check box for allow multiple values so plz click on that and do not use parameter just use filter condition for that report. So that you can pass multiple values. If it is clear ok if not let me know and i will create one report with sample database.
Regards,
Arun
johnw
It needs to be passed in as a comma-seperated string. I don't remember if each value needs quotes or not...
johnw
Sorry, I had that backwards.<br />
<br />
The following will work:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
String designFIle = "C:\\Users\\jwward\\workspace\\Examples\\MultiValue.rptdesign";
EngineConfig config = new EngineConfig();
Platform.startup();
ReportEngine engine = new ReportEngine(config);
IReportRunnable reportDesign = engine.openReportDesign(designFIle);
IRunAndRenderTask runTask = engine.createRunAndRenderTask(reportDesign);
String[] values = {"V1", "V2", "V3"};
runTask.setParameterValue("ListParam", values);
PDFRenderOption renderOption = new PDFRenderOption();
renderOption.setOutputFileName("C:/TEMP/output.pdf");
renderOption.setOutputFormat("PDF");
runTask.setRenderOption(renderOption);
runTask.run();
runTask.close();
engine.destroy();
</pre>
priyanka.k
Thank you all for fast replies..
I used a filter and sent the multiple values as a comma separated string.It worked fine.Thanks.
Sahana
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Hi,</span></p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I need to pass a comma-</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">separated</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> string as a parameter to my query. My quey looks like this</span></p>
<p><strong><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Select c</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">olumn1 </span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">from table1 where table1.ID in (?);</span></strong></p>
<p> </p>
<p><span>I need to replace this '?' with comma separated values (for ex : 2,3,5,4 like this).</span></p>
<p> </p>
<p><span>How can I do this in birt. Please suggest me on this, a sample report would help me.</span></p>
<p> </p>
<p> </p>
<p><span>Thanks,</span></p>
<p><span>Shridevi </span></p>