The ForNAV cmdlet (http://www.fornav.com/knowledge-base/powershell-cmdlet/) has been extended to support Diff and Patch of the ForNAV report layout
To support this, the cmdlet has been extended with three new parameters:
- Diff – Path to the destination for the diff json file.
- Patch – Path to a json file containing the diffs that will be applied to the reports.
- Baseline – Path to a .txt file containing the original ForNAV reports to form a basis for the diff.
If the Baseline parameter is not specified, the Diff json file will contain all data items, sections, and controls, including their properties. This can be used to make batch editing of names and captions using a text editor and, if the cmdlet is run with the Patch parameter, the changes will be applied to the ForNAV report layout.
In this example, the “CurrReport_Caption” control has been modified from font size 8 to 10:
“Segoe UI, 8pt, style=Bold”,
“Segoe UI, 10pt, style=Bold”
And the same control is represented like this if no Baseline has been specified:
“@Font”: “Segoe UI, 8pt, style=Bold”,
“@SourceExpr”: “CurrReport.Caption + ‘: ‘ + Header.No”
The name of a control or section is controlled by the @Name property.
Warning: If you instead change the name of the json class (in this example, “CurrReport_Caption”), a new control will be inserted when the json is used for a patch and, if @Name is not specified, the control will be nameless.
Currently there is no validation of the ForNAV report layout after a patch has been issued, which might lead to an unexpected runtime error. In order to validate the report, you must open the report in the Designer and save it back again.
You can find information about the format here: https://github.com/benjamine/jsondiffpatch/blob/master/docs/deltas.md
Diff and Patch is supported in build 126.96.36.1995 and later.