Nested SQL subselect with Parameter Inside

0

My issue here is I setup this parameter in my sql code but for Jaspersoft does not see it........I say that because it doesn't turn red like it should in the dataset and query dialogue popup window.  Am I doing something wrong here?

and s.productid in (select s_sample.productid from labvantage.s_sample where s_sample.productid = $P{PROD_ID})

Thanks in Advance!

jcking's picture
3
Joined: Apr 18 2017 - 1:36pm
Last seen: 1 year 8 months ago

1 Answer:

0

I use subselects extensively within reports without issue. Assuming your querie(s) are valid, are you using the paremeter PROD_ID within a subdataset? That's the first thing that comes to mind if the editor cannot "see" your parameter where you're referencing it. If so, you need to map that parameter from the main report to the subdataset; in other words you need to pass it to the subdataset to make it available to the subdataset query. This happens in the datasetRun portion of jrxml:

<datasetRun subDataset="NameOfYourDataset" uuid="89bbe77e-8b72-41fc-bdf9-b48e144141b1">
<datasetParameter name="SubDataSetParamerName">
<datasetParameterExpression><![CDATA[$P{MainReportParameterName}]]></datasetParameterExpression>

</datasetParameter> 

darth_fader's picture
Joined: Mar 7 2010 - 9:45pm
Last seen: 1 month 1 day ago
Feedback