Topic
9 replies Latest Post - ‏2013-02-16T17:01:17Z by SystemAdmin
SystemAdmin
SystemAdmin
6195 Posts
ACCEPTED ANSWER

Pinned topic Jasper Run Problems

‏2013-01-16T21:39:59Z |
Creating reports using Jasper appears to be much more straight forward than using BIRT. That said, I am running into execution time error as shown.
{code}
Updated on 2013-02-16T17:01:17Z at 2013-02-16T17:01:17Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    6195 Posts
    ACCEPTED ANSWER

    Re: Jasper Run Problems

    ‏2013-01-16T21:43:02Z  in response to SystemAdmin
    
    EGL1704E Could not fill report Could not load report design
    


    Program listing:
    
    
    
    package com.mig.officedocsys.reports;   
    
    import com.mig.officedocsys.records.GlobalDataRecord; 
    
    import egl.core.basicprogram;   program StartRequestProgram type BasicProgram(globalDataRecord GlobalDataRecord)   
    
    private reportDesignFile string; 
    
    private reportDestinationFile string; 
    
    private reportExportFile string;   
    
    private comp string; 
    
    private blck string; 
    
    private poly string;   
    
    private connectionString string = globalDataRecord.runtimeJDBCURL; function main()   SqlLib.defineDatabaseAlias(
    "iSeriesDB", connectionString); SQLLib.connect(
    "iSeriesDB", globalDataRecord.runtimeUserID, globalDataRecord.runtimePassword); comp = globalDataRecord.selectedCompany; blck = globalDataRecord.selectedBlock; poly = globalDataRecord.selectedPolicy;   reportDesignFile = globalDataRecord.jasperStartRequestReportDesign; reportDesignFile = 
    "C:\\Desk\\RequestStartReport.jasper"; reportDestinationFile = globalDataRecord.jasperStartRequestReportDestination; reportExportFile = globalDataRecord.jasperStartRequestReportExportFile;   myReport Report = 
    
    new Report(); myReport.reportDesignFile = reportDesignFile; myReport.reportDestinationFile = reportDestinationFile; myReport.reportExportFile = reportExportFile;   myReportData ReportData = 
    
    new ReportData(); 
    //myReportData.connectionName = "iSeriesDB"; 
    //myReportData.sqlStatement = "select * from DCSDCP"; myReport.reportData = myReportData; ReportLib.addReportParameter(myReport, 
    "Company", comp); ReportLib.addReportParameter(myReport, 
    "Block", blck); ReportLib.addReportParameter(myReport, 
    "Policy", poly); ReportLib.addReportParameter(myReport, 
    "Rider", 
    " "); 
    
    try ReportLib.fillReport(myReport, DataSource.reportData); onException(exception AnyException) Syslib.writeStderr(
    "Call to ReportLib.fillReport() has failed for the following reason."); Syslib.writeStderr(exception.messageID + 
    " | " + exception.message); Syslib.writeStderr(
    "Jasper file location: " + reportDesignFile); end   
    
    try ReportLib.exportReport(myReport, ExportFormat.pdf); onException(exception AnyException) Syslib.writeStderr(
    "Call to ReportLib.exportReport() has failed for the following reason."); Syslib.writeStderr(exception.messageID + 
    " | " + exception.message); end   end   end
    


    Error issued:
    
    Call to ReportLib.fillReport() has failed 
    
    for the following reason. EGL1704E | EGL1704E Could not fill report Could not load report design EGL0002I The error occurred in StartRequestProgram processing the main function. Jasper file location: C:\Desk\RequestStartReport.jasper Call to ReportLib.exportReport() has failed 
    
    for the following reason. EGL1705E | EGL1705E Could not export report C:\Desk\AppDevEGL\OfficeDocumentsSystem\OfficeDocumentsSystemProject\WebContent\reports\StartRequestReport.jrprint EGL0002I The error occurred in StartRequestProgram processing the main function.
    


    If there are any experts here who know how to resolve this problem, I could certainly use a pointer.
    • SystemAdmin
      SystemAdmin
      6195 Posts
      ACCEPTED ANSWER

      Re: Jasper Run Problems

      ‏2013-01-18T13:09:50Z  in response to SystemAdmin
      Perhaps I should post a little more information hoping to move this along.

      The program variant listed above was taken from the IBM manual for EGL 8.5. The page is titled "Writing code to drive a report of type JasperReport" and can be seen by taking this navigation path:
      Developing > Developing EGL applications > EGL Programmer's Guide > Creating reports with EGL > Creating reports with JasperReports

      To ensure that the .jasper file is in the location specified by the program, I copied the path that is written to the console and placed it into Windows Explorer. I did the same for the output path. In both cases the path is proven valid and the files are observed to exist.

      Configuration of RBD was conducted following the instructions located on the page titled "Adding support for Jasper reports to a project". The Environment Variable's Path entry includes the path to the Java bin directory containing javac.exe and the machine was rebooted.

      Attached is the .jasper file used by the program. It runs within iReports and produces the expected report which is a simple proof of concept.

      This project relies on EGL's ability to produce reports and represents the first high-visibility application to be used by a department in our company. I believe I am missing a basic fundamental that requires just a little guidance from someone who has experience with EGL and Jasper. Any help offered to assist in trouble-shooting this problem would be appreciated and would go a long way toward building acceptance of EGL by our company.

      Thanks in advance,
      Ben Foster
      • markevans
        markevans
        2612 Posts
        ACCEPTED ANSWER

        Re: Jasper Run Problems

        ‏2013-01-18T17:30:24Z  in response to SystemAdmin
        Ben,

        BIRT is the approach we consider more strategic within EGL. We still support Jasper, but BIRT is the preferred approach.

        If you are just starting with reporting, I might suggest you take a closer look at BIRT.
        • SystemAdmin
          SystemAdmin
          6195 Posts
          ACCEPTED ANSWER

          Re: Jasper Run Problems

          ‏2013-01-18T18:54:05Z  in response to markevans
          https://www.ibm.com/developerworks/forums/thread.jspa?threadID=468071&tstart=0
        • SystemAdmin
          SystemAdmin
          6195 Posts
          ACCEPTED ANSWER

          Re: Jasper Run Problems

          ‏2013-01-18T19:04:27Z  in response to markevans
          Thank you for your reply.

          While I understand BIRT is preferred by IBM and the EGL Team, we have a plethora of Jasper reports being utilized today. As a consequence it isn't out of the question that an EGL application will need to call one of those reports. In such an event and for reasons which should be obvious it isn't likely we will recreate the report using BIRT. As long as EGL supports Jasper reports, I would like to solve this issue as well as the issue I am having with BIRT as it would provide us the flexibility of choice.
  • SystemAdmin
    SystemAdmin
    6195 Posts
    ACCEPTED ANSWER

    Re: Jasper Run Problems

    ‏2013-01-21T01:16:58Z  in response to SystemAdmin
    The error message does not mean report could not be found - please refer to following description for the error code.

    http://publib.boulder.ibm.com/infocenter/rbdhelp/v7r5m0/index.jsp?topic=/com.ibm.egl.messages.doc/topics/egl1704e.html
    EGL1704E Could not fill report report_name.
    Explanation
    Report Fill Error. The data provided to the report is not correct. The reasons could be that the dynamic array record field names do not match the report field names, the connection does not exist or the SQL statement is invalid.
    • SystemAdmin
      SystemAdmin
      6195 Posts
      ACCEPTED ANSWER

      Re: Jasper Run Problems

      ‏2013-01-21T14:28:37Z  in response to SystemAdmin
      Yes, I covered this base before posting to the forum. First, I reviewed my parameter list defined on the EGL side ...
      
      ReportLib.addReportParameter(myReport, 
      "Company", comp); ReportLib.addReportParameter(myReport, 
      "Block", blck); ReportLib.addReportParameter(myReport, 
      "Policy", poly); ReportLib.addReportParameter(myReport, 
      "Rider", 
      " ");
      


      ... and compared them to the parameters defined on the .jrxml side from which the .jasper file is derived:
      
      <parameter name=
      "Company" class=
      "java.lang.String"> <defaultValueExpression><![CDATA[
      "   "]]></defaultValueExpression> </parameter> <parameter name=
      "Block" class=
      "java.lang.String"> <defaultValueExpression><![CDATA[
      " 147"]]></defaultValueExpression> </parameter> <parameter name=
      "Policy" class=
      "java.lang.String"> <defaultValueExpression><![CDATA[
      "     0000069410"]]></defaultValueExpression> </parameter> <parameter name=
      "Rider" class=
      "java.lang.String"> <defaultValueExpression><![CDATA[
      "001"]]></defaultValueExpression> </parameter>
      


      One version of the EGL program passed a connection object to the report resulting in the same error. You can see commented lines which refer to a connection and basic SQL statement that were used in one version of the program which gave the same error message. Since this is just a proof to see if I can get the simplest of reports to generate, the parameters are the only things required for this iteration and as such the version posted does not use a connection.

      After digging into the details of the .jar-file dependencies included in the project when configuring to use Jasper reports, ( Developing > Developing EGL applications > EGL Programmer's Guide > Creating reports with EGL > Creating reports with JasperReports ) I saw the following dependencies:
      commons-beanutils-1.5
      commons-collections-2.1
      commons-digester-1.3
      commons-logging-1.0.2
      commons-logging-api-1.0.2
      jasperreports-0.6.1

      Believing these outdated jar-file could be the problem I downloaded iReports 5.0 and regenerated the .jrxml and compile to a new .jasper file. I then reconfigured the project to match the jar-files used by iReports:
      commons-beanutils-1.8.2
      commons-collections-3.2.1
      commons-digester-2.1
      commons-logging-1.1
      jasperreports-5.0.0

      It resulted in the same EGL1704E error. I have reconfigured the project to use IBM's dependencies (we use iReports 2.0) and have recompiled the .jrxml to a new .jasper file.

      After reviewing the message which states that my data is incorrect (which, to me, seems to match) or a connection wasn't provided (don't need one; passes empty ReportData object) and spending a good portion of a day trying every possible combination of things that I could dream up to get this report to be produced, I finally turned to the forum for help. To add insult to injury, when running the report straight from iReport 2.0, the parameter data prompted for is provided and the .PDF is produced!

      At this point, instead of using IBM's dependencies, I am considering reconfiguring the project to use 2.0 jar-files to see what messages are created.

      The fact that EGL uses such an early version of Jasper and has made no effort to keep abreast with new version (Current is 5.0), it creates a huge problem for companies which are relying upon Jasper. Does IBM expect companies to abandon an on-going investment in Jasper and convert their Jasper reports to BIRT?
      • SystemAdmin
        SystemAdmin
        6195 Posts
        ACCEPTED ANSWER

        Re: Jasper Run Problems

        ‏2013-02-16T16:17:06Z  in response to SystemAdmin
        Hi Ben,

        Would you mind upload your report design file (with the jrxml extension) here? I will compile it in my env and then try to locate the root cause of your problem.

        Regards,

        Smyle
      • SystemAdmin
        SystemAdmin
        6195 Posts
        ACCEPTED ANSWER

        Re: Jasper Run Problems

        ‏2013-02-16T17:01:17Z  in response to SystemAdmin
        I have made a sample design document which makes use of parameters in EGL and made some modifications to your code. Everything works as designed in my environment. May it be helpful for you.

        Here is the modified sample code:
        
        
        
        package reports; 
        // basic program 
        // Record requestRecord type BasicRecord CUSTOMER_ID String; FIRST_NAME String; LAST_NAME String; PHONE String; end     program startRequest type BasicProgram 
        {
        } 
        // Use Declarations 
        //use usePartReference; function main() makeReport(); end   
        
        private reportDesignFile string; 
        
        private reportDestinationFile string; 
        
        private reportExportFile string; 
        
        private comp string; 
        
        private blck string; 
        
        private poly string; recArray        requestRecord[] = []; recArrayElement requestRecord;   function makeReport() comp = 
        "my company"; blck = 
        "my block"; poly = 
        "my policy"; reportDesignFile = 
        "E:\\RBD_WORKSPACES\\CUSTOMER_ISSUES\\COMMUNITY\\RBD85_JasperReportProblem\\JasperProject2\\JavaSource\\jasper.jasper"; reportDestinationFile =  
        "c:\\temp\\startRequestProgram.jrprint"; reportExportFile = 
        "c:\\startRequestProgram.pdf"; myReport Report = 
        
        new Report(); myReport.reportDesignFile = reportDesignFile; myReport.reportDestinationFile = reportDestinationFile; myReport.reportExportFile = reportExportFile; populateReportData(); myReportData ReportData = 
        
        new ReportData(); myReportData.data = recArray; myReport.reportData = myReportData; ReportLib.addReportParameter(myReport, 
        "Company", comp); ReportLib.addReportParameter(myReport, 
        "Block", blck); ReportLib.addReportParameter(myReport, 
        "Policy", poly); ReportLib.addReportParameter(myReport, 
        "Rider", 
        " "); 
        
        try ReportLib.fillReport(myReport, DataSource.reportData); onException(exception AnyException) Syslib.writeStderr(
        "Call to ReportLib.fillReport() has failed for the following reason."); Syslib.writeStderr(exception.messageID + 
        " | " + exception.message); Syslib.writeStderr(
        "Jasper file location: " + reportDesignFile); end 
        
        try ReportLib.exportReport(myReport, ExportFormat.pdf); onException(exception AnyException) Syslib.writeStderr(
        "Call to ReportLib.exportReport() has failed for the following reason."); Syslib.writeStderr(exception.messageID + 
        " | " + exception.message); end end function populateReportData() recArrayElement.CUSTOMER_ID=
        "CustomerID 01"; recArrayElement.LAST_NAME=
        "H."; recArrayElement.FIRST_NAME = 
        "Smyle"; recArrayElement.PHONE = 
        "xxx-xxx-xxxx"; recArray.appendElement(recArrayElement); end end
        


        If you have any question, let me know.

        • Smyle