Data markers have multiple switches and options that are available for use in ExcelTemplate workbooks.

The Data Marker Options used in this example are:


public class DataMarkerOptions
        /// <summary>
        /// Build the report with ExcelTemplate
        /// </summary>
        public void GenerateReport()
              // This 2D Object[][] array will hold the values to be imported

              object[,] values = {
                              //employee ID 
                              {1, 2, 3, 4},
                              //Last Name   
                              {"Davolio", "Fuller", "Leverling", "Peacock"},
                              //First Name 
                              {"Nancy", "Andrew", "Janet", "Margaret"},
                              {"Sales Rep", "VP of Sales", "Sales Rep", "Sales Rep"},

            // These are the field names
            string[] colnames = { "EmployeeID", "LastName", "FirstName", "Title", "Zip" };
            // Create an instance of ExcelTemplate
            ExcelTemplate xlt = new ExcelTemplate();
            // Open the template workbook
                        string templatePath = @"..\..\ExcelTemplateFiles\DataMarkerOptionsTemplate.xlsx";

            // Pass colnames and values arrays to BindData()
            DataBindingProperties bindingProperties = xlt.CreateDataBindingProperties();
            bindingProperties.MaxRows = ExcelTemplate.ALL_ROWS;
            bindingProperties.Transpose = true;
            xlt.BindData(values, colnames, "dSource", bindingProperties);
            // Call the process() method to populate the template with the data source values
            // Save the report