Hello, when i creat a new Workbook, this problem occured, win7
Hi Lu,
Thanks for your posting and using Aspose.Cells.
Please download and try the latest version: Aspose.Cells
for .NET v7.7.2.1 and see if it resolves your issue.
If your problem still occurs, then please provide us your sample project replicating this issue. We will look into it and update you asap.
why not contains the file “Aspose.Cells.xml” ?
Hi Lu,
Thanks for using Aspose.Cells.
This is a minor release therefore it does not contain Aspose.Cells.xml file. If you want to get this file, then please download and use the major release: Aspose.Cells for .NET 7.7.2 at your end.
Hi Lu,
Thank you for your confirmation on this.
You will find all three files (.dll, .xml & .tlb) in all sub-folders under bin folder if you have installed the Aspose.Cells for .NET API through MSI installer or have downloaded the archive containing only the assemblies from the Aspose download section. TLB file is not provided with hotfix versions such as Aspose.Cells for .NET 7.7.2.1.
Please check bin folder if you have installed the API through MSI installer,
C:\Program Files (x86)\Aspose\Aspose.Cells for .NET\Bin
Thanks a lot.
Hi Lu,
Thank you for writing back.
A type library (.tlb) is a binary file that stores information about a COM or DCOM object’s properties and methods in a form that is accessible to other applications at runtime. Using a type library, an application can determine which interfaces an object supports, and invoke an object’s interface methods. In other words, if you wish to call a .NET assembly from a COM client (like VB6), you need to first register the original component i.e; Aspose.Cells.dll using the RegAsm utility. Then a reference to type library tell the IDE what objects are COM accessible. In your scenario, you will not need the type library file.
All Aspose for .NET assemblies are signed with strong names (SNK). We use SNK to strong name an assembly and that basically ensures that Aspose DLLs can’t be swapped out with another DLL having the same name (the public keys must match in this case). Additionally, authenticode assemblies of Aspose for .NET product assemblies use a PFX. The purpose of signing them with PFX is to ensure that those DLLs haven’t been tampered. If you don’t feel the need for an “Authenticode” assembly then you should just use the ones without Authenticode.
The net2.0 folder contains assemblies to be used with .NET Framework 2.0, 3.0, 3.5, 4.0, 4.5 and Mono. This is the assembly that you should use to target .NET Framework 2.0.
Amazing. Thank you very much.
Hi Lu,
Thank you for writing back.
We will need a sample project from your side in order to properly analyze your recently shared scenario. Please create an archive (ZIP) of the project along with your template file (if any) before attaching it to your post.
Moreover, we have recently published a maintenance release of Aspose.Cells for .NET 7.7.2.2. We would request to your please give a try to the latest build in your development environment, and share the test results here for future reference.
I used version 7.7.2.2, and fault is still there. My code like this:
Hi Lu,
Thank you for providing the test results with latest build of Aspose.Cells for .NET API.
Unfortunately, the provided code snippet isn’t enough to evaluate the performance related issue on our end. The reason for requesting a sample application from your side is that we could replicate the exact scenario covering all routines in your original application to benchmark the performance related parameters.
Anyway, you may also opt to use the Worksheet.AutoFitRows(int startRow, int endRow) method for your requirement. Using the said method will enable you to auto fit a range of rows in a single call, thus making the overall process execute faster than your current approach.
Hi Lu,
Thank you for writing back.
We are working on your recently posted inquiry, and we will shortly respond back with more details in this regard.
Hi Lu,
Thank you for your patience.
Please find the details of all methods as requested,
-
AutoFitRow(int rowIndex); Auto fit a single row whose index is passed.
-
AutoFitRow(int rowIndex, int firstColumn, int lastColumn); This method auto fits a row based on content in a range of cells within the row from start column to end column.
- AutoFitRow(int rowIndex, int firstColumn, int lastColumn, AutoFitterOptions options); This method auto fits a row based on content in a range of cells within the row from start column to end column, in respect to the AutoFitterOptions.
-
AutoFitRow(int startRow, int endRow, int startColumn, int endColumn); Auto fits row height in a rectangle range.
-
AutoFitRows(); Auto fit all rows in the worksheet.
-
AutoFitRows(AutoFitterOptions options); Auto fits all rows in the worksheet based on the AutoFitterOptions.
-
AutoFitRows(bool onlyAuto); Boolean indicates whether only fit the rows having custom height.
-
AutoFitRows(int startRow, int endRow); Auto fit a range of rows in a worksheet.
-
CalculateFormula(string formula); This method calculates a formula that is passed as a string and returns the result in an object. Formula does not have to be stored in the cell of a worksheet for this method.
Regarding the your inquiry about the performance of different AutoFitRow(s) overloads, I have executed some tests on a spreadsheet containing 1000 data rows. Most efficient method is AutoFitRow(int rowIndex) that took almost 980 milliseconds to iterate over 1000 rows to auto fit them. Second most efficient methods proved to be AutoFitRows(int startRow, int endRow) with 1238 milliseconds for same 1000 rows. All of the other overloads are taking much longer time to execute because other parameters are involved too.
Please feel free to write back in case you have further questions or concerns.
My code is very simple, and not all users have this problem.
Hi Lu,
First of all, please accept my sincere apologies for not mentioning that the tests were carried out on core i7 1.73 with Windows 7 Home Premium 64-bit installed, while using the Aspose.Cells for .NET 7.7.2.2 assemblies.
Providing a logging/debug assembly may not be an easy task but we can surely log a request for the development team in this regard. Firstly, we want to make sure that your source code is perfectly optimized and does not have any performance related loop holes. In order to further investigate this matter, we would request you again to please provide a copy of your application or a sample replicating your complete scenario so we could thoroughly study it on our end before suggesting any improvements. Moreover, we may also require the environment details of your server to study the behavior of your application when its deployed and serve real time requests.
If you are concerned about the privacy of your data/source code then I would like to reassure that we need such data/sample/code just to replicate a particular scenario on our end, and we delete the customer provided information/data/sample/source as soon as problem is resolved.
Hi, my brother, this is all my test code and pc info, pls test.
may be, there is somthing wrong with “Style”.
Hi Lu,
Thank you for providing the sample application for our review.
I have evaluated your presented scenario/project on my end, and have noticed that maximum processing time is consumed by the following code snippet where you are iterating over the cells to put the value, applying style and auto fitting rows,
C#
Aspose.Cells.Cell cell = null;
DataRow dr;
for (int i = 0; i < 1500; i++)
{
dr = dt.Rows[i];
for (int j = 0; j < 10; j++)
{
cell = ws.Cells[i, j];
cell.PutValue(dr[j]);
cell.SetStyle(wb.Styles[idx]);
}
ws.AutoFitRow(i);
}
If you replace the above statements with the following code snippet, you will notice better performance with same results (attached).
C#
Please note, if you have the data in a DataTable, simplest and most efficient way is to import it using the statement Cells.ImportDataTable. Moreover, rather than iterating over all the cells to apply the style, you can create a range of all cells having data, and apply the style on each cell of the range with single call as Range.ApplyStyle.
I have attached a few snapshots of my results as well as the modified Form1.cs file (please remove the extension .txt) for your review.