-1

It seems to be a simple question, but is it possible to store the output of a JasperReport directly in a database table, without any other steps in between? As far as I know, Jasper produces an output (e.g. PDF) which I can download and/or show in the browser. To store it into the database I need an extra step to transfer the PDF from the file system to a database table. The reason for that request is, that I must generate and persist a receipt for a transaction.

My programming environment is:

  • Oracle APEX
  • Oracle Database 11.0.2
  • Apache Tomcat

Any ideas? Thanks!

Hleb
  • 7,037
  • 12
  • 58
  • 117
PT_STAR
  • 505
  • 1
  • 4
  • 13
  • Thanks Dave, for your answer. Of course I can store the result PDF in the database with APEX, that is not the question. I want to store it directly from Jasper without any other steps between. – PT_STAR Oct 02 '16 at 07:52
  • 2
    [JasperReports](http://jasperreports.sourceforge.net/api/) is a Java library. [Jaspersoft Studio](http://community.jaspersoft.com/project/jaspersoft-studio) is an IDE for developing report templates that are filled out using said library. Neither the IDE nor JasperReports have built-in functionality for streaming filled reports to a database. Custom software is required. See [here](http://stackoverflow.com/a/8349906/59087) and [here](http://stackoverflow.com/a/8569883/59087). – Dave Jarvis Oct 02 '16 at 08:44

1 Answers1

0

I found a quite good solution. To generate a PDF out of Oracle APEX with JasperReports there is a integration framework called JasperReportsIntegration This framework contains several functions to connect Oracle APEX with Jasper. There is also a function to get the report as a blob. This blob can saved easily in a database table.

begin
  xlib_jasperreports.set_report_url('<url of the Application>');

  xlib_jasperreports.get_report(p_rep_name          => :p_rep_name,
                                p_rep_format        => :p_rep_format,
                                p_data_source       => :p_data_source,
                                p_rep_locale        => :p_rep_locale,
                                p_rep_encoding      => :p_rep_encoding,
                                p_additional_params => :p_additional_params,
                                p_out_blob          => :p_out_blob,
                                p_out_mime_type     => :p_out_mime_type);
end;

This works perfect for me.

PT_STAR
  • 505
  • 1
  • 4
  • 13