You can use the XtraReport.ScriptLanguage property to specify the language to write scripts in the report. Report Designers support the following script languages:
Visual Basic .NET
JScript .NET (not available in .NET Core applications)
Note that the script language does not depend on the language used to create the report.
Report scripts provide access to the following assemblies:
Core assemblies that all reporting applications reference:
Standard .NET framework assemblies that all reporting applications reference:
Other assemblies that are currently loaded into your application's domain.
You can enable other assemblies in report scripts. List them in the XtraReport.ScriptReferences property at design time or in the XtraReport.ScriptReferencesString property at runtime. You can specify a path to an assembly as an absolute (full) path or a path relative to the directory where an application runs. All the listed assemblies are loaded into the application domain when report scripts are compiled.
If you modify specific classes in the loaded assemblies, these changes are not immediately applied to the Report Designer. You should reopen the Report Designer to reload assemblies. These changes are applied automatically only if you write scripts in the Visual Studio Report Designer and customize an assembly from the same solution.
A report and every report element has an individual set of script events. For instance, the XRChart control has the XRChartScripts.OnBoundDataChanged event that is specific to this control only, while the XRControl.BeforePrint event is declared at the base control's level and is applicable to most report controls. The XRControl.Scripts collection provides access to all events that the selected report control supports.
In Visual Studio at design time, you can switch to the Properties window and expand the Scripts property. Select an event and choose (New) in the drop-down list. This opens the Scripts tab and adds the event handler's template. This template uses the language that the XtraReport.ScriptLanguage property specifies.
The Scripts tab contains all scripts written for all report elements. You can choose a report element from the drop-down list on the left, and an event from the drop-down list on the right. This adds a new handler if it does not exist yet or navigates to the corresponding event handler if it is already specified.
You can write any code in scripts (declare new classes, variables, methods, etc.) except for the using-like directives.
Click the Validate button to check for errors in report scripts.
The Error List panel lists all found errors.
Click an error in the panel to navigate to the line that contains this error.
The item's Name property value defines the variable name. An exception occurs while the script run if you do not specify the Name property.
If the script code already contains a variable with the same name as a report item, a variable for this item is not generated. This functionality requires the DevExpress.CodeParser.v19.2.dll assembly. If this assembly is not added to the project's reference list, a compilation error is raised.
Cuts the using-like directives from the script code and adds them to the namespace that contains the temporary class.
Places all the report scripts to the temporary class as methods.
Compiles the resulting class in memory.
Calls this class's methods to execute the corresponding report scripts.