This topic describes how to validate all report scripts at one time using the Visual Studio debugger. This feature is not available in Visual Studio Express editions, because they do not provide the “Attach to Process” option.
Report scripts can never be considered entirely safe, and their execution cannot be completely restricted.
In particular, assigning security permissions to report scripts does not restrict them from accessing the .NET framework's static variables and methods.
Consider using binding expressions as the most convenient approach to performing custom calculations over your report's data.
To debug scripts using Visual Studio, do the following.
Add the following lines enclosed in the <system.diagnostics> tags to the <configuration> section of the config file of your application (or the Web.config file of your ASP.NET application).
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.diagnostics> <switches> <add name="AllowDebugXtraReportScripts" value="BreakWhenDebuggerAttached"/> </switches> </system.diagnostics> </configuration>
Next, run your application and attach Visual Studio to this process.
It is possible to set a breakpoint in the script code after it becomes available at Visual Studio runtime, each time the XtraReport.CreateDocument method is called (e.g., when switching to the Preview tab in an End-User Designer).
The temporary files that were created during script debugging are located in the following directory: C:\Users\User_Name\AppData\Local\Temp.