ComponentOne Reports for WinForms Designer Edition: ComponentOne Reports for WinForms > Working with C1PrintDocument > Expressions, Scripts, Tags

Expressions, Scripts, Tags

Expressions (or scripts – the two terms are used interchangeably here) can be used in various places throughout the document. Mark an expression by surrounding it by square brackets, as in the following code:

      Visual Basic

Dim doc As New C1PrintDocument()

doc.Body.Children.Add(New RenderText("2 + 2 = [2+2]"))

      C#

C1PrintDocument doc = new C1PrintDocument();

doc.Body.Children.Add(new RenderText("2 + 2 = [2+2]"));

This code will produce the following text in the generated document:

2 + 2 = 4

In this case, the "[2+2]" is interpreted as an expression, and calculated to produce the resulting text.

Note: If the expression parser cannot parse the text included in square brackets, such text is not interpreted as an expression, and is inserted in the document "as is".


Tags

Tags/expressions syntax

Editing Tag Values at Run Time

Scripting/Expression Language

Assemblies and Namespaces

IDs Accessible in Text Expressions

IDs accessible in expressions within Filter, Grouping and Sorting

IDs accessible in expressions used to specify calculated fields in a DataSet


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.