mick1027 Posted January 31, 2012 Share Posted January 31, 2012 Hi, The documentation ( pg 30 of JASPERREPORTS SERVERWEB SERVICES GUIDE 4.2 )The body of the PUT request should contain a resource descriptor of type reportUnit with the URI of the report unit to run.The resource descriptor can contain one or more parameter tags to specify parameters. Lists can be passed using parameterswith the same name and the isListValue attribute set to true.The arguments can be placed in the URL of the request or by encoding them in the multipart request. However, someapplication servers such as Apache Tomcat do not process arguments that are www-url-encoded in the request when sent to aPUT method, so be sure you are using a multipart request or you are using the GET style parameters when using this method.I read this and was not clear on what XML elements to use for passing parameters..Does anyone have an example of passing report parameters utilizing a RESTful service? I would like to set this up in the body of the PUT that woudl generate the report. How would I setup up the XML in the below example?<?xml version="1.0" encoding="UTF-8"?><resourceDescriptor isNew="false" name="test_report" uriString="/organizations/organization_1/Reports1/test_report" wsType="reportUnit"> <label><![CDATA[test_report]]></label> <creationDate>1317157868000</creationDate> <resourceProperty name="PROP_RESOURCE_TYPE"> <value><![CDATA[com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit]]></value> </resourceProperty> <resourceProperty name="PROP_PARENT_FOLDER"> <value><![CDATA[/organizations/organization_1/Reports1]]></value> </resourceProperty> <resourceProperty name="PROP_VERSION"> <value><![CDATA[3]]></value> </resourceProperty> <resourceProperty name="PROP_RU_ALWAYS_PROPMT_CONTROLS"> <value><![CDATA[true]]></value> </resourceProperty> <resourceProperty name="PROP_RU_CONTROLS_LAYOUT"> <value><![CDATA[1]]></value> </resourceProperty> <resourceProperty name="PROP_RU_INPUTCONTROL_RENDERING_VIEW"> <value/> </resourceProperty></resourceDescriptor> Thanks!Post Edited by mick1027 at 01/31/2012 13:34 Link to comment Share on other sites More sharing options...
mick1027 Posted February 3, 2012 Author Share Posted February 3, 2012 found the answer to my question.. Something like this works: <?xml version="1.0" encoding="UTF-8"?><resourceDescriptor isNew="false" name="Report1" uriString="/organizations/organization_1/Reports1/Report1" wsType="reportUnit"> <label><![CDATA[report_1]]></label> <creationDate>1317135409000</creationDate> <parameter name ="exampleParm1" >10</parameter> <parameter name ="exampleParm2" >011010</parameter> <resourceProperty name="PROP_RESOURCE_TYPE"> <value><![CDATA[com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit]]></value> </resourceProperty> <resourceProperty name="PROP_PARENT_FOLDER"> <value><![CDATA[/organizations/organization_1/Reports1]]></value> </resourceProperty> <resourceProperty name="PROP_VERSION"> <value><![CDATA[5]]></value> </resourceProperty> <resourceProperty name="PROP_RU_ALWAYS_PROPMT_CONTROLS"> <value><![CDATA[true]]></value> </resourceProperty> <resourceProperty name="PROP_RU_CONTROLS_LAYOUT"> <value><![CDATA[1]]></value> </resourceProperty> <resourceProperty name="PROP_RU_INPUTCONTROL_RENDERING_VIEW"> <value/> </resourceProperty></resourceDescriptor> Link to comment Share on other sites More sharing options...
saypratap Posted May 11, 2012 Share Posted May 11, 2012 HII am also using the Jrxml queryString and RestTemplate PUT methd call.In My Jrxml file I have witten a simple query using where clause as below.Select * from Employer where emp_id=$P{id}.And I am passing the parameter using <parameter> tag as below:<?xml version="1.0" encoding="UTF-8"?><resourceDescriptor name="testList" wsType="reportUnit" uriString="/Reports/testList" isNew="false"> <label><![CDATA[testList]]></label> <creationDate>1336714867000</creationDate><parameter name ="id" >10</parameter> <resourceProperty name="PROP_RESOURCE_TYPE"> <value><![CDATA[com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportUnit]]></value> </resourceProperty> <resourceProperty name="PROP_PARENT_FOLDER"> <value><![CDATA[/Reports]]></value> </resourceProperty> <resourceProperty name="PROP_VERSION"> <value><![CDATA[0]]></value> </resourceProperty> <resourceProperty name="PROP_RU_ALWAYS_PROPMT_CONTROLS"> <value><![CDATA[false]]></value> </resourceProperty> <resourceProperty name="PROP_RU_CONTROLS_LAYOUT"> <value><![CDATA[1]]></value> </resourceProperty> <resourceDescriptor name="testList_" wsType="jrxml" uriString="/Reports/testList_files/testList_" isNew="false"> <label><![CDATA[testList]]></label> <creationDate>1336714867000</creationDate> <resourceProperty name="PROP_RESOURCE_TYPE"> <value><![CDATA[com.jaspersoft.jasperserver.api.metadata.common.domain.FileResource]]></value> </resourceProperty> <resourceProperty name="PROP_PARENT_FOLDER"> <value><![CDATA[/Reports/testList_files]]></value> </resourceProperty> <resourceProperty name="PROP_VERSION"> <value><![CDATA[0]]></value> </resourceProperty> <resourceProperty name="PROP_IS_REFERENCE"> <value><![CDATA[false]]></value> </resourceProperty> <resourceProperty name="PROP_HAS_DATA"> <value><![CDATA[true]]></value> </resourceProperty> <resourceProperty name="PROP_ATTACHMENT_ID"> <value><![CDATA[attachment]]></value> </resourceProperty> <resourceProperty name="PROP_RU_IS_MAIN_REPORT"> <value><![CDATA[true]]></value> </resourceProperty> </resourceDescriptor></resourceDescriptor> When I call a put method I am getting error likeReport design not valid : 1. Query parameter not found : idI am using Jasper server 4.5 and IDE is Spring STS (Eclipse).Can anyone please help me on this.I have also attached my jrxml file. Your early response is highly appreciable. ThanksPratap Panda Post Edited by saypratap at 05/11/2012 13:09 Link to comment Share on other sites More sharing options...
swatisinghal Posted June 20, 2012 Share Posted June 20, 2012 Can you let me know how you're reading the parameters from the resource descriptor?I make a GET call to get the list of resources/reports at a path. The list is returned as resource descriptor but I do not see the parameters in the resource descriptor.In my Java code, when I do a getParameters() against the resource descriptor object it gives me null even when I know a report does have a parameter.Any clue? Link to comment Share on other sites More sharing options...
swatisinghal Posted June 27, 2012 Share Posted June 27, 2012 I'm not sure if the following post will help you.http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=98962 Link to comment Share on other sites More sharing options...
ganesh.simhadri Posted July 3, 2013 Share Posted July 3, 2013 Please let me know if you got solution to your above problem or mail the solution to chandraganeshchowdary@gmail.com 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