Is it possible to modify the header and footer in reports? For example, to add comments or my own custom files?
How can I change the header and footer in reports?
This article applies to PRTG Network Monitor 17.4.35 or later
Changing the Header and Footer in Reports
In the PRTG web interface, you can already add introductory and final comments to your reports in the report settings under Report Comments. One text shows up on top of the first page of the report, the other below the last data table or graph on the last page of the report.
If this isn't enough for your needs, you can create custom header and footer HTM files and add a separate report template for every report you want to use your customized header and/or footer files with.
A template consists of several template files. When creating a report, the web engine pastes all these "includes" together into one HTML file to generate the report. To modify a report template, changes to the main file, to one of the include files, or both are necessary.
Note: Good knowledge of HTML is a minimum requirement to make any of the following modifications! Please note that modifications are unsupported.
Make a backup of every file you are going to change!
- Step 1: Go to the \webroot\includes subfolder of your PRTG installation.
- Step 2: Duplicate the printheading.htm and printfooter.htm files and append, for example, _custom to the copies' filenames. Make sure the extension remains .HTM.
- Step 3: In a text editor, change the content of printheading_custom.htm and printfooter_custom.htm as needed and save your changes. You may need to open the editor as an administrator user to be write-enabled.
- Step 4: In the \webroot\reporttemplates\ subfolder of your PRTG installation, locate the main report template file, for example, "A50 Graph with Data Table - Graph 24h - Table 24h.htm".
- Step 5: Once you've found the right template file, duplicate it, and save it with a custom name.
Tip: Choose a filename with a leading 0 (zero) and your template will appear at the top of the list later on. The entries in the dropdown list are sorted alphabetically based on the filenames.
- Step 6: Open the file with a text editor. You may need to open the editor as an administrator user to be write-enabled.
- Step 7: Choose a name for your report template and write it into the HTML comment in the first line of the source code. The format is "category: name". Category (with grey background) and name will appear in the template selection dropdown in the PRTG web interface later on. Save the HTM file.
- Step 8: In the source code of the duplicated file, search for the code snippet with the <#report> tag, for example
#report type="list" name="details\Graph plus 30day graph and Table.htm
- Step 9: In this include call, change the filename of the HTM file that is called. For example, append _custom to the filename call. The changed line will look like this:
#report type="list" name="details\Graph plus 30day graph and Table_custom.htm
- Step 10: Go to the \webroot\reporttemplates\details subfolder of your PRTG installation.
- Step 11: Find the HTM file that is called in the source code of the main report template file (see Step 8).
- Step 12: Duplicate this HTM file and save it with the custom name you used in Step 9. For example, append _custom to the filename. Make sure the resulting file name matches the one you used in Step 9.
- Step 13: In the source code of the duplicated file, search for the code snippets
- Step 14: In the source code, replace the names of the HTM files with the ones you used in Step 2, for example
includes\printfooter_custom.htmThis will include the changed header/footer files in your report template.
- Step 15: Save the HTM file.
- Step 16: In PRTG, create a report using your new template and check the result of your modifications.
- How do I modify PRTG report templates?
- How can I change the header image in reports?
- How can I adjust the order of report elements?
- How can I change the size of graphs in reports?
- How can I change the number of sensors in reports?
- How can I delete page breaks in reports?
- Can I change the number of PDFs created by a report?
- How can I remove components from reports?