[DocumentSection:]
Specifies the start of a document section.
Purpose
Use the [DocumentSection:] / [DocumentEndSection:] macro to define a section of the input document, which can be moved to a predefined bookmark in your Word document.
Bookmarks can be manually created in Word, or you can use the [DocumentBookmark:] macro.
Note that the [DocumentSection:] / [DocumentEndSection:] macro requires that bookmarks do not span a selection of text, in other words they should be inserted at a single character position in the input document.
The macro cannot be nested, i.e. you cannot define a section within a section.
The document section is inserted at the bookmark specified (or saved in a variable) when fully processed, i.e. graphs, and tables etc will be fully rendered and processed first.
The storeAs parameter can be used to reference the section by name, and inserted using the [DocumentInsertSection:] macro.
Macro Compatibility
The macro can be used in all input document types and in Report Studio.
Parameter | Type | Presence | Purpose | Options | Default |
---|---|---|---|---|---|
String | Optional | Add a comment to make your document template more readable. The comment is discarded in the output document. | N/A | N/A | |
Boolean | Optional | Should NCalc expression evaluation throw error on Overflow |
|
true | |
String | Optional | The text to display should the macro fail to execute. Note that a poorly-specified macro (e.g. omitting mandatory parameters) will still result in an error message. | N/A | N/A | |
Boolean | Optional | Whether to hide the section. |
|
false | |
String | Optional | The condition that must be true in order for the macro to be executed/evaluated. Must either evaluate to true or false, for example: "3+5=8" or "contains('abcd', 'z'). | N/A | true | |
MacroMode | Optional | The mode in which variables are stored. In the legacy mode (default for Schedules), the variable created is a string and formatted. In the normal mode (default for Report Studio), the output variable is stored as a strongly-typed object, e.g. an Int32 or a List |
|
Legacy | |
String | Optional | The document's bookmark name that the section will be inserted at. This is not supported in PPTX files. The parameter can be specified in [DocumentSection:] and/or [DocumentEndSection:] macros, with the latter taking priority. | N/A | N/A | |
ObfuscationType | Optional | Obfuscation type. Use obfuscation to write reports where sensitive data is hidden. When used, ReportMagic guarantees that the same input string will map to the same output string for the whole of the report (but the next time the report runs, it will most likely map to a different value). If you use obfuscation, the property in your macro will not show up and instead, you will see a fake item of the obfuscation type chosen. |
|
None | |
String | Optional | What to store the section as. | N/A | N/A | |
String | Optional | If specified, adds a warning message for this macro. This is processed as an NCalc, and the warning message will ALWAYS be present and will be the value of the evaluated NCalc expression. | N/A | N/A |
Examples (1)
Example 1:
In this example, the fully rendered graph within the document section macros will be inserted at the end of the first line and hidden from its original position.
Bookmark 1 is on the next line. [DocumentBookmark: name=Bookmark1] The section starting and ending with underscore lines should be inserted BEFORE this text. [DocumentSection: hidden=true, moveToBookmark=Bookmark1] _______ This text and the following graph will be inserted (when fully processed) at Bookmark 1: [LogicMonitor.Graph: device=test.panoramicdata.com, graphName=CPU Usage, dataSourceName=WinCPU] _______ [DocumentEndSection:] More macros.