danielsl9.dp Posted September 21, 2021 Share Posted September 21, 2021 I don't want to send the report parameters in the browser URL like this:/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FPublished&reportUnit=%2FPublished%2FUser_Report&decorate=no&standAlone=trueI'm very interested to do POST requests and display it in the same jasper server report viewer as always.Is this posible ? Link to comment Share on other sites More sharing options...
Solution jabrown Posted September 21, 2021 Solution Share Posted September 21, 2021 Yes, Jaspersoft Server's REST API allows for report execution with POST using the reportExecutions service.I've attached the following HTTP request sample of this using Postman. The first request is a synchronous request to execute the report. It returns the necessary request and export information. The second request retrieves the report output from the previous execution. You can choose to run an asynchronous request for longer running reports if preferred.POST /jasperserver-pro79/rest_v2/reportExecutions HTTP/1.1Host: localhost:8080Authorization: Basic c3VwZXJ1c2VyOnN1cGVydXNlcg==Content-Type: application/xmlCookie: userLocale=en_US; JSESSIONID=9E0BBE880F49C7987CAE6C4E43252641Content-Length: 509<reportExecutionRequest> <reportUnitUri>/public/Samples/Reports/01._Geographic_Results_by_Segment_Report</reportUnitUri> <async>false</async> <freshData>false</freshData> <saveDataSnapshot>false</saveDataSnapshot> <outputFormat>html</outputFormat> <interactive>true</interactive> <ignorePagination>true</ignorePagination> <parameters> <reportParameter name="Country"> <value>USA</value> </reportParameter> </parameters></reportExecutionRequest>[/code]GET /jasperserver-pro79/rest_v2/reportExecutions/ad0edbf2-abd2-4ebe-8344-b2e453eab496/exports/79662286-aa90-4e98-a732-337ab5ee0504/outputResource HTTP/1.1Host: localhost:8080Authorization: Basic c3VwZXJ1c2VyOnN1cGVydXNlcg==Cookie: userLocale=en_US; JSESSIONID=9E0BBE880F49C7987CAE6C4E43252641[/code] 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