It is often the case that there might be two (or more) versions of a report in O-Calc Pro. For example a summary version and a detailed version, or a text only version and a version that includes images or charts (see http://o-calcpro.com/wiki/2015/12/03/adding-a-custom-chart-to-a-report/ ). Rather than implementing such reports in multiple report definitions you can simply set a singe definition to do it as follows:
Override the property “SubtypesCount” and return the number of ADDITIONAL reports that will be implemented. The report always implements one report so if you wish to implement a total of 4 (for example) you would have this property return 3.
Next we must indicate the name that each report will have by updating the “Name” property (and also the “Description” assuming it does not simply reflect the value of “Name”).
Here we see the value “Subtype” used where O-Calc Pro indicates which report it is asking to be processed.
It is important that each of these values be unique so that the user will know which report is which and will be able to filter them individually.
Finally the implementations of “public override void CreateReport(PPLMain pPPLMain, List pSelectedFiles)” (frequently no change is needed here) and “public override void AddPole(PPLPole pPole, String pPoleName)” need to have similar tests for “Subtype” and conditional logic to produce the correct report added as appropriate.
In this way reports that share portions of their implementation can be contained in a single report definition for ease of implementation and maintenance.