Rest API Blank PDF


I have constructed a simple report within iReport to test the Rest API.


The report generates fine within iReport (All Formats) and from the Jasper Server (All Formats).


However, when i call the report using the Web Services i receive a blank PDF. If i choose any other formats then i obtain the file correctly.

I have now tried to generate a number of reports with the REST Web Service API but I always obtain a blank PDF.


I have noticed that the page size is correct but any text, lines, rectangle boxes are missing.


As I'm currently evaluating this product for a customer, i would very much appreciate some direction on how generate the PDF correctly.


I have attached the file as well as the code that i call from an Oracle database.





    -- 2: Get Resource Descriptor for the Run Report Function
    lcl_resource_descriptor := apex_web_service.make_rest_request(p_url         => 'http://server/jasperserver/rest/resource/Reports/Label_Report',
                                                                  p_http_method => 'GET',
                                                                  p_username    => 'jasperadmin',
                                                                  p_password    => 'jasperadmin');
    -- 3: Create the report (with the resource descriptor                                     
    lcl_report_response := apex_web_service.make_rest_request(p_url         => 'http://server/jasperserver/rest/report/Reports/Label_Report?RUN_OUTPUT_FORMAT=PDF',
                                                              p_http_method => 'PUT',
                                                              p_body        => lcl_resource_descriptor,
                                                              p_username    => 'jasperadmin',
                                                              p_password    => 'jasperadmin');
    -- 4: Obtain the UUID with the use of XPATH
    lv_uuid := xmltype.createxml(lcl_report_response).extract('//report/uuid/text()')
    -- 5: Use the UUID to receive the file
    lcl_file := apex_web_service.make_rest_request(p_url         => 'http://server/jasperserver/rest/report/' ||
                                                   p_http_method => 'GET',
                                                   p_parm_name   => apex_util.string_to_table('file'),
                                                   p_parm_value  => apex_util.string_to_table('report'),
                                                   p_username    => 'jasperadmin',
                                                   p_password    => 'jasperadmin');</td></tr></tbody></table>
kevinmann6285's picture
Joined: Sep 11 2012 - 2:16am
Last seen: 9 years 11 months ago
try to examine logs (/var/lib/tomcat6/webapps/jasperserver/WEB-INF/logs/jasperserver.log) when exporting pdf and not-pdf
jonny64 - 9 years 10 months ago

3 Answers:

Does anyone have any ideas on what i could have done wrong.

We need to determine whether this product is stable enough for an enterprise business, so any help would be certainly appreciated.



kevinmann6285's picture
Joined: Sep 11 2012 - 2:16am
Last seen: 9 years 11 months ago

If you are using a custom font, make sure it is installed to the jasper server. I had a similar problem where all except pdf reports were generating, and this was the cause.

ntatlock's picture
Joined: Jan 13 2014 - 10:38am
Last seen: 4 months 3 weeks ago

Hi all, i have the same problem.
When run the report with Jaspersoft Studio pdf was generated with 17 page with data
When run the same report with the console pdf was generated with 17 page with data
When with REST API run the same report pdf was generate with 17 page blank.




tactic1960's picture
Joined: Jan 27 2014 - 12:52am
Last seen: 1 year 3 months ago