The objective of this task was to provide the ability to create open customizable chart templates that define the type of data to be displayed along with the chart layout and appearance. An open template provides complete freedom to select and query HPMS and/or RSL data from any PHT analysis result dataset, choose how the data are displayed in the chart, and adjust the chart appearance properties. User-defined chart templates are then stored in a library for subsequent reuse with other analysis results.
Chart template definitions are stored in the chart library as well formatted XML files with defined and documented schema tags. Individual chart templates can be exported/imported allowing template definitions to be freely shared among PHT users.
Chart templates begin by defining SQL queries to retrieve information from the database. The SQL query extracts data from a table that contains the results of a PHT analysis. When encoded into a template, the name of the table is replaced in the SQL query with a place holder. This process is then reversed when the template is reconstituted into a new chart by replacing the place-holder with the table name that contains the new PHT analysis results. In this manner, the SQL queries that retrieve the data for the chart become independent of any specific set of PHT analysis results.
The place holder character for the table name is the ASCII character 149 (Bullet). This character was selected because it has no meaning in the SQL syntax of a query statement and will not be confused with any other valid use.
The chart template is stored in XML format. Tags are included in the XML file to store the chart template SQL query statements for each data column in the charts spread sheet. In addition to the queries, it is also necessary for the chart template to store information about the schema of the data table that the queries are designed to operate with.
An example of the encoding for a chart template is shown in the following XML listing.
Chart templates are specific to a table schema and expect the data table to provide a prescribed set of field names and data types. In the case of the PHT analysis tool, this schema is that of the PHT result table that is produced for every analysis run. The table schema is identified by a schema signature which is a decimal number, calculated through an algorithm using the ASCII character values of the field name and data type for each data field in the table. In the case of the PHT result table, the signature has the following value.
Tags are included in the template XML file to store the table schema signature. An example of a chart template file is shown in the following XML listing.
|<?xml version= "1.0 " encoding= "utf-8 "?>
<column index= "2 ">
(SQL syntax for the selection query: i.e. "SELECT [abc] FROM [•] ")
The template library tab shown in Figure 86 provides management of the template library. The templates provide the format for predefined charts used to generate reports. Once a template is selected from the list, it can be deleted or exported to an XML file. In XML form, the template file can be shared with other PHT users who can import it into their own template library.
Chart templates can easily be created by first using the Report Wizard to produce a chart report, and then modifying the report to meet any unique needs. The report can then be saved as a template to the library.
There are four controls in the chart toolbar are exclusively for working with chart templates and the template library, and are only active immediately after the report wizard has generated the statistical chart. Once the chart window has been closed, the template controls will not be available the next time the chart window is opened from the document library.
The template controls are as follows: