Basic Structure

The following is an example of about the simplest XML report which will actually run.

<?xml version='1.0' ?>

 <!-- Example Report
     XML Report by Mike Weideli of Littlefield Consultancy
      Version 1 14 May 2008 
-->
<CustomReport title="Ex1 ExampleReport" menupath="Example reports" 
description="Nearly the very minimum required for an XML report " >
<SQL>
    SELECT * FROM Individual
    <Where keytype="Default">
     </Where>
</SQL>
</CustomReport>

Copy the above (in green italics) and paste it into Notepad. Save the file with a file type of .xml (eg. as MyExample1.xml Note 1 ) into the Reports folder of Recorder (typically C:\Program Files\Recorder 6\ User Files\Reports). Customise the report by changing the following :- 

  1. The section of the report between the <! and  -> tags is a notes area which does not appear in the report. Use this to identify yourself as the author and to add any information which will help if the report requires amendment.
  2. Alter the title to reflect your name for the report. This is what will appear in the menu when the reports are accessed in Recorder. It is a good idea to include something (like a unique number) in both the filename and the title as this will make it easier to find the files for amendment. (eg. title="MyExample1 My Example Report").
  3. Alter the menu attribute if required. This allows you to set up a structure within the Report menu. The backslash (\) defines a new menu level. (eg. menupath="MyReports\Example reports"). 
  4. Alter the description attribute as required. This can be as long as required. It appears when the report is selected in the menu list. 

The <SQL> tag is always required and there must always be a SELECT statement. The <Where> tag (not to be confused with the WHERE clause in SQL) is also required. In this example it is set to default. Other option will be explained later. 

Save your changes then open Recorder 6. Any errors in the structure will give rise to an error message when Recorder 6 is opened. Check to ensure that you have not accidentally removed tags or attributes. A common mistake when editing the attributes is to accidentally remove one of the double quotation marks.

Run the report in Recorder using Report/Run, then choosing the report from the menu and clicking on OK.

As you progress through the examples in the following pages change this saved example to incorporate the new features.

Notes

1. By default Notepad will save files as .txt. Use the Save As option and change file type to All files. You should then be able to save the file as .xml. Alternatively you can change the way the files are displayed in Windows to always show the file type (extension). If this is done the file can be renamed .xml.

2. Spaces are generally ignored within XML so you can use them to indent the text, making it easier to read. The reports do not work if the first character is a space (ie. before the <xml) which can accidentally happen during copying.

3. The tags and attributes are case sensitive. <CustomReport> and <customreport> are treated as different tags so take care when editing. Recorder reports normally use the convention that tag names use proper case whilst attribute names use lower case.

4. Double clicking on an XML report  file will probably open it in a web browser (Internet Explorer). It will not be possible to edit the report when opened this way, but if there are any syntax errors in the XML these may be shown with details of the problem. There are HTML editors available (eg. HTML Pad ) which will allow editing and also check syntax. Word processors should be avoided as they can insert invisible characters which XML does not recognise.

NEXT PAGE

 

Relate Topics:
  What you need
  ReportTitles and File Names
  SQL Statements
  Simple Filters
  Quick Reports
  Columns
  Extrenal Files (Csv and Filter)
Created by Atop CHM to web converter,© 2009 all right reserved.