The HTML Report Tools library facilitates the creation of HTML reports from PCB-Investigator (PCBI) plugin data or via automated code generation. It provides:
Suitable for Extended Design Report plugin integration or standalone report generation in PCB analysis workflows.
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
\bin
folder.ExampleReport.dll
to the PCB-Investigator (Beta) plugin folder1).For debugging to work properly, the following additional steps must be carried out.
bin\Debug
folder of the project. If the Debug folder doesn't exist simply create it.PCB-Investigator.exe
file located in the bin\Debug
folder of the project.bin\Debug\PlugIn
folder.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.
bin\Debug*
folder of the project. (* or the folder corresponding to your build configuration)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
Used interfaces: IHtmlReport, IHtmlReportNoHtmlExtension
Purpose: The actual report class responsible for displaying the html page.
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.Introduces a new method:
GetHtmlData()
: Replaces GetHtml()
and expects a list of IWindowContentData
objects as a return.Represents all template data that can be defined at the first level within a window.
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.
Standard container consisting of a template and corresponding data. Allows inclusion of custom templates using dotliquid syntax.
An abstract class for template data that allows defining further sub-templates within the template. Enables flexible combination and nesting of templates.
Creates a report window. Can be used to define additional sub-windows in the main window of a report.
Simple container without styling, used to group templates. Custom styling can be applied using a definable CSS class.
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.
Used Classes: ReportCreatorRevised, ReportHelper
Purpose: A class for creating a HTML Report without UI, purely via code
ReportType => Defines which customization file is loaded.
Used interfaces: IPluginReport, New: IPluginReportMultiType
Purpose: A class for integrating an HTML Report into the Extended Design Report (or new: Testcoverage Report)
GetHtmlReport()
HtmlReport
class mentioned earlier.GetHtmlReport()
methodIsReportIncluded()
method
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.
Purpose: Class for global constants.
This class is intended to serve for the clean separation of constant values from the rest of the code.
The following is a list of all the HTML templates currently available in the Html Report Tools Library.
Note: All resource files (.js/.css/.html) must be included as Embedded Resource so that they are present in the .dll.
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.