I have created a spreadsheet using Open XML SDK in C#, and successfully populated two worksheets.
When trying to populate a third, I get an "Unreadable content" error when opening the completed document, and it appears to occur when I attempt to populate more than 25 cells in a row on the third.
I'm using the same code fragment as has worked successfully elsewhere in the document:
string[] headers2 = {
"Reference", "Raised", "Priority", "Affected", "Linked incidents",
"Points", "SLA", "Stopped", "Target" };
// remaining headers are month/years created on the fly
string[] headerCells = {
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"AA", "AB", "AC", "AD", "AE", "AF", "AG", "AH" };
...
// headers
// once we've finished the presets, the month/year pairs take over
cellNo = (uint)0;
foreach (string h in headers2)
{
cell = InsertCellInWorksheet(headerCells[cellNo++], 2, worksheetPart);
cell.CellValue = new CellValue(h);
cell.DataType = new EnumValue<CellValues>(CellValues.String);
}
string[] monthYears =
GetData_month_years(currentReportingPeriod - 1);
for (int j = 0; j < monthYears.Count(); j++)
{
cell = InsertCellInWorksheet(headerCells[cellNo++], 2, worksheetPart);
cell.CellValue = new CellValue(monthYears[j].ToString());
cell.DataType = new EnumValue<CellValues>(CellValues.String);
}
The only cells populated are A and AA through AH.
Am I right in thinking I'm hitting some sort of limit, and if so, what's the way to reset it?
I've seen several posts about the unreadable content error, and I've looked through the documentation, but I've so far been unable to find anything that applies.
Help would be appreciated!
Thanks