Reports for WinForms | ComponentOne
Working with C1PrintDocument / Expressions, Scripts, Tags / Assemblies and Namespaces
In This Topic
    Assemblies and Namespaces
    In This Topic

    By default, the following assemblies are available (referenced) for scripts:

    To add another (system or custom) assembly to the list of assemblies referenced in scripts, add it to the C1PrintDocument.ScriptingOptions.ExternalAssemblies collection on the document. For instance, the following will add a reference to the System.Data assembly to the document's scripts:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim doc As New C1PrintDocument()
    doc.ScriptingOptions.ExternalAssemblies.Add("System.Data.dll")
    

    To write code in C#

    C#
    Copy Code
    C1PrintDocument doc = new C1PrintDocument();
    doc.ScriptingOptions.ExternalAssemblies.Add("System.Data.dll");
    

    The following namespaces are by default available (imported) for use in scripts:

    To add another namespace, add it to the C1PrintDocument.ScriptingOptions.Namespaces collection on the document. For instance, this will allow the use of types declared in System.Data namespace in the document's scripts without fully qualifying them with the namespace:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim doc As New C1PrintDocument()
    doc.ScriptingOptions. Namespaces.Add("System.Data")
    

    To write code in C#

    C#
    Copy Code
    C1PrintDocument doc = new C1PrintDocument();
    doc.ScriptingOptions. Namespaces.Add("System.Data");