Telerik script language provides five intrinsic (or "built-in")
objects. They are the Fields, Parameters, PageNumber, PageCount, and
ReportItem objects.
Fields
The Fields collection represents the set of fields specified
by the report data source plus any additional calculated fields
that you create. After you create a data source for a data item
(Report, Table, Crosstab, List, Chart), the field collection
appears in the Data Explorer toolbox (link).
Example:Fields.ProductID
- returns the value of the field ProductID in the current data
scope instance. If the data source does not contain the
referenced column, error is thrown. If the report has no data
source set, the expression result is null (Nothing)
Note | |
If the data source field name is not a valid name in terms
of programming languages (contains spaces, punctuation marks, etc.)
enclose its name in square brackets, for example =Fields.[My Column];
Because brackets are special characters, you must use a back slash
('\') to escape the bracket, if it is part of a data field name.
For example, a data field named Field[1] would be referenced as
Fields.[Field\[1\]].
|
Another option of accessing the values in the fields
collection is the global function
Fields(fieldName).
Parameters
represents the collection of report parameters, each of
which can be single-value or multi-value. See
Adding
Parameters to Report.
Example: =Parameters.Product.Value
- returns the value of the report parameter with name Product;
=Parameters.Product.Label
- returns
the label of the report parameter with name Product.
Another option for accessing the report parameters' collection
is the global function
Parameters(parameterName).
PageNumber
The current page number that can be used only in page header and footer.
PageCount
The total number of pages in the report that can be used
only in page header and footer.
Note | |
The page numbering behavior in a report contained in a
report book may be controlled through the Report.PageNumberingStyle(link)
property.
|
ReportItem
The current item in which context the expression is evaluated.