yinjianfeng
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forum
Events
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Downloads
Posts posted by yinjianfeng
-
-
Hi there,
I wanna get JasperPrint object from jasperreport server via RESTful webservice,
following jasperreports-server-web-service-guide.pdf
Method URL GET http://:/jasperserver[-pro]/rest_v2/reports/path/to/report.?where is one of the following: html, pdf, xls, rtf, csv, xml, jrprintThen view this report in jasperreports flash viewer.
I spent a lot of time on Google, Some people also encounter same problem with me, but no body can find solution.
I am using Jasperreport Server 5.0.0 COMMUNITY EDITION.
here is my codes,
Client client = Client.create();client.addFilter(new HTTPBasicAuthFilter("jasperadmin","jasperadmin"));String url = "http://localhost:8899/jasperserver/rest_v2/reports/reports/samples/AllAccounts.jrprint";// For the url, if I use other format it works. but only 'jrprint' doesn't work.WebResource r = client.resource(url);JasperPrint jasperPrint = (JasperPrint)r.get(InputStream.class);when I use 'jrprint' format, throw errors as below:
com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:8899/jasperserver/rest_v2/reports/reports/samples/AllAccounts.jrprint returned a response status of 404 Not Foundat com.sun.jersey.api.client.WebResource.handle(WebResource.java:686)at com.sun.jersey.api.client.WebResource.get(WebResource.java:191)at org.jfeng.com.report.ReportJerseyClient.runReportAsJRPrint(ReportJerseyClient.java:65)at org.jfeng.com.action.DefaultAction.showReportContent(DefaultAction.java:1295)
Restful webservice get jrprint encounter 404 error
in Products
Posted
in that post, he did 2 things.
First, use "put" method generate a report then use "get" method download report as JasperReport Object.
Can I only use get method both can generate report and export it.
for PDF format seems can only use get method obtain the data.
PS. is rest_v2 only for jasperreport-server 5.0.0 ? if it's ture. maybe rest_v2 Running a report for jasperprint format got a issue.