Hi Okieh,
Thank you for using Syncfusion products.
XlsIO doen’t support using static variable in template marker. Whereas, this can be achieved by using “copy range” argument in the template, which will copy a value and show it for number of records it contains. To achieve this in template excel file need to allot a column for the variable we like to repeat for each and every record. Add the argument “copyrange:RC[]” in the previous column of the static value column. Before applying marker need to set the static value in the starting position of the cell, which copy range refers. We have attached the screen shot of the template file, code snippet and simple sample for your reference.
Screen shot of template file:
In column 4 we are going to add the value that should repeat for every record and in the previous column (3rd column) while declaring the property we have added the argument copyrange and refer the range.
Code snippet:
ITemplateMarkersProcessor marker = workbook.CreateTemplateMarkersProcessor();
if (this._customers.Count == 0)
{
this._customers = GetCustomerAsObjects();
}
marker.AddVariable("Customers", _customers);
worksheet.Range["D2"].Value = Customer.Value;
marker.ApplyMarkers();
Sample: https://www.syncfusion.com/downloads/support/forum/119381/ze/Sample-2100172871
UG Link: https://help.syncfusion.com/windowsforms/overview
Please lets us know if you need any clarification.
Regards,
Vikas