Hi,
We're using a licensed copy of Aspose.Cells 5.0.0.0 and we're having a problem with the xlsx files that are being created. The data is being filled correctly, however, there many, many blank columns being inserted (up to Column IV ). We've tried 5.1.4.0 and see that the issue is the same. Perhaps we're doing something wrong.
Here's how we do things. We start with an xls template file with hundreds of parameterized columns. When we run a report we load the template file, edit it by deleting cells, deleting blank columns, and saving it to a an xls array of bytes. Then we use this template byte array and use it in WorkbookDesigne to create xls and xlsx files. This is where the following code begins: xls works correctly. xlsx does not.
MemoryStream ms = new MemoryStream();
ms.Write( excelFileData, 0, excelFileData.Length );
Aspose.Cells.WorkbookDesigner designer = new Aspose.Cells.WorkbookDesigner();
designer.Workbook.Open( ms );
ms.Close();
ms.Dispose();
ms = null;
designer.SetDataSource( dataSetData );
if ( variableNames != null && variableValues != null && variableNames.Length == variableValues.Length )
for ( int iInd = 0; iInd < variableNames.Length; iInd++ )
{
string variableName = variableNames[iInd];
string variableValue = variableValues[iInd];
designer.SetDataSource( variableName, variableValue );
}
designer.Process();
//Even adding the following two lines does not resolve the issue with xlsx files.
foreach ( Aspose.Cells.Worksheet ws in designer.Workbook.Worksheets )
ws.Cells.DeleteBlankColumns();
MemoryStream mw = new MemoryStream();
designer.Workbook.Save( mw, fftFormatType );
Saving to xls works as expected, however, when saving to xlsx we end up with 255 columns in the resultng report. Is there a simple workaround for this issue?
Note: Although the calls above are for 5.0.0.0 and some of them have been deprecated in 5.1.4.0, substituting with the up-to-date calls has not resolved the issue.
I've attached an xlsx report created by Aspose.cells 5.1.4.0 that illustrates the issue hoping that it will help in understanding why there are some many blank columns.
Thanks