Setting ShowHeaderRow = false exhibits incorrect behaviour
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//Instantiate the License class
Aspose.Cells.License license = new Aspose.Cells.License();
//Pass only the name of the license file embedded in the assembly
license.SetLicense("Aspose.Total.lic");
Workbook wb = new Workbook();
wb.Worksheets.Add();
Worksheet ws = wb.Worksheets[0];
ws.Cells[0, 0].PutValue("TITLE"); // Not in table
ws.Cells[1, 0].PutValue("COLHEADER"); // header Row
ws.Cells[2, 0].PutValue("ROW1");
ws.Cells[3, 0].PutValue("ROW1");
int index = ws.ListObjects.Add(1, 0, 3, 0, true);
Aspose.Cells.Tables.ListObject tbl = ws.ListObjects[index];
tbl.DisplayName = "TABLE";
tbl.TableStyleType = Aspose.Cells.Tables.TableStyleType.None;
tbl.UpdateColumnName();
tbl.ShowHeaderRow = true;
string file = @"../../AsposeHeaderRowShown.xlsx"; // this is ok
wb.Save(file, Aspose.Cells.SaveFormat.Auto);
ws.Cells[0, 2].PutValue("A1 should not be hidden"); // where has this gone?
ws.Cells[1, 2].PutValue("A2 should be hidden ");
tbl.ShowHeaderRow = false;
file = @"../../AsposeHeaderRowHidden.xlsx";
wb.Save(file, Aspose.Cells.SaveFormat.Auto);
}
}
}