[ReportMagic.SetReportProperty:]
Update a property of the report itself.
Macro Compatibility
The macro can be used in all input document types and in Report Studio.
Usage
This macro can also be used to set sub-folders for the output files. To specify sub-folders with the 'outputSubFolder' option, use that property and set value to the required path. Note that forward slashes must be used for sub-folders, and no leading or trailing slashes should be used. Using the 'StopOn' property enables you to stop a report job if a warning, macro error, or system error is generated. You can use it like this: [ReportMagic.SetReportProperty: property=StopOn, value=StopSystemError]. This stops at the next system error (and similarly stops when using value=StopMacroErrorAndAbove or value=StopWarningAndAbove). When using the 'OutputFileName' property, the value used must not end in a full-stop (.). All Unicode characters are accepted in file and folder names except for these: , \ .. ~ " * : < > ? / |
Parameter | Type | Presence | Purpose | Options | Default |
---|---|---|---|---|---|
SetReportJobProperty | Mandatory | The property to set. In Report Studio (which produces no output files), the only valid properties are: StopOn and UserMessage |
|
N/A | |
String | Mandatory | The value to set for the selected property. For the 'OutputFileTypes' property, you can use multiple items separated by a semi-colon, such as: value=docx;xlsx. Valid values are: docx, pdf, html, xlsx, and pptx. To DISABLE all outputs types (i.e. NO output documents will be produced), you cam set the 'value' parameter to empty / whitespace, e.g. [ReportMagic.SetReportProperty: property=OutputFileTypes, value=]. For the 'StopOn' property, valid values are: 'None', 'NotifyStopSystemError', 'NotifyStopMacroError', 'NotifyStopWarning', 'NotifyWarningAndAbove', 'NotifyMacroErrorAndAbove', 'NotifySystemError', 'StopWarningAndAbove', 'StopMacroErrorAndAbove' and 'StopSystemError'. In Report Studio, the 'NotifyXXX' StopOn values have no effect (in a Schedule, they may cause an email to be sent to a particular user). | N/A | N/A | |
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 | |
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 | |
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 | 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 (5)
Example 1:
[ReportMagic.SetReportProperty: property=OutputFileName, value=preferredFileName]
Example 2:
[ReportMagic.SetReportProperty: property=UserMessage, value="A total of 1500 devices were processed"]
Example 3:
This example places the output into a sub-folder, inside the Schedule's output folder. Note that if you also have the 'Use monthly sub-folder' option set, that folder will be created within the structure at the very lowest level.
[ReportMagic.SetReportProperty: property=OutputSubFolder, value="Folder 1/Folder 2"]
Example 4:
This example changes the output file types of the report to docx and pdf. This will override whatever file types are set on the Schedule. For example, suppose the Schedule was set to produce docx, pdf and xlsx files - the macro changes that (for this report job ONLY, not the Schedule) so that only a pdf file is created.
[ReportMagic.SetReportProperty: property=OutputFileTypes, value=pdf]
Example 5:
This example causes no output files at all to be produced (which might be useful if specific conditions were met in your report macros):
[ReportMagic.SetReportProperty: property=OutputFileTypes, value=]