Skip to content

Adding a new ReportComponent

DavidLandes edited this page Jan 12, 2022 · 6 revisions

Before you start...

  • A ReportComponent should be an element of a report that can be converted directly into HTML.
  • ReportComponent.ToHtml() should generate ALL HTML code for the ReportComponent using Reporting.Tag and the provided Methods.

Steps:

  1. Make sure the new class inherits ReportComponent.
  2. If the new component is a container for other report components, use the inherited ReportComponent._children to store them.
    • This allows the Report class to search its content for Component IDs
  3. Make sure there is a default constructor, with no parameters.
    • If there are properties that need to be set, make sure they have default values and necessary getters/setters
  4. To properly serialize, add [XmlInclude(typeof(MyNewReportComponentClass))] to the top of Report.cs along with the other similar lines of code.

Clone this wiki locally