Jump to content
We've recently updated our Privacy Statement, available here ×

f.bonavia

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by f.bonavia

  1. Hi to all, I have created a report using TIBCO Jaspersoft Studio named report_con_query_interna.jrxml Then I've deployed it on Jasper Server running on my PC and path and ID resource are: Path: /reports/ReportConQuerySuDatabase ID resource: ReportConQuerySuDatabase Now I have created a client JAVA that executes the report. The Java code is: public String executeReport() { String REPORT_RAW = "{"reportUnitUri":"/reports/ReportConQuerySuDatabase", "async":"true", "freshData":"true", "saveDataSnapshot":"true", "outputFormat": "pdf", "interactive":"true", "ignorePagination":"false"}"; System.out.println("executing a report"); //building the request parameters List<NameValuePair> ce_qparams = new ArrayList<NameValuePair>(); ce_qparams.add(new BasicNameValuePair("j_username", "jasperadmin")); ce_qparams.add(new BasicNameValuePair("j_password", "jasperadmin")); try { HttpPost httpReqPost = new HttpPost(); // set header httpReqPost.setHeader("Accept", "application/json"); httpReqPost.setHeader("Content-type", "application/json"); HttpEntity entity = new ByteArrayEntity(REPORT_RAW.getBytes("UTF-8")); String result = getStringFromInputStream(entity.getContent()); System.out.println("payload: " + result); httpReqPost.setEntity(entity); //System.out.println("RESOURCE_REPORT_EXECUTIONS: " + RESOURCE_REPORT_EXECUTIONS); httpRes = sendRequest(httpReqPost, RESOURCE_REPORT_EXECUTIONS, ce_qparams, true); System.out.println("http response: " + httpRes.toString()); result = getStringFromInputStream(httpRes.getEntity().getContent()); System.out.println("descriptor: " + result); return result; } catch (Exception e) { e.printStackTrace(); return null; } } System.out.println are: payload: {"reportUnitUri":"/reports/ReportConQuerySuDatabase", "async":"true", "freshData":"true", "saveDataSnapshot":"true", "outputFormat": "pdf", "interactive":"true", "ignorePagination":"false"} http response: HTTP/1.1 200 OK [server: Apache-Coyote/1.1, P3P: CP="ALL", Set-Cookie: userLocale=en_US;Expires=Wed, 3-Feb-2016 16:19:31 GMT;HttpOnly, Content-Type: application/json, Transfer-Encoding: chunked, Date: Tue, 02 Feb 2016 16:19:31 GMT] descriptor: {"status":"queued","requestId":"960ba085-ce1e-44ff-a972-bb4489f38710","reportURI":"/reports/ReportConQuerySuDatabase","exports":[{"id":"f5d091d8-be7d-476a-a00b-f5f41cae2dcb","status":"queued"}]} Where is saved the file pdf produced by the execution of this report ? Thanks, Francesco
  2. Hi to all, I have created a report using TIBCO Jaspersoft Studio. Then I've deployed it on Jasper Server running on my PC. Now I have created a client JAVA that executes the report and save it in the defualt directory "C:Usersf.bonaviaDownloadsarc-response-2016 Feb 1 14-18-01.pdf" The question is: Can i modify the default directory and the default filename of the report output ? I have to do it in the client java or I can do it in Jasper Server ? Thanks a lot Francesco
×
×
  • Create New...