SourceForge.net Logo   FFReport

Record Editor
 

Record Editor

  • RecordEditor Connection
  • Report Wizard
  • Creating a report
  • RecordEditor Provider
  • Defining RecordEditor Provider
  • Using the RecordEditor Provider in a Report
  • The RecordEditor is a data file editor for Fixed Width, Delimitied Datafiles. It Stores File Layouts in a Database. This package can use RecordEditor File layouts to build reports.

    Note: For RecordEditor-HSQL users, you must start the Database Server before starting iReports. Unlike the RecordEditor, FFReport will not open the Database in Embeded mode.


    As for all the interfaces, there is both a IReportConnection (IReport Specific) and JRDataSourceProvider (Generic designer) interfaces.


    RecordEditor Connection

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


    The RecordEditor interface does 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 RecordEditor 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 RecordEditor 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.

      Record Layout

      RecordEditor Layout Definition

      Define fields as numeric

      Old field

      Report Record

      Primary report record. When this record comes up, data will be passed back to Jasper Reports Typically it will be the main detail line of the report.

      Record

      Records to be used in the Report

    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 RecordEditor 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 RecordEditor 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 RecordEditor details screen will be displayed where you can enter RecordEditor Copybook and the source file. Once finished, hit the Go button.


      Field

      Description

      File

      Data file to be used in the report.

      Record Layout

      RecordEditor Layout Definition

      Define fields as numeric

      Old field

      Report Record

      Primary report record. When this record comes up, data will be passed back to Jasper Reports Typically it will be the main detail line of the report.

      Record

      Records to be used in the Report

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


    The generated report may look something like this:



    RecordEditor Provider

    I also supply the RecordEditor provider class net.sf.FFReport.Provider.RecordDataSourceProvider , 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 "Cobol 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 RecordEditor Provider

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

    Steps:



    Using the RecordEditor 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 RecordEditor selection screen


      Field

      Description

      File

      Data file to be used in the report.

      Record Layout

      RecordEditor Layout Definition

      Define fields as numeric

      Old field

      Report Record

      Primary report record. When this record comes up, data will be passed back to Jasper Reports Typically it will be the main detail line of the report.

      Record

      Records to be used in the Report

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

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


     

    FFReport at SourceForge Download Page Forums