Export Grid to XML
Top  Previous  Next 


The XML import and export feature requires supervisor privileges to access.

In addition to System Five's ability to export a grid to a CSV or Microsoft Excel file, it can also generate an XML representation of the cells in the grid. This is useful if you need to generate an export file in a specific format that is not easily attained by the other export types.

Warning: This is an advanced feature and requires technical knowledge to be used effectively. The XML output that System Five  produces is of limited use on its own, so you need to transform it with an XSL style sheet, thus knowledge of XSL and related technologies are necessary.

Exporting To XML 

To export data from a grid, right click the grid and hover your cursor over the XML Export menu. A sub-menu opens that lists your currently defined export settings. 


Figure 1: XML Export menu

In the example shown in Figure 1, there is an export defined for a sales report and an inventory report. System Five simply displays all available defined grid exports, regardless of the grid that you are exporting from.

The two additional items at the bottom of the list are conveniences. The first, Display Grid Information, shows a simple window that describes the column structure of the grid, and the second is a shortcut to the XML Export window in XML Central that allows you to define export settings.

Grid Information

The grid information window displays a simple overview of the columns that are present in the grid. 


Figure 2: Grid Information window

Grid information is displayed in four columns.

The first column identifies the column number.

The second column shows the column name. This name is either the caption defined for the column in System Five, or the contents of the first cell in the column if no caption is defined.

The third column is the XML-safe version of the column name. The value that appears in this column is suitable for use as an XML node name... spaces and non-alphanumeric characters are stripped from the column name.

The fourth column indicates whether that column of the grid is visible or not. System Five may hide columns that aren't relevant. In figure 2, for example, the Dept column is not visible because the system is not departmentalized. Any data that these columns contain is available to you in the XML export.


XML Export

The  XML Export window is where you define your export settings. Use of this window is described elsewhere in the documentation, but the grid-specific export options are described below.

wwExportCompact:  Exports a simple version of the grid's contents. The purpose of this option is to generate the smallest possible XML file. When you enable this option, the value in the XML Name column of the Grid Information window is used for node names, and the wwExportCellFormat and wwExportHints options are ignored.

wwExportCellFormat:   This tells System Five to include font and other cell formatting information in each cell's node. This is probably only useful if you are using the XML output to generate a visual representation of the grid (HTML, for example), or if you need the formatting information as queues during the transformation.

wwExportExcludeHidden:This tells System Five to omit hidden columns from the export. This can further reduce the size of the XML file.  


wwExportHints:Enabling this option causes System Five to export any text assigned to cells and rows of the grid as hints. Hints are displayed in System Five when you hover your cursor over a cell or row.


wwExportEncode:This option uses a form of base 64 encoding to make binary information safe for export.



Structure Of Generated XML

The structure of the XML that System Five generates for a grid export is best learned by running an export and examining the resulting XML. There are a few points worth noting, however:

1.Try to identify the minimum amount of information that you require in the output file. The more you can trim the output, the smaller the resulting file is, and the faster the XSL transform goes. Don't export cell formatting information if you don't need it.  
2.If you modify the settings of a report or change settings in System Five, it could change the structure of the XML that System Five generates and break your XSL style sheet. Make changes with care.  
3.If you do not enable the wwExportCompact export option, you have a choice of identifying cell values by name or by number (both values are assigned as attributes of the Cell node). Using the name value makes your style sheet immune to changes in column order of the report. Using the number value makes your style sheet immune to changes in column caption (so long as the data represented by the column doesn't change). Note also that the wwExportExcludeHidden export option does not affect column numbering: If column 1 was hidden in your target grid, the first column number that would appear in your export file would be 2.  


< Return to XML Central Overview