HTML Report Tools

The HTML Report Tools library facilitates the creation of HTML reports from PCB-Investigator (PCBI) plugin data or via automated code generation. It provides:

  • Extensible classes (HtmlReport, ReportCreator, ReportPlugin)
  • Interfaces for report integration (IPluginReport, IPluginReportMultiType)
  • Customizable templates and data containers
  • DotLiquid templating engine support
  • Resource management for embedded js/css/html files

Suitable for Extended Design Report plugin integration or standalone report generation in PCB analysis workflows.

Setup

For a quick start, download the following project with an exemplary class structure, which can be used to create a ready-made example report.

Click on the link to download the project: ExampleHTMLReportProject.zip


1. Plug-in for Extended Design Report

  1. Right-click on the report project and select Properties.
  2. Under Application, set the Output type to Class Library.
  3. Build the project to create the necessary files in the \bin folder.
  4. Copy the compiled ExampleReport.dll to the PCB-Investigator (Beta) plugin folder1).
  5. Open your installed PCB-Investigator Beta. Your report should now appear as an entry in the Extended Design Report and can be combined with other reports as needed.

For debugging to work properly, the following additional steps must be carried out.

  1. Set the Build Configuration to Debug.
  2. Copy the PCB-Investigator (Beta) plugin folder1) into the bin\Debug folder of the project. If the Debug folder doesn't exist simply create it.
  3. Under Debug set the Start action to Start external program. Use Browse to select the PCB-Investigator.exe file located in the bin\Debug folder of the project.
  4. Under Build set the output path to the bin\Debug\PlugIn folder.
  5. Running the project will open a PCB-Investigator instance. Open the Extended Design Report there and the report should appear as an entry.

You can now start porgramming and customize the report to your needs. The starting point for the embedded report is the ReportPlugin class. It implements the IPluginReport interface which provides the methods that are called by the Extended Design Report. This also includes the method that returns the actual HtmlReport class to the Extended Design Report. More information on the individual classes of the Example HTML Report can be found in the next section.

When you are finished programming the report, simply repeat steps 4 and 5 from above. You can also create a post-build process to automate step 4 if you wish.

2. Standalone version

  1. Right-click on the report project and select Properties.
  2. Under Application, set the Output type to Windows Application
  3. Copy the PCB-Investigator (Beta) plugin folder1) into the bin\Debug* folder of the project. (* or the folder corresponding to your build configuration)
  4. Running the project will open a save file dialogue where the location for the report can be specified. Once created, a browser window with your report will automatically open.

You can now start programming and customize the report to your needs. The starting point for the standalone report is the ReportCreator class. More information on the individual classes of the Example HTML Report can be found in the next section.

1) PCB-Investigator (Beta) plugin folder: C:\Program Files (x86)\easylogix\PCB-Investigator-Beta\PlugIn

Getting Started

The following is a rough outline of the report creation process based on an example class division.

 

Html Report

Used interfaces: IHtmlReport, IHtmlReportNoHtmlExtension
Purpose: The actual report class responsible for displaying the html page.

Interfaces
IHtmlReport

Provides the following methods:

  • OrderNum: The order number of the report in the list of reports. Use OrderNums.DefaultFirst or OrderNums.DefaultLast if you don't care about the specific order. Otherwise, use a number to define the specific index of the report.
  • GetHtml()
  • GetCss()
  • GetJs()
  • GetReportData(): Define basic settings like the title of the tab and settings for the main window.
  • TryGetChildReportTitlesByReportId(): Used for help links in report windows when combining multiple reports in one tab. Note: May be deprecated in future versions.
IHtmlReportNoHtmlExtension

Introduces a new method:

  • GetHtmlData(): Replaces GetHtml() and expects a list of IWindowContentData objects as a return.
IWindowContentData

Represents all template data that can be defined at the first level within a window.

 

Window Content Data Types
IDefaultTemplateData

Predefined standard templates from the Report Tools that reference a template file from the default report templates library. Users only need to add their own data.

HtmlData

Standard container consisting of a template and corresponding data. Allows inclusion of custom templates using dotliquid syntax.

HtmlDataContainer

An abstract class for template data that allows defining further sub-templates within the template. Enables flexible combination and nesting of templates.

 

Html Data Container Implementations
ReportWindowData

Creates a report window. Can be used to define additional sub-windows in the main window of a report.

AreaData

Simple container without styling, used to group templates. Custom styling can be applied using a definable CSS class.

GeneralInfoContainerData

Simple container without styling but with a title. The title is separated from the container with a line. Particularly suitable for displaying simple information text.

 

 

Report Creator

Used Classes: ReportCreatorRevised, ReportHelper
Purpose: A class for creating a HTML Report without UI, purely via code

ReportType => Defines which customization file is loaded.

 

Report Plugin

Used interfaces: IPluginReport, New: IPluginReportMultiType
Purpose: A class for integrating an HTML Report into the Extended Design Report (or new: Testcoverage Report)

Interfaces
IPluginReport Interface
  • All PCBI-Plugins implementing this interface can be output using the Extended Design Report.
  • Key method: GetHtmlReport()
    • Returns the HtmlReport class mentioned earlier.
    • Enables combination of multiple reports into a single HTML report via a UI.
    • Individual reports are listed on the page as switchable tabs.
IPluginReportMultiType Interface
  • Used when the report needs to be compatible with other PCBI report generators from PCB-Investigator (e.g. Testcoverage report).
  • Provides:
    • GetHtmlReport() method
    • IsReportIncluded() method
      • Queries whether the report should be included in each report generator.
      • Currently implemented only for the Testcoverage report.

 

Report Data

[optional]

Purpose: Class for intermediate storage and bundling of all relevant report data.

This class should be used to collect all required data. Similar to a DTO, it is helpful, among other things, to keep the constructor of the HtmlReport manageable.

 

ReportConstants

[optional]

Purpose: Class for global constants.

This class is intended to serve for the clean separation of constant values from the rest of the code.

Standard Templates

The following is a list of all the HTML templates currently available in the Html Report Tools Library.

  • Heading
  • Spacer
  • Area
  • VerticalBar
  • Tooltip
  • TooltipIcon
  • Image
  • GeneralInfoContainer

Image preview for General Info Container

  • InfoTable

  • InfoTableMulti

  • TwoRatiosBar

  • ReportSettingsInfoBox

  • ReportSettingsInfoBoxTable

  • ReportSettingsInfoBoxContainer
  • ReportOverviewControl

  • PieChart

  • DataTable

  • InlineDataTable

  • ExtendedTableReport

  • ReportWindow

  • ReportBase

  • DefaultSPA

 

Resources

Note: All resource files (.js/.css/.html) must be included as Embedded Resource so that they are present in the .dll.

Dot Liquid

The Html Report Tools are built on the DotLiquid library. This means that the syntax used to create templates is the liquid syntax. This must be used in order to create your own templates and fill them with data. Below are the links to the documentation, both from DotLiquid[1] and from the original Liquid Library from Shopify[2]. The latter has a more comprehensive list of the usable syntax and appears to match the DotLiquid syntax.