REPORT.HTM --- Part of Manual for Driver Parameter Calculator --- by Claus Futtrup.
Created 16. April 2004, last revised 15. June 2004. Ported to XHTML 1.0 on 2. October 2004. Last modified 27. October 2004.

Table of Contents:

  1. Introduction
  2. How it works
  3. Making a template
  4. Do's and Don'ts
  5. List of DPC code tags


DPC now supports a REPORT functionality, which can be run when you chosse "Save and Exit" in the Data Menu.

Previously, when saving files, DPC allowed to specify PRN as the recipient. This allowed for rudimentary database printing. I never used this facility myself, but instead I used copy & paste into NOTEPAD for printing.

With the new SaveFile Dialog, specifying PRN was not allowed. Instead a REPORT facility has been designed, which gives you the option to write a HTML report file. If writing this file is successful, then you get a view of the file in your web browser.

From the web browser it is then possible to eg. print the file. The report has already been saved as a HTML file and can be retrieved at any given time (with standard file management tools, like Explorer or your web browser).

This method is much more powerful than the options previously available in DPC because with a HTML file you can choose to print it from your browser, or publish the data on the internet etc.

How it works

The HTML file is generated based on a template specified in the DPC.INI configuration file, named "dpcreporttemplate" (it's extension is not relevant). When generating the report, DPC reads the template file and substitutes DPC-code with the actual values and leaves the rest of the template unchanged.

With the template in HTML almost any presentation of the data can be chosen. All that it requires is some kind of knowledge of HTML coding. Graphics (logos, pictures, frequency response or impedance plots) could be included, and/or a list format or a table with grid etc. could be made, which could all be done with a dedicated HTML editor.

Also you could include links to explanations of the parameters, eg. what they mean or about how they were measured. You can even include Style Sheets or Java Script - anything that your browser will interpret. The possibilities are almost endless.

Making a Template

Report files and its template is supposed to be placed in the DPC "DATA" subdirectory. When installed, DPC comes with a simple template, which serves as an example.

A list of valid DPC-code strings are shown in section "List of DPC code tags" below.

I recommend that you make your own template in whatever HTML editor you prefer to use. I personally have had good experience with Amaya from W3C.ORG because it's management of tags is excellent. The "last" thing to do is to add the DPC code strings that you want to include in your reports. Name the report something original, and modify DPC.INI to utilize your new template.

Do's and Don'ts

It is recommended to match any .HTM report file with a companion .DPC data file to prevent any confusion of what is in the data files and what is in the report files, but DPC does not require this. In this case it is clever to generate the report files (and overwrite previous attempts) until you're satisfied, then save the accompanying .DPC data file under the same name.

DPC-code must be placed inside a HTML comment tag field, with a '<!--' begin tag and a '-->' end tag. The same technique is used when applying inline CSS code in HTML documents (HTML 4.01 or XHTML from version 1.0).

Warning : If you do not do this, then DPC will search for whatever HTML comment field that appears before and after the DPC code, and delete everything in between those comment fields.

Only one DPC code is allowed in each HTML comment tag.

When DPC finds one DPC code string inside a HTML comment field, the rest of the comment is ignored (also spaces), so you can write whatever babble you want - it will not appear in any way in the generated report file.

As a general rule, only use one HTML comment tag per line of text in your template, but for now DPC will handle multiple instances.

If you would like (for example) the Brand and the Model_nr of a driver to appear on the same line, then remember that the formatting of text in HTML code (also XHTML) does not change the layout (unless you format with the "pre" tag). If you want to add space between two tags, which are supposed to appear on the same line, just do like the template.htm shows in the title field:


As can be seen the space ahead of the DPC code for Model_nr will assure that you also get a space between the two fields in the generated report. While it keeps each DPC code on a separate line in the template they will show up on the same line in your browser window.

With HTML (eg. version 3.2) it was legal to do the following:

<!-- DPCData_Brand <!-- DPCData_Model_nr --> -->

Cascaded tags, like the example above, will not be processed properly. This method is not allowed in XHTML either. DPC will process this line in the wrong way and leave you with a mismatch of comment begin/end tags, which might generate a browser error (if the browser is not relaxed in its interpretation and simply ignores the extra end-comment tag).

A good advice is always to test your template thoroughly and make sure that everything works as it should in your application.

In the DPC editor, numbers are lined up with decimal separator (being a dot) in line. You can achieve the same effect in the report if you preformat the DPC code, like this :

<pre ><!--DPC_code--></pre >

If you do not use the preformat HTML tag, then HTML will ignore the multiple spaces that DPC applies to the code line. the preformat tag only works for values in the editor (not text strings, like Brand and Model_nr).

List of DPC code tags

List of HTML variables that can be processed by DPC :


I hope that the DPC code names are logical, since they are shared with the names in the DPC program itself. If you are in doubt, try to check out the default template.htm that comes with a freshly installed DPC, or check out FORMULAS.HTM.