Topic: Reporting
Online Help
Page header (Pro only)
This feature is available only in Calcpad VM Pro 8.
You can put the report inside your own page header, for example a company title block with a logo, project data and signatures. To do that, add the #Header keyword anywhere in the code. It applies to the whole report. The header is an Html template, stored in the file "Documents\Calcpad\Template\header.en.html" (or "header.bg.html" for the Bulgarian version). It usually contains a table with the header in the <thead> section. The report is placed in the first cell of the table body (<tbody>). If there is no such cell, the report is added after the header. You can use relative paths for the images in the template, e.g. src="logo.png". They are resolved from the template's folder. If the file does not exist, #Header has no effect on the output.
The fields of the header are filled from the following macro variables. Each one goes into the element of the template with the respective id:
| Macro | Element id | Word property |
|---|---|---|
Project$ |
project | Project |
Client$ |
client | Client |
Problem$ |
problem | Problem |
Date$ |
date | Date |
Page$ |
page | number of the first page |
JobNo$ |
job | Job |
Revision$ |
revision | Revision |
DesignBy$ |
design | Design By |
CheckedBy$ |
check | Checked by |
For example:
#Header#def Project$ = Office building#def Client$ = ABC Ltd.#def Date$ = 13.10.2026
The fields that are not defined keep the content of the template. The easiest way to start is the "Insert" → "Header" menu command. It adds #Header together with the definitions of all fields. Then, you only have to replace the values.
You can also edit the fields directly in the output. Click on a field and type the new value. When you recalculate, save the file or export the output, your changes are written back to the respective #def lines in the code. Missing definitions are added after the existing ones, and if you clear a field, its definition is removed. Fields that are defined in included modules cannot be changed this way.
The header is included when you save, print or export the output to PDF. When you export to Word, the program uses the template "Documents\Calcpad\Template\Template.en.docx" ("Template.bg.docx" for the Bulgarian version) instead. The values of the macros are written to the custom document properties of the template with the respective names (see the table above). Case and spaces in the names are ignored, and properties that the template does not have are skipped. You can display them in the page header of the template as DocProperty fields. Page$ sets the number of the first page, if it is an integer.