Jump to content
Changes to the Jaspersoft community edition download ×

Rest API Blank PDF


kevinmann6285

Recommended Posts

 Hi,

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.

 

Regards

 

Kevin

Code:
    -- 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()')               .getclobval();      -- 5: Use the UUID to receive the file    lcl_file := apex_web_service.make_rest_request(p_url         => 'http://server/jasperserver/rest/report/' ||                                                                    lv_uuid,                                                   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');
Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 weeks later...
  • 1 year later...
  • 4 years later...

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.

Regards

Massimo

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...