The Knowledge View Macro is a System Macro which enables Custom Export of Knowledge Views. The Macro is executed when a Knowledge View is exported to an image. The selected Knowledge View and exported image will be passed as a parameter to the Macro. You can use this feature to add custom export functionality to the Knowledge Book.

The Knowledge View Macro is created via Macro Manager.

In Macro Manager create a new Macro. This will display the Macro Property Form;



Specify the Name and Type of the Macro. The Type of the Macro must be set to Knowledge View Macro. A System Macro of this type will not lock the database and will have predefined parameters. The Macro can perform any Macro API function but is intended to act on the selected Knowledge View.

The parameters are defined on the Parameters Tab. You will be able to view the parameters but you cannot modify the parameters.

The JScript Expression must be a script which acts on the exported image and the selected Knowledge View. The selected Knowledge View can be obtained from the parameter "KnowledgeViewId" and the exported image from parameter "ImageFile".

The following example will insert the exported image file into a spreadsheet, obtain information from the Assets displayed in the Knowledge View and populate spreadsheet cells.



Press the OK button to save the new Macro.


The Custom Export menu will be available in the Knowledge Book context menu if the project contains at least one Knowledge View Macro. The user may export multiple Knowledge View Folders or Knowledge Views. When a Knowledge View Folder is exported all Knowledge Views contained in the folder will be exported including the Knowledge Views in sub folders.

The Custom Export will display the following dialog.



The user is prompted to specify the Target Folder and the Knowledge View Macro to process each of the exported images. The Custom export function will export an image into the target folder for each of the selected Knowledge View and will execute the selected Macro for each of the exported image files. The Export Knowledge Views dialog will display Macro Messages, it will not display Macro Progress Messages. The Macro can be executed in Verbose Mode if the user has Customization Access Rights. The user may cancel the export in which case the export will first complete image export and macro execution of the Knowledge View it is working on