HTML-printing is meant for printing various types of documents. The distinctive feature of this printing method is an ease of creating report templates (it requires only a basic knowledge of HTML).
HTML-printing is based on a principle that each document type can have several corresponding reports, each represented by a file with the rep extension (report template written in HTML using keywords, links to field values and table titles).
Let's examine a typical template for Tasks - task.rep file (supplied with WinOrganizer, located in the Reports folder).
| |
|
[%%ReportType=Tasks%%]
[%%ReportCaption="Tasks"%%]
[%%ReportDescription=" "%%]
[%%HEADER%%]
<html>
<head>
<title>%%ReportTitle%%</title>
<META http-equiv=Content-Type content="text/html; charset=%%Charset%%">
</head>
<BODY bgcolor=#FFFFFF leftmargin=5 topmargin=5 rightmargin=5 bottommargin=5>
<FONT size=2 color=#000000 face="Arial">
%%ImgCaption%%<STRONG>%%Caption%%</STRONG>
</FONT>
<hr>
<TABLE border=1 cellpadding=3 width="100%" cellspacing=0>
<tr bgcolor="#C8EBC7">
<td width="18"><P align=center> </td>
<td width="36"><P align=center>%</td>
<td width="18"><P align=center>!</td>
<td>@@Title@@</td>
<td width="80">@@Date@@</td>
<td width="80">@@Time@@</td>
</tr>
#==============================================================================
[%%ROWTABLE%%]
<tr bgcolor="%%BGColor%%">
<td width="18"><P align=center> <font color="%%FontColor%%">
%%Alarm%%</font> </td>
<td width="36"><P align=center> <font color="%%FontColor%%">
%%CompletedPercent%%</font> </td>
<td width="18"><P align=center> <font color="%%FontColor%%">
%%Priority%%</font> </td>
<td>%%IgnoreHtmlTitle%%</td>
<td width="80"> <font color="%%FontColor%%"> $$Date$$ </font> </td>
<td width="80"> <font color="%%FontColor%%"> $$Time$$ </font> </td>
</tr>
#==============================================================================
[%%COMMENTS%%]
<TR bgcolor="%%BGColor%%"> <td colSpan=6> %%Comments%% </td> </TR>
#==============================================================================
[%%FOOTER%%]
</table>
</body>
</html>
|
On the basis of this template, a report of the following appearance is generated on printing tasks:
A template consists of seven obligatory parts called sections. All sections should go in a strictly defined order and have the following appearance:
| [%%ReportType=Tasks%%] | | report type |
| [%%ReportCaption="Tasks"%%] | report name |
| [%%ReportDescription=" "%%] | report description |
| [%%HEADER%%] | report heading |
| [%%ROWTABLE%%] | data |
| [%%COMMENTS%%] | comments |
| [%%FOOTER%%] | report end |
A report type is entered after the "=" sign in the [%%ReportType=Tasks%%] section. For Tasks this line must be entered as [%%ReportType=Tasks%%], for Notes - [%%ReportType=Notes%%] and so on (see the full list of all sections in the Conventions, sections and keywords... section).
The [%%ReportCaption="Tasks"%%] section - the name of a report is entered in quotation marks after the "=" sign. On printing, this name will appear in the Report template field of the Report options dialog box.
The [%%ReportDescription=" "%%] section - a short description of the report is entered in quotation marks after the "=" sign. On printing, this will appear in the Report description field of the Report options dialog box.
The [%%HEADER%%] section - description of a report heading. It includes standard HTML tags and keywords required for the creation of a report heading:
Example of the [%%HEADER%%] section:
| |
|
[%%HEADER%%]
<html>
<head>
<title>%%ReportTitle%%</title>
<META http-equiv=Content-Type content="text/html; charset=%%Charset%%">
</head>
<BODY bgcolor=#FFFFFF leftmargin=5 topmargin=5 rightmargin=5 bottommargin=5>
<FONT size=2 color=#000000 face="Arial">
%%ImgCaption%% <STRONG>%%Caption%%</STRONG>
</FONT>
<TABLE border=1 cellpadding=3 width="100%" cellspacing=0>
<tr bgcolor="#C8EBC7">
<td width="18"><P align=center> </td>
<td width="36"><P align=center>%</td>
<td width="18"><P align=center>!</td>
<td>@@Title@@</td>
<td width="80">@@Date@@</td>
<td width="80">@@Time@@</td>
</tr>
|
On report generation, the %%Charset%% keyword is changed by a codepage number. An icon of the current document appears instead of %%ImgCaption%%. Instead of %%Caption%% you get the name of a document. The <TABLE border=1 cellpadding=3 width="100%" cellspacing=0> tag opens up the beginning of heading description for a table that will be used for data output. @@Title@@, @@Date@@, @@Time@@ - titles of Title, Date, Time fields, correspondingly. On printing, they will be changed to "Title", "Date" and "Time".
The [%%ROWTABLE%%] section contains values of fields displayed in the table.
| |
|
[%%ROWTABLE%%]
<tr bgcolor="%%BGColor%%">
<td width="18"><P align=center> <font color="%%FontColor%%">
%%Alarm%% </font> </td>
<td width="36"><P align=center> <font color="%%FontColor%%">
%%CompletedPercent%% </font> </td>
<td width="18"><P align=center> <font color="%%FontColor%%">
%%Priority%% </font> </td>
<td>%%IgnoreHtmlTitle%%</td>
<td width="80"> <font color="%%FontColor%%"> $$Date$$ </font> </td>
<td width="80"> <font color="%%FontColor%%"> $$Time$$ </font> </td>
</tr>
|
where %%Priority%% - keyword (transformed value of the Priority field) $$Date$$, $$Time$$ - values of the Date and Time fields.
The [%%COMMENTS%%] section contains a keyword (%%Comments%%) used for outputting document comments.
| |
|
[%%COMMENTS%%]
<TR bgcolor="%%BGColor%%"> <td colSpan=6> %%Comments%%</td> </TR>
|
The [%%FOOTER%%] section describes end tags of an HTML report template.
| |
|
[%%FOOTER%%]
</table>
</body>
</html>
|
|