Update a property of the report itself.
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 relative to the current output folder (e.g. of the Schedule). The output folder defaults to the Schedule's output folder, unless you also use the 'OutputFolder' property. To specify folders with either option, use the relevant value in the property parameter and set the required folder path. The 'OutputFolder' property can only be run for Schedules that have been locked by an administrator. Note that forward slashes can be used, and folders that do not exist will be created. 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: [MagicSuite.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: '\', '..', '~', '"', '*', ':', '<', '>', '?' or '|'.
Mandatory (2)
| Parameter | Type | Purpose | Options | Default |
| SetReportJobProperty | The property to set. In Report Studio (which produces no output files), the only valid properties are: StopOn and UserMessage |
|
N/A | |
| String | 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. [MagicSuite.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 |
Behaviour (5)
| Parameter | Type | Presence | Purpose | Options | Default |
| Boolean | Optional | Should NCalc expression evaluation throw error on Overflow |
|
true | |
| 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 theObject, 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 |
Output (2)
| Parameter | Type | Presence | Purpose | Options | Default |
| 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 name of a variable to create should the macro fail to execute. The variable will be a text variable, and will contain either the failure text (only if the failureText parameter is set), otherwise it will contain the exception / failure message. | N/A | N/A |
General (6)
| 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. [MagicSuite.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 | |
| ExecutionResult | Optional | If specified, asserts the expected execution result of the macro. The macro executes normally; if the actual result matches the desired value, the result is converted to Success. If the actual result does not match, the result is converted to MacroError with a descriptive message. This is primarily used for testing and diagnostic purposes. Valid values are: Unknown, Success, MacroError, WorkerStopped, Running, Warning, NeverRun, Cancelled, Pending, Paused, SystemError, Deferred, Stopped. |
|
N/A | |
| String | Optional | If specified, asserts the expected output type of the macro result. The macro executes normally; if the actual type does not match, a macro error is generated. Requires 'storeAs', 'storeAsHidden', or 'storeFormattedValueAs' to be set for typed validation. Valid types include CLR names (e.g. Int32, Int64, Single, Double, Boolean, String, JArray, JObject) and C# keyword aliases (e.g. int, long, float, double, bool, string, uint, ulong, short, ushort, byte, sbyte, decimal, char, object). The special value 'Number' matches any numeric type. | N/A | N/A | |
| String | Optional | If specified, asserts the expected output value of the macro result. The macro executes normally; if the actual value does not match, a macro error is generated. When 'storeAs' or 'storeAsHidden' is set, the stored variable value is compared. Otherwise, the document output text is compared. | N/A | N/A |
Examples (7)
Example 1
[MagicSuite.SetReportProperty: property=OutputFileName, value=preferredFileName]Example 2
[MagicSuite.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 monthly folder will be created within the structure at the very lowest level.
[MagicSuite.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.
[MagicSuite.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):
[MagicSuite.SetReportProperty: property=OutputFileTypes, value=]Example 6
This example sets a custom output folder for the report (it will be created if it does not exist):
[MagicSuite.SetReportProperty: property=OutputFolder, value=Output/Folder 1]Example 7
This example sets a custom output folder for the report, and also sets a custom sub-folder. They can be applied in any order. Note that it's somewhat redundant to use both - but the result should be as expected, with the report stored in the this folder hierarchy: Output/Folder 1/Folder 2/Inner Folder. Note that if you check the 'Use Monthly Sub-Folder' option on the Schedule as well, the final output location will be: Output/Folder 1/Folder 2/Inner Folder/YYYY-MM (where YYYY is the year, and MM is the previous calendar month e.g 2025-10)
[MagicSuite.SetReportProperty: property=OutputFolder, value=Output/Folder 1/Folder 2][MagicSuite.SetReportProperty: property=OutputSubFolder, value=Inner Folder]