Documents for Excel, Java Edition Documentation
Templates / Template Configuration / Template Fields
In This Topic
    Template Fields
    In This Topic

    A template layout can contain various data bound fields whose data is bound to the datasource. The below image shows different template fields:

    Template fields

    Data Fields

    Data fields are the bound fields which are populated by the data in data source. These fields can be defined in different ways as shown in examples below:

    Function Fields

    Function fields are used to perform calculations in your reports. A function can be applied over a cell or a data field. The standard Excel functions which are supported in the function field are Sum, Count, Average, Max, Min, Product, StdDev, StdDevp, Var and Varp. For example:

    {{=SUM(F4)}}

    {{=SUM(team.score)}}

    {{=Count(student.name)}}

    Note: Function field supports only one parameter

    The function fields can also be calculated over a context. for example, in the below image cell D14 contains function field as well as the context property. The resultant value will be calculated, first by summing up the revenue in cell C14 and then summing up the values of the whole category (as A14 is its context)

    Function fields

    Function fields

    Expression Fields

    Expression fields can be used to perform calculations using operators '+', '-', '*', '/' and '()'. An expression can be applied over cells or data fields. For example:

    {{= ds.count*ds.price}}

    {{= ds.price + ds.tax}}

    {{=A18*0.05}}

    {{=A18+D18-G18}}

    {{=(A18+ A20)*0.3}}

    Note: Template properties are not supported in Expression fields. Function field and Expression field cannot be used together like {{=Sum(A5+A6)}} or {{=Sum(A5)*0.01}}, which  is not supported.

    Sheet Name

    GcExcel supports using bound field in sheet name, which means, the field value of sheet name is populated by the data in data source and multiple worksheets are created. Each worksheet contains data corresponding to its value.

    For example, if we specify {{dt.Region}} as the sheet name and the data source contains data for 5 regions, the final report will consist of 5 worksheets and the individual sheet will contain data for a specific region.  

     Bound field in sheet name

    Note: Only the Sort and Group template properties are supported for sheet name field.