Blank Columns Inserted In Xlsx

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

Any suggestions? Opening the file in excel, saving, and reopening removes the blank columns; however this is not really a feasible solution for us.

Is there a coded workaround?

Hi,

Sorry for the delay.

<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Please download and try
latest Aspose.Cells v5.2.0 version form the following link:

http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry269917.aspx



If you still find the issue, kindly do create a sample console application (you may zip it) and post it here to reproduce the issue. We will check it soon.

Thank you.

No, it does not resolve the issue.

I've attached a sample project recreating the issue. I probably could have streamlined and simplified the code more, however, I believe this way it better illustrates what is correctly working, and what is not.

The project creates a test.xlsx in the c:\

Here's a brief rundown:

Template file M.xls contains 74 parameterized columns. Max number of columns = 74 (Ctrl+End)

PostProcessTemplate removes all but 10 of the parameterized columns (removes 64 colums)

Expected results in test.xlsx:
10 columns where row 14 is blue
Max number of columns = 14 columns (Ctrl+End)

Actual results:
10 columns where row 14 is blue
Max number of columns = 256 columns (Ctrl+End)

Hope this helps.

Hi,

Thanks for the sample project with template file.

I am able to reproduce the issue using your project after an initial test. I can only find the issue for xlsx format, it works fine for xls though as you mentioned. I have logged your issue into our issue tracking system with an id: CELLSNET-21898. We will figure it out soon.

Thank you.

Hi,

Please try the attached version, we have fixed your issue.

thank you.

It appears to work.

Thanks.

The issues you have found earlier (filed as 21898) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.