Aspose.Cells.CellException:Index was outside the bounds of array

Hi,

I am currently using 7.2.2.1 version.

I have two problem.

One of them is about Aspose.Cells.CellException.I attached sample file for u (PI-AS-PB3-010_2)

When I use workbook.Save method I am giving Aspose.Cells.CellExceptionAspose.Cells.CellException and Excel says that file has unreadable content.(I am using pageSetup.PrintArea property.Maybe it can help u to understand problem).

The other one is,after converting my excel file to pdf,Pdf document has black areas.I attached sample file for u(WI-AA-001).

Could you please check them

Hi,


Thanks for the files.

I am using the latest fix/version: Aspose.Cells for .NET v7.2.2.3

2) I can notice the issue by converting your file to PDF. The output file has strange black areas.

Sample code:

String filePath = “e:\test2\WI-AA-001.xls”;
Workbook workbook = new Workbook(filePath);
workbook.Save(“e:\test2\out.pdf”);
I have logged a ticket with an id: CELLSNET-40802. We will look into it soon.

1) I could not find the issue, I just opened your first template file and re-saved it. May be I need your code to reproduce the issue. Please try our latest fix v7.2.2.3, if you still find the issue, kindly paste your complete code here, we will check it soon.

Thank you.

Ok my codes are here,

Workbook workbook = new Workbook();
workbook.Open(su.MapPath("../../QDMSFiles/TEMPFOL/") + test.xlsx);
foreach (Worksheet sheet in workbook.Worksheets)
{
int maxCol = sheet.Cells.MaxDisplayRange.ColumnCount - 1;
int maxRow = sheet.Cells.MaxDisplayRange.RowCount - 1;
if (maxCol > 0 && maxRow > 0)
{
Aspose.Cells.PageSetup pageSetup = sheet.PageSetup;
pageSetup.PrintArea = "A1:" + CellsHelper.CellIndexToName(maxRow, maxCol);
}

}
workbook.Settings.DisplayDrawingObjects = Aspose.Cells.DisplayDrawingObjects.DisplayShapes;
Aspose.Cells.PdfSaveOptions opts = new Aspose.Cells.PdfSaveOptions();
opts.OnePagePerSheet = true;
workbook.Save(su.MapPath("../../QDMSFiles/TEMPFOL/") + "test.pdf", opts);

Hi,

Thanks for sharing the code.

It looks Aspose.Cells has issues for your template file to simply render to PDF. I got the error when trying to convert your template file "PI-AS-PB3-010_2.xlsx" to PDF.

Sample code:

Workbook workbook = new Workbook("e:\\test2\\PI-AS-PB3-010_2.xlsx");

foreach (Worksheet sheet in workbook.Worksheets)
{
int maxCol = sheet.Cells.MaxDisplayRange.ColumnCount - 1;
int maxRow = sheet.Cells.MaxDisplayRange.RowCount - 1;


if (maxCol > 0 && maxRow > 0)
{
Aspose.Cells.PageSetup pageSetup = sheet.PageSetup;
pageSetup.PrintArea = "A1:" + CellsHelper.CellIndexToName(maxRow, maxCol);
}

}
workbook.Settings.DisplayDrawingObjects = Aspose.Cells.DisplayDrawingObjects.DisplayShapes;


//These are the culprit lines of code.
Aspose.Cells.PdfSaveOptions opts = new Aspose.Cells.PdfSaveOptions();
opts.OnePagePerSheet = true;
workbook.Save("e:\\test2\\PI-AS-PB3-010_2.pdf", opts); //Error

I have logged a ticket with an id: CELLSNET-40804. We will look into it.



Thank you.

Hi,My problem 40804 seems as resolved.Do you have any improvement about this problem.

Hi,

We have fixed the mentioned issue but will release a fix soon either today or in next 1~2 working days after some additional testing.

Hi,

Please download and try the latest fix: Aspose.Cells for .NET v7.2.2.5 and let us know your feedback.

Do you have any improvement about CELLSNET-40802.

Hi,

I am afraid your issue "CELLSNET-40802" is still unresolved.
I have just test using our latest version/fix v7.3.0.2: Aspose.Cells for .NET v7.3.0.2

I can still see the problem, so your issue is not fixed yet. I have asked the relevant developer to update or provide an eta for it. Once we have any update on it, we will let you know here immediately.


Thank you.

Hi,

Thanks for using Aspose.Cells.

Please download and try this fix: Aspose.Cells for .NET v7.3.0.3

There is a special formula in the worksheet[0] of “PI-AS-PB3-010_2.xlsx”

Please use following code to solve issue:

C#


workbook.CalculateFormula();

workbook.Worksheets[0].Shapes.UpdateSelectedValue();