jigar.patel Posted October 15, 2015 Share Posted October 15, 2015 Hi, I want to pass array kind of structure (from report query) to my PostgreSQL function which accepts text[] as input. I tried String[] and ArrayList, but it gives compile time error saying "Parameter type not supported in query". Then I tried passing it as a string ($P!{array_parameter}) but it gives error while deploying report to jasperserver saying: "The selected JRXML could not be parsed. You might have selected the wrong file." Any Suggestions...! Link to comment Share on other sites More sharing options...
ernst_2 Posted October 15, 2015 Share Posted October 15, 2015 You need to use the provided $X{} functions for such inputs.Like: $X{IN, <column_name>, <parameter_name>}Description: http://jasperreports.sourceforge.net/sample.reference/query/ Link to comment Share on other sites More sharing options...
jigar.patel Posted October 16, 2015 Author Share Posted October 16, 2015 Thanks to ernst_2 for answering. But, That's not what I want. I want to pass my array to SQL function as an arguement, from report query. As for example,SELECT * FROM my_function($P{my_array_parameter})which will pass entire array in my PostgreSQL function and I will receive it in my function as I have set datatype text[] as arguement datatype in PostgreSQL function. Any Ideas... Link to comment Share on other sites More sharing options...
zh3ntil Posted October 16, 2015 Share Posted October 16, 2015 Hi,As far as I know, there is no way to do that on studio . But, you can make it work by creating a StoredProcedure that parse your parameter string, convert to an array and pass to your function. Link to comment Share on other sites More sharing options...
kkumlien Posted October 19, 2015 Share Posted October 19, 2015 Hi Jigar,the $P! syntax should work. Can you compile and display a report in iReport or Jaspersoft Studio?Once that works, then if you don't manage to publish it to JasperReports Server please create a new question about that and let us know here. Thanks! 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