Reports for WinForms | ComponentOne
Working with C1PrintDocument / Expressions, Scripts, Tags / Scripting/Expression Language
In This Topic
    Scripting/Expression Language
    In This Topic

    The language used in expressions is determined by the value of the property C1PrintDocument.ScriptingOptions.Language. That property can have one of two possible values:

    If VB is used as the expression language, when the document is generated a separate assembly is built internally for each expression containing a single class derived from ScriptExpressionBase. This class contains the protected properties that can be used in the expression. The expression itself is implemented as a function of that class.

    For example:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim doc As New C1PrintDocument()
    doc.ScriptingOptions.Language = ScriptLanguageEnum.CSharp
    Dim rt As New RenderText("[PageNo == 1 ? ""First"" : ""Not first""]")
    doc.Body.Children.Add(rt)
    

    To write code in C#

    C#
    Copy Code
    C1PrintDocument doc = new C1PrintDocument();
    doc.ScriptingOptions.Language = ScriptLanguageEnum.CSharp;
    RenderText rt = new RenderText("[PageNo == 1 ? \"First\" : \"Not first\"]");
    doc.Body.Children.Add(rt);