Posted 9 December 2020, 9:36 pm EST
Hi there, If we want to output the exact datatable, that may contain duplicate records - how do we do that? it currently removes duplicates.
Test case - two columns, two rows are duplicate values but one is filtered out.
// Fields
var dataTable = new DataTable("Grid1");
dataTable.Columns.Add(new DataColumn("Column1", typeof(string)));
dataTable.Columns.Add(new DataColumn("Column2", typeof(string)));
dataTable.Rows.Add("1", "Bob");
dataTable.Rows.Add("1", "Bob");
dataTable.Rows.Add("2", "Tom");
dataTable.Rows.Add("3", "Jerry");
var ds = new DataSet();
ds.Tables.Add(dataTable);
// Excel
Workbook workbook = new Workbook();
workbook.Open(templateFileLocation);
//Add data source
workbook.AddDataSource("grids", ds);
//Invoke to process the template
workbook.ProcessTemplate();
Thanks,
Damian.