Data fields play an important role in reports. The use of data fields in stimusoft reports is concise and easy to understand, and it also has significant advantages in report tools.
The value of the data source can be used in the expression. To reference a field from a data source, you must provide a string representation of the field. The syntax for referencing is simple-the data source name is given in braces, and the field names are separated by decimal points or periods, as shown below:
{Datasource. column}
For example, if there is a customer table entry under the field name "The Big company", you need to enter the following expression:
Company Name: {customers. companyName}
After calculation, the report displays:
Company Name: The big company
Note: To avoid manual creation of such expressions, you can drag them directly from the data dictionary to a report page or automatically insert necessary information and correct syntax in the expression editor.
Parent-child relationship:
If the data source has a parent relationship with other data sources, you can directly reference fields from the parent data source. The reference syntax is similar to the preceding example-in braces, the data source name and Link name are given, and then the field name is given. Each field is separated by a decimal point or a full period, as shown below:
{Datasource. relation. Field}
Suppose you have such a set of information:
Products is the name of a data source;
Parentcategories indicates the name of the relationship between the two data sources.
Products is a product list, and categories is a list of these products.
Categoryname is a column name in the categories data source.
Enter the following representation:
{Orderdetails. parentproducts. parentcategories. categoryname}
Use the relationship and bypass the orderdetails data source to obtain categories data. After calculation, the result displayed in the report is a product class name, but the value of the category name segment has been obtained. No direct callback is made to the categories data source.
Note: If the report language is C #, it must be case sensitive. If the report language is VB. NET, the name is case insensitive.
Remember that all values in the data source are typed. This means that all data items are the types specified in the option column that dynamically converts to help improve the report speed. However, if you need to retrieve data from columns without conversion, You need to specify the data source directly. For example, in C:
{Products ["productname"]}
This expression can return data from the products data source without conversion. The following example shows the same expression for VB. NET:
{Products. Item ("productname ")}
From http://www.baobiaokong.com/doc/3791