How do I modify PRTG's report templates?

Votes:

2

Your Vote:

Up

Down

I want to change the following aspects of a report:

  • Header image
  • Contents of header / footer
  • Order of report elements
  • Graph sizes

How can I do this?

how-to modify-templates prtg reporting template

Created on Feb 2, 2010 2:17:32 PM by  Roland Grau [Paessler Support] (343) 3 2

Last change on Mar 15, 2010 4:00:18 PM by  Daniel Zobel [Paessler Support] (21,383) 3 3



1 Reply

Accepted Answer

Votes:

2

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 7, 8, and 9

PRTG Network Monitor includes a powerful reporting engine that allows to generate a variety of reports in order to review your network's data the way you need. Every other day customers ask how they can change the look of the reports.

Important

This Knowledge Base article was written for technical savvy users with good technical knowledge (especially as regards HTML and file templates). We do not encourage modifying the template files that come with PRTG!

The reason is that we cannot supply updates and/or bug-fixes for template files that have been changed by users when we publish new versions of PRTG. Also, editing template files is not covered by our usual support offering due to the complex nature of this process.

Our recommendation is to stick with the report options included in the web interface unless it's unavoidable. Please see the manual section "Reports" to check if you can create your reports with the functionality provided by the web interface.

Not Scared Already?

However, if you still want to change templates, this article cannot go into every detail, but it will give you a brief overview of the possibilities you have, in order to do the following:

  • Change the header image.
  • Change header and footer.
  • Adjust the order of report elements.
  • Change graph sizes.

Make a backup of every file you are going to change!

Use Custom Filenames

Every time a PRTG update is installed all template files are overwritten to provide updates and bug fixes for these files. That is one reason why modifying report templates is not officially supported.

Report templates, images and include files are located in the "website" folder of your PRTG installation directory and spread across several subfolders. Whenever you are performing a PRTG update installation, all original PRTG template files will be overwritten. To avoid losing your changes please create your own report template files with different file names: simply copy the file that you want to start from and use a different name. To keep changed images please write-protect them using Windows Explorer. You should additionally back up all modified files.

Changing the Report Header Image

The file "reportheader.png" in the "website\images" folder is used as the header image for all reports. You can replace this image with your own.

  • Step 1: Go to the "website\images" subfolder of your PRTG installation.
  • Step 2: Rename the existing "reportheader.png" file.
  • Step 3: Create a new header image file. Make sure it is the same pixel size and file format (PNG) as the original image you just renamed.
  • Step 4: Place your new image into this folder and name it "reportheader.png".
  • Step 5: Write-protect your new image. This way, it will be kept even when performing a PRTG update later. However, you will see an error message during future update installations and you must click on "Ignore" to proceed.

Changing Report Template Files

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. In order to modify a report template, changes to the main file, to one of the include files, or both are necessary.

Please note: Good knowledge of HTML is a minimum requirement to make any of the following modifications!

Change Header and Footer

In PRTG's web interface, you can already add "Introduction" and "Footer Comments" to your reports (one text shows up on the first page of the report, the other at the end 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.

  • Step 1: Go to the "website\includes" subfolder of your PRTG installation.
  • Step 2: Duplicate the "reportheader.htm" and/or "reportfooter.htm" file and append "_custom" to the copies' filenames. Make sure the extension remains .HTM.
  • Step 3: In a text editor, change the content of "reportheader_custom.htm" and/or "reportfooter_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 "website\reporttemplates" subfolder of your PRTG installation, locate the main report template file of the report you want to use your customized header and/or footer with. You can identify a template in the source code of the HTM file: The name as it appears in the PRTG web interface is written in the first line (as an HTML comment).
  • 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 drop-down list are sorted alphabetically based on the file names).
  • 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: In the source code, search for the code snippets includes\reportheader.htm and/or includes\reportfooter.htm
  • Step 8: In the code, replace the names of the HTM files with the ones you used in Step 2, e.g. includes\reportheader_custom.htm resp. includes\reportfooter_custom.htm This will include the changed header/footer files in your report template.
  • Step 9: Choose a name for your report template and write it into the HTML comment in the first line f the source code (delete the old name first). The format is "category: name". Category (with grey background) and name will appear in the template selection drop-down under PRTG's web interface later on. Save the HTM file.
  • Step 10: In PRTG, create a report using your new template and check the result of your modifications.

Adjust the Order of Report Elements

You can change the order of elements for a certain report.

  • Step 1: In the "website\reporttemplates" subfolder of your PRTG installation, locate the main report template file of the report you want to change the layout for. You can identify a template in the source code of the HTM file: The name as it appears in the PRTG web interface is written in the first line (as an HTML comment).
  • Step 2: 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 drop-down list are sorted alphabetically based on the file names).
  • Step 3: Open the file with a text editor. You may need to open the editor as an administrator user to be write-enabled.
  • Step 4: For example, the template file may look like this: <!--Graph with Data Table: Graph 15 min interval, Table 15 min interval--> <!--1--> <#lang key="html.reporttemplates.title" default="Report" var="title"> <#include file="includes\reportheader.htm" varexpand="title" title=" | @title"> <#objectproperty name="reportheader"> <#report type="list" name="details\Graph plus 30day graph and Table.htm" graphaverage="900" tableaverage="900"> <#cropmsg> <#objectproperty name="reportfooter"> <#include file="includes\reportfooter.htm">
  • Step 5: Each placeholder (separated by <# and >) adds one HTML element to the report. To change their order, simply change the order of the lines. You can also delete single lines if you do not want a certain element to appear in the report at all. If you dare, you can even try to add lines from other report templates here.
  • Step 6: Choose a name for your report template and write it into the HTML comment in the first line of the source code (delete the old name first). The format is "category: name". Category (with grey background) and name will appear in the template selection drop-down under PRTG's web interface later on. Save the HTM file.
  • Step 7: In PRTG, create a report using your new template and check the result of your modifications.

Change Graph Sizes

Graphs are added to reports as include files. To change the appearance of a graph, you can create a custom graph include file and add a separate main report template file, in which you are using your custom graph file.

  • Step 1: In the "website\reporttemplates" subfolder of your PRTG installation, locate the main report template file of the report you want to change the graphs for. You can identify a template in the source code of the HTM file: The name as it appears in the PRTG web interface is written in the first line (as HTML comment). Please make sure that you actually choose a report which contains a graph.
  • Step 2: 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.
  • Step 3: Open the file with a text editor. You may need to open the editor as an administrator user to be write-enabled.
  • Step 4: Search for a line containing the string #report type="list". For example, you will find the line: <#report type="list" name="details\Graph plus 30day graph and Table.htm" graphaverage="900" tableaverage="900"> This is the place where the graph is included. Remember the HTM file name.
  • Step 5: In this include call change the file name of the HTM file that is called (e.g. append "_custom" to the filename call). For example, the changed line will look like this: <#report type="list" name="details\Graph plus 30day graph and Table_custom.htm" graphaverage="900" tableaverage="900">
  • Step 6: Choose a name for your report template and write it into the HTML comment in the first line of the source code (delete the old name first). The format is "category: name". Category (with grey background) and name will appear in the template selection drop-down under PRTG's web interface later on. Save the HTM file.
  • Step 7: Go to the "website\reporttemplates\details" subfolder of your PRTG installation.
  • Step 8: Find the HTM file which is called in the source code of the main report template file (see Step 4).
  • Step 9: Duplicate this HTM file and save it with the custom name you used in Step 5 (e.g. append "_custom" to the filename). Make sure the resulting file name matches the one you used in Step 5.
  • Step 10: Open the file with a text editor. You may need to open the editor as an administrator user to be write-enabled.
  • Step 11: Search for lines containing the string: #report type="chart". For example, you will find the line: <#report type="chart" graphid="<@subid>" repsensid="<@objectid>" avg="<@graphaverage>" sdate="<@start>" edate="<@end>" width=850 height=630 graphstylefile="graphstyling.htm" animationandinteraction="1" datastylefile="graphdatastyling.htm" animationstylefile="graphanimationstyling.htm" graphstyling="baseFontSize='12'%20showLegend='0'" tooltexts="1" datastyling="drawAnchors='1'%20anchorRadius='1'%20lineThickness='2'" refreshable="true">
  • Step 12: In this code, change the "width" and "height" values (in pixels) as you like and save your changes.
  • Step 13: In PRTG, create a report using the new template you created in Step 6, and check the modified layout.

Further adjustments

Due to the complex nature of the placeholder arrangement in the source files, we cannot go into any detail regarding the use of placeholders in report templates. As mentioned above, we rather recommend using one of the provided templates to assure you can always use the latest report template versions.

See Also

Can I change the number of PDFs created by each report?

Created on Feb 2, 2010 2:46:06 PM by  Roland Grau [Paessler Support] (343) 3 2

Last change on Oct 31, 2011 9:11:58 AM by  Daniel Zobel [Paessler Support] (21,383) 3 3



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.

PRTG
Network Monitor
Intuitive to Use.
Easy to manage.

150.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Visit
www.paessler.com

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

Top Tags


View all Tags