Scripts are abstract declarator of .Net type connected to the document template. This type is called “DocumentScripts”.
Some particular methods of the DocumentScript type are called during report generation. Most events in the generation process result in call of certain methods; logic of these methods is defined in scripts.
To make it simpler to understand, we can consider scripts as a set of event handlers initialized during generation of a report or separate object, data processing; scripts are used also for declaring secondary logic, for example, for handling mouse click on the Windows Forms.
Main designation of scripts is provision of data necessary for report generation, making decisions based on this data, managing rendering process.
Methods of the DocumentScripts class have access to:
- Data from document template data source;
- Object model of the document template (document, pages, objects);
- Document rendering engine (special object representing rendering process with properties stating current rendering status and methods influencing the further rendering process);
- All public data and methods of the application and assemblies the application refers to.
Scripts allow flexible management of report building. It is a .NET code that can use all .NET features, standard and third party libraries.
You can use C#, Visual Basic.Net or any other language supporting .Net environment as a script language.
Note: All scripts are saved as source code, that is why corresponding compiler should be installed on the client computer where report generation will be executed. C#, Visual Basic. NET and Jscript.NET compilers are included in the Microsoft .NET Framework.