Orixa Reporting Features: Report Templates and XML

Orixa includes the reporting engine "Fast Reports" (www.fast-report.com) which allows users to develop and customize their own reports.

The features of the reporting engine are dealt with extensively elsewhere in the help system.

Until 2018, Orixa stored these reports in external "template" files. These were stored in a "Reports" folder on the database server. All Fast Report templates are XML documents in which the layout and format of any report is stored as plain-text, with "mark-up" to allow the report engine to encode them at run-time.

Orixa now stores all Report templates within the main database. Data that was previously stored in the FR3 XML-file is now stored, in the same XML format, in the "ObjectProperties" field of the Resources Data-table. Power-users can access the XML data there and even edit if it they wish to, or use SQL scripts to update it when the structure of the database changes.

It is still possible to save report XML templates separately as files, and this can be useful if you want to keep a copy of a report-template to reuse, or if you want to copy a report-template into a new report or a wholly new Orixa App. 

Impact for normal users
Most users of the new system should not notice any change, as they really only run or view reports, they do not usually edit them. Including the report-templates into the database has made the system more reliable. It is also easier to update reports between multiple offices, and easier for power-users to change reports when needed.

Report Templates, FR3 and XML files

  

FR3 Data  

These files were all identified by the name of the template file, and an extension ".FR3".

The image on the left shows a listing of these files.

Storing the report template as an FR3 file was easy and quick, and meant that users could easily re-use different report templates as a "starting point" for a report.

Storing the report template on disk has disadvantages:

For these reasons all report templates are stored in the Orixa database, rather than separately. It can still be useful to save templates to disk for re-use and external editing.

The Resources system-table is used to hold records for all forms of reporting that can be done by Orixa:

All these different reporting outputs store their settings in different ways. Now, all the "settings" meta-data is stored in the "Object Properties field of the table, meaning that power-users can access and review it all in one place.

XML Data in Notepad  

Old FR3 File with XML content showing in "Notepad"

You can see the properties of the report laid out in the square brackets "<" and ">" of XML mark-up notation. When a user edited and saved a report in Orixa this XML would be changed and updated.

Report XML Data  

New System, with XML content held in "ObjectProperties" of the "Resources" data-table

Now that the data is held within Orixa all updates and edits to a report are automatically saved within the database, and circulated to different users linked to different servers of Orixa without the need to copy FR3 files. 

All reports are automatically backed-up and kept secure, through the automatic back up processes built into Orixa.

Accessing XML Data to import / export  

Accessing the XML of a report

  1. From the System menu, select "View / Edit System Resources". This menu and menu-item are only available to "power users" with a security level above 50.
  2. Find the report with XML you want to edit.
  3. From the "Actions" menu, select "View ObjectProperties For This Report".
  4. The XML window will open.
  5. Note that you can import and export the XML, and edit it.

XML is just simple text. You can cut / paste and edit it manually (but any errors will mean that a report will not work!).

Extreme care should be taken when editing the XML of a report. Always keep a copy of the original XML when you are making edits, so you can "undo" if you need to.

Remember that there is no need to edit the XML of a report. Use the Report-designer if you want to change the design of a report.

Reasons for accessing the XML of a report

Generally it will not be necessary to access a report’s XML. The user should simply run the report, or if they need to edit it, they should use the report-editing tools built in to Orixa and Fast Report.

However power-users may wish to directly edit the XML for the following reasons:

If you alter your database and change the name of some fields in the data-tables, when you run a report these changes will cause errors. The SQL written to retrieve the data will fail, and the report will also fail as it references data-fields which no longer exist. The report still runs, but the mis-named fields will show blank. In this situation you can either use the Report Designer to correct the field names, or use find / replace within the XML.

When updating any Orixa and changing the names of fields run a "FrameworkNameCheck" for the changed fields. This will help identify reports (and other resources) that use these fields. A Programmer can then write SQL to update the Report-XML so that the report will run without error.

If you create a new report, you may wish to use XML template you store on-disk as a "starter" for your design. In this case you can use the "Import from FR3 file" button (marked 5., in the diagram above) to import it into Orixa.

The process can also be reversed with the "export to FR3 file" button.