This article discusses how to make a custom report (not generated by ReportFactory or batch reports) show up in a project's Reports tab.
Use the 'registerReport' ec-perl API call to register the custom report. The properties set on report jobs drive the mechanism behind the Reports tab. There are Perl utility functions in ElectricCommander::ReportUtils that you can call to set these properties on any job. The report artifacts (for example, an HTML file) is expected to reside in the "artifacts" directory of the jobstep workspace.
The code below makes two calls to the 'registerReport' function:
- The first call registers the report using a grouping of type and date - This includes the report in the Reports tab and displays the report when the date is selected.
- The second call uses a grouping of type only - This is used to display the most recently dated report of that type, for example, when the type is selected in the tree index it will display the most recently dated report of that type (Note: In 3.6 only; earlier versions incorrectly display the oldest report).
If you want a different location for the 'artifacts' directory, use this snippet:
- Product versions: all
- OS versions: all