bipinm25 Posted February 24, 2017 Share Posted February 24, 2017 I have a queryselect * from crm_query where $X{IN,ref_no,ref_no}` in `jasper report The parameter ref_no its class is java.util.Collection.The report work perfectly in jasper soft report. But not working injasper server.This is the url for connecting jasper serverhttp://localhost:8080/jasperserver/rest_v2/reports/reports/projects/test_report.pdf?ref_no=31&ref_no=29&ref_no=33 My issues is that jasper server getting NULL value for the parameter ref_no. Why this happening like this? Any solution?Also i tried to print the parameter in report,but it prints nothing. Link to comment Share on other sites More sharing options...
mlopez_1 Posted February 24, 2017 Share Posted February 24, 2017 You must be sure you have an input control for that parameter, if don't always pass null value even you initialize it inside report unit.Regards, Mariano Link to comment Share on other sites More sharing options...
bipinm25 Posted February 24, 2017 Author Share Posted February 24, 2017 Yes now i am getting the paramter in that report .But another issue is occure I cant use that parameter in print when expression field I use this code <printWhenExpression><![CDATA[$P{ref_no}.contains( $F{query_id} )]]></printWhenExpression> I dont want to use that paramter in any query. I want to check the parameter value in query return result.? How to do that? Link to comment Share on other sites More sharing options...
mlopez_1 Posted February 24, 2017 Share Posted February 24, 2017 Well, I think that's right so, I don't know why does not work.I suggest to put three text fields in detail band and see what shows: - One for $P{ref_no} - Another for $F{query_id} - And the last for $P{ref_no}.contains( $F{query_id} )Perhaps you can see an explanation of what it's happens.Mariano Link to comment Share on other sites More sharing options...
bipinm25 Posted February 25, 2017 Author Share Posted February 25, 2017 This is the out put i got. Link to comment Share on other sites More sharing options...
mlopez_1 Posted February 27, 2017 Share Posted February 27, 2017 Well the only think is the type to compare, the type of $F{query_id} and the type of each element of $P{ref_no} has to be the same, otherwise always return false.For compare two objects, objects must be the same type.Mariano Link to comment Share on other sites More sharing options...
waynerod10 Posted March 10, 2017 Share Posted March 10, 2017 Hi,There might be better ways to do it, but for me, for comparing the value inside the array, I always use:((ArrayList) $P{REPORT_PARAMETERS_MAP}.get( "ref_no")).contains($F{query_id}.toString())[/code]I'll also combine it with a null check...$P{ref_no}.isEmpty()?Boolean.TRUE:(((ArrayList) $P{REPORT_PARAMETERS_MAP}.get( "ref_no")).contains($F{query_id}.toString())) [/code] Note:make sure the brackets are correct as above, else it may throw an errorunder $P{REPORT_PARAMETERS_MAP}.get( "YOU_PARAMETER_NAME_GOES_HERE")) , make sure you just state the parameter name. Do not use $P{ref_no} in there or it will fail Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now