Report Builder FastReport .Net User Guide: Display Expressions

FastReport .Net is a full-featured Windows Forms, ASP.NET and MVC report analysis solution. Using FastReport .NET can create .NET reports that are independent of applications. At the same time, FastReport .Net supports 14 languages ​​such as Chinese and English. You can make your products truly international.

FastReport.NET official version download (qun: 585577353) icon-default.png?t=N4P3https://www.evget.com/product/1861/download

In the previous article of the Fastreport user manual, we shared the "Text" object and text editing. This article mainly shares "display expressions", hoping to help you. <FastReport .Net Full Version Chinese Manual>
"Text" object can contain plain text mixed with expressions. For example:

Today is [Date]

When printing such objects, all expressions contained in the text are evaluated. So the result could be something like this:

Today is 12.09.2010

Expressions are identified by square brackets as shown. This is set in the "Brackets" property, which by default contains the string "[,]". When needed, you can use a different set of symbols, such as "<,>" or "<!,!>". In the last case, the expression in the text will look like this:

Today is <!Date!>

Apart from that, all expressions can be disabled. To do this, set the AllowExpressions property to false. In this case the text will be displayed "as is".

Inside the square brackets, you can use any valid expression. Read more about expressions in the "Expressions" article later in the guide. For example, an object with the following text:

2 * 2 = [2 * 2]

will print like this:

2 * 2 = 4

Common Mistake - Trying to write an expression outside the square brackets. As a reminder, it is considered an expression, and only the expression enclosed in square brackets is executed. For example:

2 * 2 = [2] * [2]

This text will be printed this way:

2 * 2 = 2 * 2

There may be some elements in the expression that require their own square brackets. For example, it might be a reference to a system variable. Let's look at the following example:

The next page: [[Page] + 1]

The text contains an expression [Page] + 1 .Page is a system variable that returns the number of the current report page. It is enclosed in its own parentheses. These brackets must be square brackets regardless of the "text" object setting.

Strictly speaking, when using the "Date" system variable in the above example, we should use two square brackets:

Today is [[Date]]

However, FastReport allows to omit a pair of unnecessary parentheses if there is only one member in the expression.

This time about FastReport .Net, the introduction to the display expression is explained here. If you have other questions, welcome to discuss in private chat~

Guess you like

Origin blog.csdn.net/m0_67129275/article/details/131062070