Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to execute Oracle Stored Procedure in JasperSoft Studio 6.2.1


    akonkin
    • Features: Data Sources, Reports Version: v6.2.1 Product: Jaspersoft® Studio

    iReport is a product that is not updated or released anymore and JasperSoft Studio

    is its current and constant replacement, because of this I would like to share

    with you the information about how to execute Oracle Stored Procedure in JasperSoft Studio.


    Preparation or Oracle part of the test environment:

    Login as SYSTEM user and:

    - unlock HR account (demo database),

    - connect to the HR database and add a test stored procedure

      (copy and paste the text below to the window in the screenshot):

    CREATE OR REPLACE PROCEDURE emplist_proc(emp_cursor OUT sys_refcursor) IS
        BEGIN
            OPEN emp_cursor
            FOR SELECT first_name,last_name,email
            FROM employees
            WHERE rownum < 10;
        END;

     

    Please refer to the screenshot:

    2016-04-07_1233-1.png.76ba7c37861d91697f272dbc40e7efef.png

     

    2016-04-07_1236-2.png.673fcccdb2df609deb9d0153eb6c4cd4.png

     

    - check that the stored procedure works fine:

    2016-04-07_1247-3.png.879c74f1b41cab563b11dea45937c04b.png

     

    2016-04-07_1248-4.png.56cf141fe971d2b6df8c70816939f0c5.png

     

    For the detailed steps concerning the Oracle part please refer to the community article:

    http://community.jaspersoft.com/wiki/how-execute-oracle-stored-procedure-jasper-report-ireport-editor-environment


    JasperSoft Studio:

    • we need to create a Data Adapter

    2016-04-07_1256-5.png.dc9265ecb7888f117f59aea8139407cc.png

    IMPORTANT INFO:

    I was not able to make report work with Tibco driver

    2016-04-07_1443-6.png.a2f529035488eaa26aa4dd49be6c7226.png

     

    This driver returned an error (Studio, the v. 6.2.1) when I tried to read fields.

    2016-04-07_1516-7.png.40ae9cec2c5cce3c6d6832a52207cde6.png

     

    set the Oracle driver to oracle.jdbc.driver.OracleDriver:

    2016-04-07_1519-8.png.f16bb85742967a357589c3034ca2ea0b.png

    • right click on the report name and select Dataset and Query

    • Read fields feature does not return a set of fields,

    please check your Oracle database and add desired fields manually:

    2016-04-07_1529-9.png.51b13c45cac020874c0e78a349ac211d.png

     

    • at this point we can check if our Stored Procedure works

        and can retrieve values from Oracle Database

    2016-04-07_1532-10.png.66c5b0f5945334b0524fff6777cf4ce8.png

     

    • after this we can add our fields to the report

    2016-04-07_1534-11.png.1d9c5b2a442cb2af978e9a2715248e81.png

     

    • and finally run our report

    2016-04-07_1542-12.png.d342d262865f51ab518846ad2eca85d6.png

    Please find in the attachment to the article a jrxml sample of my test report.

     

     

     

     

     

     

     

     

     

     

     

     

     

    oracle_stored_procedure_in_report.jrxml


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...