Use of data fields

Values from data sources can be used in expressions. To reference a field from your data source, you need to provide a string representation of the field. The reference syntax is simple. Separate the data source name and field name with a decimal point or period character and enclose them in braces.

{DataSource.Column}

For example, if you have an entry in the customers table with the company name field set to "TheBig Company" and enter the following expression:

Company Name: {Customers.CompanyName}

After the calculation, the result displayed in the report is as follows.

Company name: Large company

 note: Drag and drop directly from the data dictionary onto the page of the report, or use drag and drop within the formula editor to automatically fill in the required information with the correct syntax so that you don't have to manually create this kind of formula. can be inserted as desired.

parental relationship

If your data source is parented to other data sources, you can reference fields directly from the parent data source. The reference syntax is similar to the example shown earlier. Specify the data source name, relation name, and field name separated by a decimal point or a period, and enclose them in square brackets. braces. for example:

{Datasource.Relation.Field}

Suppose you have a set of information like this:

Products is the name of the data source.

ParentCategories is the name of the relationship in which the two data sources are related. In this case, two data sources are involved.

Products are,A list of products and a list of categories for these products.

CategoryName is the column name of the Categories datasource.

If you enter the following expression:

{Products.ParentCategories.CategoryName}

After calculation, the result displayed in the report will be the name of the product's category.

There is no limit to the number of relationships that can be used in Stimulsoft reports. A column can therefore be called through two or three or more relationships. For example, assume you have the following set of information:

Order Detailsis the name of the data source.

Parent Productsis the name of the relationship between the OrdersDetails and Products datasources.

Parent Categories . The name of the relationship between the product and category data sources.

Category Nameis a field from the Categories data source.

If you enter the following expression:

{OrderDetails.ParentProducts.ParentCategories.CategoryName}

However, the value of the CategoryName field is retrieved using a relationship to bypass the OrderDetails data source and reach the Categories data source. Direct calls to the Categories data source are not used

 important: Names are case sensitive if the report language is C#. Names are case insensitive if the report language is VB.Net. .

You have to remember that all the values in your data source are populated. You have to remember that all values in this data source are typed. This means that all data items are dynamically converted to the type specified in the Options column, speeding up report development. However, if you need to retrieve data from a column without conversion, you should specify the data source directly.

For example in C#:

{Products[“ProductName”]}

This formula returns the data "as is" from the Products data source without any transformation. The example below shows the same expression in VB.Net.

{Products.Item("ProductName")}