SourceForge.net Logo   FFReport

Cobol Report
 

Cobol Report

  • Sample Reports
  • Cobol Connection
  • Cobol Connection
  • Report Wizard
  • Creating a report
  • Cobol Provider
  • Defining Cobol Provider
  • Using the Cobol Provider in a Report
  • This package supports desiging Reports from a Cobol Copybook. The package will read Cobol Copybook and let you drag the fields into the Report.

       6:000600*
       7:000700*   RECORD LENGTH IS 27.
       8:000800*
       9:000900        03  DTAR020-KCODE-STORE-KEY.
      10:001000            05 DTAR020-KEYCODE-NO      PIC X(08).
      11:001100            05 DTAR020-STORE-NO        PIC S9(03)   COMP-3.
      12:001200        03  DTAR020-DATE               PIC S9(07)   COMP-3.
      13:001300        03  DTAR020-DEPT-NO            PIC S9(03)   COMP-3.
      14:001400        03  DTAR020-QTY-SOLD           PIC S9(9)    COMP-3.
      15:001500        03  DTAR020-SALE-PRICE         PIC S9(9)V99 COMP-3.
      16:
    

    Currently the package supports

    Mainframe cobol

    Transport your binary mainframe files and Cobol Copybooks to the PC and run the report

    Futjisu Cobol

    The Free Futjisu Cobol Compiler

    Open Cobol

    Supports Open Cobol (Default, MVS, BS2000 and Microfocus)

    MicroFocus Cobol

    The Open Cobol - MicroFocus mode should with geniune MicroFocus Cobol Files

    As for all the interfaces in this package, there is both a IReportConnection (IReport Specific) and JRDataSourceProvider (Generic designer) interfaces to Cobol Copybooks.


    Sample Reports

    As well as producing Standard reports from your cobol files


    you can include graphs in reports:



    Cobol Connection

    If using iReports, for cobol Reports, you should use the Cobol Connection class, This can be selected in the connection Combo:


    The Cobol interface does not support multiple records in a file at present.

    This package supports desiging Reports from a Cobol Copybook. The package will read Cobol Copybook and let you drag the fields into the Report.

    As for all the interfaces in this package, there is both a IReportConnection (IReport Specific) and JRDataSourceProvider (Generic designer) interfaces to Cobol Copybooks.


    Cobol Connection

    If using iReports, for cobol Reports, you should use the Cobol Connection class, This can be selected in the connection Combo:


    The Cobol interface does not support multiple records in a file at present.

    Report Wizard

    One of the easiest ways to get started is to use IReports Report Wizard. To do this:

    1. Start iReports.

    2. Select File >> New... from the IReport top level menu (it was File >> Report Wizard in earlier versions of IReport).

    3. Select the appropriate Template and then hit the Launch Report Wizard Button

      Note: The Blank* Templates can not be used with the ReportWizard.

      Note: Quite a few of the Templates will not work with Linux, I have created Linux versions of these Templates (on Fedora 11), which should be better.

    4. Enter the report name and details in the screen, the click on the next button.


      then click on the next button

    5. Select Cobol Connection in the connection Combo, this will bring up the Query field and the Design Query button.


    6. Click on the Design Query button, this will bring up the cobol Definition Screen. The following example is for a native Mainframe (recfm=fb) file holding Binary and Text fields:


      Field

      Description

      File

      Data file to be used in the report.

      Cobol Copybook

      Cobol File Definition

      Define fields as numeric

      Old field

      Font Name

      Java name of the font. leave blank for normal PC / Unix files. In this case CP037 is the Mainframe Ebcidic font,

      Binary Format

      Binary format to use (i.e. Little Endian, Big Endian)

      File Structure

      Structure of the file, normally this can be left as Default Reader. The other Structures are Mainframe / Legacy Structures.

    7. Click the go button and the Query screen will be displayed; click on the Next button.


    8. The next screen displays the fields, select those you want


    9. Next select the Group by fields.


    10. On the second last screen, you select the Report-Layout.


    11. Once you have defined the report, make sure the Connection is Cobol Connection


    12. Next you need to sort the file in the same order as the Group by clause. Right click on the Report name and select the Edit Query


    13. Click on the Sort option button down the bottom of the screen.


    14. Select the Sort fields


    15. Once you enter the sort fields, exit the Query screen, your report should be ready to run. Try hitting the preview button.

    Creating a report

    Note: Make sure that you have Cobol Connection selection


    To create a report from scratch

    1. Start iReports.

    2. Select File >> New... from the IReport top level menu.

    3. Select the appropriate Template from the List and hit the Open this Template Button.

    4. Enter Report name


    5. Next Right click on the Report Name and select Edit Query


    6. Next Select RecordEditor in the Query Language Combo. Then hit the Query Designer Button.


    7. The cobol details screen will be displayed where you can enter Cobol Copybook and the source file. Once finished, hit the Go button.


      Field

      Description

      File

      Data file to be used in the report.

      Cobol Copybook

      Cobol File Definition

      Define fields as numeric

      Old field

      Font Name

      Java name of the font. leave blank for normal PC / Unix files. In this case CP037 is the Mainframe Ebcidic font,

      Binary Format

      Binary format to use (i.e. Little Endian, Big Endian)

      File Structure

      Structure of the file, normally this can be left as Default Reader. The other Structures are Mainframe / Legacy Structures.

    8. Now if you expand the field Tree, the Cobol fields are listed, you can drag and drop these fields into the report


    The generated report may look something like this:



    Cobol Provider

    I also supply the Cobol provider class net.sf.FFReport.Provider.CobolDataSourceProvider , this implements the standard jasper reports Design interface (JRDataSourceProvider). You should be able to use this class in any Jasper Report Designer that supports this interface. In iReports you are better off using "RecordEditor-Xml Connection" but if want, you can try the provider class in iReports. Just be aware that JRDataSourceProvider's does not work in all versions of iReports e.g. Version 3.7.3.

    Defining Cobol Provider

    The class net.sf.FFReport.Provider.CobolDataSourceProvider implements JRDataSourceProvider and acts as the interface between iReports and the RecordDataSource (file based data source for a report).

    Steps:



    Using the Cobol Provider in a Report

    First you need to create a report (File >>> New), then

    1. In the Report Inspector Right Click on the report Name and select Edit Query


    2. Select the DataSource Provider Tag.  

    3. Press the Get fields from datasource to get the Cobol selection screen


      Field

      Description

      File

      Data file to be used in the report.

      Cobol Copybook

      Cobol File Definition

      Define fields as numeric

      Old field

      Font Name

      Java name of the font. leave blank for normal PC / Unix files. In this case CP037 is the Mainframe Ebcidic font,

      Binary Format

      Binary format to use (i.e. Little Endian, Big Endian)

      File Structure

      Structure of the file, normally this can be left as Default Reader. The other Structures are Mainframe / Legacy Structures.

    4. When you have entered all the data press the go button.

    5. Now if you expand the field Tree, the Cobol fields are listed, you can drag and drop these fields into the report


     

    FFReport at SourceForge Download Page Forums