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.
Unfortunately, activation email could not send to your email. Please try again.

How to use template marker with collection object?

This article explains how to use template marker with collection object using XlsIO in C#/VB.NET.

How to use template marker with collections?

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 an object contains another object collection as a member, then it can be imported by the template marker by detecting the enumerable content in every phase of the collection.

 

To import data from a collection in a object, you will need to follow the below steps.

Steps to use horizontal argument

  1. Create a workbook template with markers in it. Here, FirmDetails is the marker variable referred to a class object, followed by its properties separated by dot (.).

 

 

The below screenshot shows how the markers are applied in workbook template.

                       

 

  1. Create template marker processor.

 

 

  1. Add a variable name that is equal to the class object specified in step 1.

 

 

  1. Apply markers.

 

 

To know more about template marker with various import options using XlsIO, please refer the documentation.

 

Download Complete Sample

 

The following C#/VB.NET complete code snippet shows how to use template marker with collection object.

 

 

The below screenshot shows the output document generated using template markers.

 

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

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.