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.