Documents for Excel .NET Edition | GCDocuments
Templates / Template Configuration / Fixed Layout
In This Topic
    Fixed Layout
    In This Topic

    When GcExcel processes a template layout, it inserts blank lines first and then sets the data and style to generate the final report. In cases where a fixed layout is defined in the template, GcExcel provides two properties you can use to properly load the data in this fixed layout area.

    1. fillMode(FM) Property

      The fillMode property can be set to 'overwrite' to set the data directly in template cells (without inserting blank rows). The style of the template layout is retained and data is filled into it.

      The below template example records the E-Commerce sales of electronic goods in different areas of a country and uses 'overwrite' fillMode property. You can also download the Excel template layout from here.

      Excel template layout displaying fillmode property in template cell

      The data in data source contains 8 rows. After GcExcel processes the template layout, the Excel report will look like below:

       

      Excel report output displaying result of using fillmode property in template cell

      Note: If fillMode property is not defined in the template layout, the default behavior is followed, which is to insert the blank lines first.

    2. fillRange(FR) Property

      The fillRange property should be used when fillMode is set to overwrite and the data in data source exceeds the area of fixed layout in template. So if the data overflows, the range defined by fillRange property is duplicated to fill additional data.

      For example: If the data in data source contains 20 rows and fillRange property defines the cell range as A1:A8. The range will be duplicated to 8 more rows (total 16 rows) and then again to 8 more rows (total 24 rows), to fill the complete data of 20 rows.

      Note: When data in data source overflows and fillRange property is missing, range will not be duplicated to set data. Instead, data will be filled beneath the range area in existing rows.

       

      The below template example records the E-Commerce sales of electronic goods in different areas of a country. It uses 'overwrite' fillMode property along with fillRange property to accommodate the additional data. You can also download the Excel template layout from here.

       

      Excel template layout displaying fillmode and fillrange property in template cell

             

      The data in data source contains 26 rows. The fillRange property defines cell range for 12 rows and it is duplicated after that twice to fill all the data. After GcExcel processes the template layout, the Excel report will look like below:

      Excel report output displaying result of using fillmode and fillrange property in template cell