|
EK RTF report components for .Net
|
In a report template all controlling words, variables and data fields must be comprised between symbols "\" (back slash), for instance: \date\ or \Query1:CustNo\
Reference to a field name may be created, using its number. For example: \Query1:(0)\, \Table1:(5)\
Report generator ignores spaces in field names and keywords. However, if you want to use name with spaces, you may write it between the chars "[" and "]" for example \Table1:[Field name with spaces]\
In a report template data tables and queries are identified by alias or by means of chars a-z in that order, in which they were added to ReportData collection. Different data sources may be attached to the report. These are:
• IDataReader
• DataTable
• DataView
• Array of DataRow
• Array of DataRowView
• DataRow
• DataRowView
Code below attaches to the report a customer table with alias "Customers":
C# example:
EkRtf1.ReportData.Add(CustomersTable,"Customers");
Pascal example:
EkRtf1.ReportData.Add(CustomersTable,'Customers');
Along with the data fields different variables may be used for calculations in report. Report variables may be created directly in report template or in code with CreateVar method. Variables may be modified with VarByName method:
C# example:
EkRtf1.CreateVar("CustomerName","Michael");
EkRtf1.VarByName("CustomerName").AsString = "John Smith";
Pascal example:
EkRtf1.CreateVar('CustomerName','Michael');
EkRtf1.VarByName('CustomerName').AsString:='John Smith';
If there is a report variable declared as CustomerName, in the pattern of the report it may be referenced as \CustomerName\. Variables are stored in VarList collection.
There are several types of constants in EK RTF report template. String constants are defined with double quotes, single quotes, or "~" symbols.
For example: \"constant string 1"\, \'constant string 2' \, \~constant string 3~\. Constants are often used as parameters for user defined functions. If you need to place text with a "\" symbol in report template, you also may use a string constant, for example: \"c:\My Documents\"\.
Numeric constants are numbers in decimal or exponential form: \2\, \2.5\, \3E-1\. Decimal separator is a dot in input template, however in output results it appears according with machine regional settings.
Date constants are always written in a form \{yyyy-mm-dd}\, for example \{2007-06-20}\.
Boolean constants are \True\ or \False\. If you have EK RTF component properties TrueValue and FalseValue set for example to "Yes" and "No", in a report results you will see Yes and No instead of True and False.
In addition to operating with database fields and variables, you may create a user defined function, for example \myfunc(a:field1, a:field2)\. See User defined functions for details.
|
Copyright (c) 2007. All rights reserved.
|