Note |
---|
|
This page is still under construction |
In this example three simple reports will be made: a chart, a table with timeserie values and a table with maximum status. With the examples the basis for a report can be made. By changing attributes or elements, the user can expand the reports to their own willing.
Contents:
Set up a workflow to create a report
Create a simple chart report
Create a simple table report
Setting up the workflow
For setting up a workflow in which a simple report is generated, first a couple of files need to be edited or added. These are:
...
Info |
---|
|
Notice that the WorkflowId is the same as the name of the file which contains the workflow! In this case it is "report", which is the same as the file "\WorkflowFiles\report.xml"! |
Setting up a report with a chart
...
Code Block |
---|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>Management Report: System Status Report</TITLE>
<!--check for right levels up-->
<link href="css\styles.css" rel="styleSheet" type="text/css">
<link href="css\tables.css" rel="styleSheet" type="text/css">
</head>
<body>
$CHART(chartMainH)$
</BODY>
</HTML>
|
Setting up a report with a table
In this example we will create a report with a table containing water levels at a specific location. The descriptions of the elements, as in the previous chapter, are not repeated.
Declaration
In the next code block is a configuration of a simple chart:
Code Block |
---|
|
<htmlTableFormat id="SimpleTable" tableStyle="tableStyle1">
<column>allSeries</column>
<row>time</row>
<includeBeforeOrEqualToTimeZeroInChoiceFormat>false</includeBeforeOrEqualToTimeZeroInChoiceFormat>
<relativeWholePeriod start="-5" end="5" unit="day"/>
<topLeftText>Datum-Tijd</topLeftText>
<cellFormat>{0,number,0.00}</cellFormat>
<topFormat/>
<leftFormat>{0,date,dd MM yyyy HH mm}</leftFormat>
<missingValueText>#</missingValueText>
<nullValueText>-</nullValueText>
</htmlTableFormat>
|
Different tablestyles can be chosen. Here examples of the different standard table styles can be found.
The HTMLTableFormat ID will later be used to refer to this layout. In above section is described what information is to be placed in the columns and in the rows. In this case the columns contain the locations, and the rows the date/time.
Report
In the next block of code we connect the chart layout to a time serie.
Code Block |
---|
|
<report>
<inputVariable variableId="OB_H1" variableType="any">
<timeSeriesSet>
<moduleInstanceId>ImportAquaView</moduleInstanceId>
<valueType>scalar</valueType>
<parameterId>H.meting</parameterId>
<locationSetId>OB_H.meting</locationSetId>
<timeSeriesType>external historical</timeSeriesType>
<timeStep unit="minute" multiplier="5"/>
<relativeViewPeriod unit="hour" start="-10" end="10"/>
<readWriteMode>read only</readWriteMode>
</timeSeriesSet>
</inputVariable>
<htmlTable id="test_tabel" formatId="SimpleTable">
<timeSeries>OB_H1</timeSeries>
</htmlTable>
<template>template.html</template>
<outputFileName>chartreport.html</outputFileName>
</report>
|
In the htmlTable section the connection is made between the time serie(s) and the table layout (as defined in the declarations section).
Info |
---|
The formatID should be the same as the ID of the HTMLFormat as defined in the declarations section! The element "Timeseries" contains the ID of the inputvariable! The ID of the table(in this example "tabel") will appear later in the template HTML file. |
HTML template file
The template file for the HTML table is the same as for the chart, except that the tag is different:
$TABLE(test_tabel)$