Free Support Forum - aspose.com

Aspose DLL 4.2.0.0 Out of Memory Exception

Hi,

We are using Aspose dll Version 4.2.0.0, to generate excel report. Recently we started getting “Memory out of exception”
when we have around 100,000 rows with around 100 coulumns.
I understood that you have stopped supporting this version DLL and new DLL is released by going through your forum.
But we would like to know the maximum capacity of this DLL so that we can alter the coloumn and row numbers based on the capacity.

We don't have any problem to purchase new version but got to know that new DLL version has different methods
and expects different parameters but We are not in a position to change complete program to use your new DLL,
is there any chance of having another version DLL with same methods as in 4.2 where we can generate more coloumns and rows in EXCEL.

Hi,

Please try the new version of the DLL in evaluation mode. If it fulfills your requirement, then you can consider purchasing it. In evaluation mode, you will have a complete functionality except there will be extra evaluation sheet.

Please download: Aspose.Cells
for .NET v6.0.0.3

Hi,

Thanks for the reply.

Could you please address my main question? I just wanted to know the capacity information of 4.2.0.0 version?

Hi,

I have forwarded your question to development team. But I guess the capacity of the dll equals to the capacity of .NET framework thread, which is 4GB for 32 bit processor and 16-192 GB for 64 bit processors.

Anyway, for correct information, please wait. We will update you asap.

Hi,

In the old version, if you save the workbook as xls file, Aspose.Cell needs memory is about 10 * size of the file.

Hi,


Well, in the older version e.g v4.2.x, if you save the workbook as XLS file, Aspose.Cell would need more memory i.e.., about 10 * size of the file (10 times the size of the file). So, you are getting this exception. We recommend you to use our latest versions of the product in which we made tremendous enhancements regarding memory management and performance matters.


Thank you.

Thanks for the reply.

Is there a way to fix the out of memory issue we are getting from 4.2.x DLL, rather than purchasing a new DLL?

As I mentioned earlier, we don’t want to re-write our existing application to incorporate new methods added in new version DLL.

By any chance you got any other version DLL similar to 4.2.x which addresses this memory issues?

Hi,

I am afraid, it is against our policy to enhance/fix older version. You need to purchase newer version and upgrade your application if needed.

Once again thanks for the reply.

We understood that the version 4.2.X cannot meet our requirement any more. So before changing our application, we would like to get some more information regarding the new version.

1. Our current application is running on 32bit OS with 3Gbytes RAM, so do you think we need to add more RAM if we have to handle the memory issue with latest DLL?

2. We are getting memory exception when the Excel file size we are gerating is reaching around 75 MB So we would like to know the maximum EXCEL file size we will be able to generate with new DLL?

4. Current EXCEL report has got around 106 columns and more than 100,000 rows, is there any limitation for the number of columns and rows we will be able to generate usig the new DLL.

It would be fine if you can give the answers for the above questions individually…

Thank you very much for the help and support.


Hi,


1) Well, it actually depends. The bigger you create the Excel file, the more memory you may require.
2) There is no restriction regarding size of the file while generating Excel files via Aspose.Cells. You can generate huge sized files but then again, you might require more memory when you generate huge sized files.
3) No restriction. It works as MS Excel (2007/2010). You can have a sheet with max rows/columns that MS Excel (2007/2010) allows.

Thank you.

Hi,

As part of purchaing the new dll, we are trying to find out how big will be our code change. We just added your dll and try to build our applicaiton. We have recieved so many build erros but most of the erors are related to Styles.

The below is the current code

sheet.Cells[0, 1].Style.HorizontalAlignment = TextAlignmentType.Left;

After adding the new dll below error is appearing so can you please guide us how to fix this to achieve the same result.

Error ‘Aspose.Cells.Cell’ does not contain a definition for ‘Style’ and no extension method ‘Style’ accepting a first argument of type ‘Aspose.Cells.Cell’ could be found (are you missing a using directive or an assembly reference?)

We cannot find STYLE property in new DLL, which we have used everywhere n our code to apply styles on the EXCEL report.

Hi,

Now, you need to use Cell.GetStyle() and Cell.SetStyle() methods to set the style of some cell.

For your quick help, I have written a code that places a text inside cell A1, then it makes the center align both horizontally and vertically.

Please see the code below and also see the screenshot and output file generated by the code.

C#


Workbook workbook = new Workbook();


Worksheet sheet = workbook.Worksheets[0];


Cell cellA1 = sheet.Cells[“A1”];


cellA1.PutValue(“Sample Text”);


//Center align the text horizontally and vertically

//whenever you change style, you will have to use

//cell.GetStyle() and cell.SetStyle() methods

Style style = cellA1.GetStyle();

style.HorizontalAlignment = TextAlignmentType.Center;

style.VerticalAlignment = TextAlignmentType.Center;

cellA1.SetStyle(style);



sheet.Cells.SetColumnWidth(0, 100);

sheet.Cells.SetRowHeight(0, 100);


workbook.Save(@“F:\Shak-Data-RW\Downloads\output.xlsx”, SaveFormat.Xlsx);

Screenshot:

Hi,


And, for your complete reference, I think
firstly you should check the release notes for different official versions of
Aspose.Cells for .NET (especially v5.0.0 and 5.1.0 etc.).

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

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

Note: Check the description under "Notable Changes for Existing Users" for API changes.

For Workbook.Open and Workbook.Save methods warning messages, please see the documents for your reference:

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/opening-files.html

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/saving-files.html

Moreover, please check the documentation of the product for complete details:

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/programmers-guide.html

Let me come towards your significant errors that you may encounter, so you can fix them accordingly:

1) You need to import the relevant namesapaces to your demo pages or use fully qualified naming when declaring objects for classes etc.:

e.g

using System;

using System.Web;

using Aspose.Cells;

using Aspose.Cells.Pivot;

etc.

2) As I said above, some classes are renamed. e.g

i) Validations --> ValidationCollection

ii) PivotTable --> PivotTableCollection

etc.

3) Aspose.Cells.Style property is eliminated/obsoleted now, you should adjust your code to use Aspose.Cells.GetStyle() and Aspose.Cells.SetStyle() methods, it will also enhance the performance to certain extent:

e.g

Your sample code using Style attribute should be updated accordingly, e.g

Style style = wsNdaa.Cells[0, 0].GetStyle();

style.Font.IsBold = true;

wsNdaa.Cells[0, 0].SetStyle(style);

Styyle style2 = cells["I1"].GetStyle();

style2.HorizontalAlignment = TextAlignmentType.Center;

style2.BackgroundColor = System.Drawing.Color.Navy;

style2.Font.IsBold = true;

cells["I1"].SetStyle(style2);

For complete reference about Cell.GetStyle/SetStyle approach, please see the documents in the section:

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/working-with-data-formatting.html

4) Please check Aspose.Cells for .NET API Reference:

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells-for-.net-api-reference1.html

Thank you very much for the useful code snippet…and prompt reply.