We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to implement nested template marker in XlsIO?

This article explains how to implement nested template marker using C#/VB.NET in XlsIO.

What is a nested template marker?

A template marker is a special marker symbol created in an Excel template that appends multiple records from a data source into a worksheet. This marker automatically maps the column name in the data source and names of the marker fields in the template Excel document and fills the data.

When a data source contains another data source as a member, it is considered as a nested data. This nested data can be imported by template marker in XlsIO by mapping the two data sources into a single data source or object.

To implement nested template marker, you need to follow the below steps.

Steps to implement nested template marker:

1. The template marker in the Excel file needs to be given according to the newly mapped object.

  Syntax

    %<MappedObject>.Property

The below screenshot shows the template markers in the input file.

2. Create a template marker processor for the workbook.    

 

3. Add template marker variable using AddVariable(string strName, object variable) method. Here, “list” is the data to be imported and “Result” is the reference to the data.

 

4.Apply the markers.

 

To know more about template marker in XlsIO, please refer the documentation.

 

Download input template

 

Download Complete Sample

 

The following C#/VB.NET complete code snippet shows how to implement nested template marker.

 

 

The below screenshot shows the output of the Excel file generated by the nested template marker in XlsIO.

Article ID: Published Date: Last Revised Date: Platform: Control:
8535 02/28/2018 02/28/2018 WinForms XlsIO
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon