Editing Reports

Often minor cosmetic changes will be required to some of the standard Jiwa reports - fields may need to be added or removed, or logos inserted. This guide walks through the basic steps of customising a report using Microsoft Visual Studio 2015 with the SAP Crystal Reports add in. SAP Crystal Reports, developer version for Microsoft Visual Studio is available as a free download here. The latest version of Visual Studio is available here. Note that Crystal Reports, developer version for Microsoft Visual Studio may not support Express/Community Editions of any version of Visual Studio.

A Step by Step guide for downloading the software is here: Software downloads for Editing Reports


Step-by-step guide

  1. Copy. Begin by making a copy of the report you wish to modify. A copy is made because the standard Jiwa reports get updated every upgrade, so any changes made to a standard report will be lost.

    Standard Report Location

    The standard Jiwa reports can all be found in the "ReportCache" folder that resides in the Jiwa installation folder (by default, Jiwa is installed in C:\Program File (x86)\Jiwa Financials\Jiwa 7). These are read-only files, so you may have to clear the read-only attribute on the copied file by right clicking on it and choosing "Properties". The "Read-only" attribute is at the bottom of the "General" tab - ensure it is un-ticked.
  2. Open. Open Microsoft Visual Studio, and then open the report for editing by going to the File menu and selecting Open, and then File.... 


    Select the report you wish to edit from the resultant dialog window:


    The report should now be loaded into Visual Studio, ready for modification.  Notice that there is a "Crystal Reports" main menu that has appeared in the menu-bar, and a side-panel called the "Field Explorer" on the left.

     

    Field Explorer

    If you cannot see the "Field Explorer" panel, reveal it by opening the "Crystal Reports" menu on the menu-bar, and then clicking on "Field Explorer" - this is a toggle that will hide/reveal the panel.

  3. Set Datasource. The report needs to be pointed to a Jiwa database, so that changes to the report can be previewed in the editor using the data from that database.  Go to The "Crystal Reports" menu, the "Database" sub-menu, and click "Set Datasource Location...":


    The "Set Datasource Location" dialog window will be displayed.  Select (by left-clicking) the datasource in the top section of the dialog, in the "Current Data Source:" section, and select the replacement datasource in the "Replace with:" section. Repeat the process for any subreport nodes in the "Current Data Source:" section.  Click the "Update" button when done.


    Parameters may have to be provided at this stage to allow Crystal Reports to query the database and ensure that all fields that were in the old datasource also exist in the new datasource. Crystal Reports will prompt for a mapping if there are any mismatches.

    Create New Connection

    If you do not have a connection under the "My Connections" node of the "Replace with:" section, then one must be created.

    1. Expand the "Create New Connection" node, then double click on the "OLE DB (ADO)" node.

     

    2. In the "OLE DB (ADO)" dialog window, select "Microsoft OLE DB Provider for SQL Server", then click "Next".

     

    3. Enter the name of the SQL Server in the "Server:" text-box, the SQL login in the "User ID:" text-box, and the SQL password in the "Password:" text-box. Then use the "Database:" pull-down to select a Jiwa database. Click "Finish" to return to the "Set Datasource Location" dialog window.

     

    4. The new connection is now available under the "OLE DB (ADO)" node.

  4. Modify. The report can now be modified as desired. Use the "Field Explorer" to drag database or formula fields onto the report.  Right-click on an object on the report canvas to modify it's properties or to delete it. Use the "Insert" menu under the "Crystal Reports" menu on the menu-bar to insert new objects such as images, text fields, boxes, charts etc.

  5. Preview. Click on the "Main Report Preview" tab at the bottom of the report canvas to run the report and examine the layout:


    You may be prompted for parameter values during the preview - supply some valid data, or try ticking the "Set to Null" tick-box to use default values.

    Parameters

    Ticking the "Set to Null" tick-box may result in the report being previewed without any data (it depends on how the report was originally designed). In the example above the InvoiceHistoryID value of 000000000800000000NL was used - this is a valid InvoiceHistoryID value in the standard Jiwa demonstration database, and as such data was returned from the database for the report to render with.

  6. Save. Save the changes made on the report by going to the "File" menu and clicking on "Save xxx.rpt", where "xxx.rpt" is the filename of the report being modified.

  7. Deploy. The modified report must now be loaded into the Jiwa database for use from within Jiwa. To do this, log in to Jiwa and load the "Reports" form (Jiwa→System Settings→Report Configuration→Reports):


    Click on the "Refresh From Files" button on the ribbon, and the select the modified report using the resultant file browser dialog.  The file is then sucked up into the database.  Click "Save".

    Refresh From Files

    If a report with the "File Name" already exists in the database, then that report will be updated with the modified report.


    If the report is a menu-based report (i.e. it is launched from the main Jiwa menu), then use "Menu Maintenance" (Jiwa→System Settings→Menu Configuration→Menu Maintenance) to add a new entry for the report.  If the report is a form-based report (i.e. it is launched from an existing form like the Invoice report from the Sales Orders Entry screen), then go to the appropriate form, and add the report via the "Printer Setup" button on the form's ribbon menu.