We introduced many new enhancements and changes in the later version of the product. Cell.GetStyle / Cell.SetStyle is one of them. The Cell.SetStyle/GetStyle is more refined approach, rather better for performance grounds in the long run.
Well, I think it might be an issue with your code that you have updated while upgrading to v7.3.x from your older version. Please double check your code and correct it in accordance with latest APIs set. If you still could not evaluate and you find any issue while applying formatting to cells/range/row/column etc., kindly separate the issue and create a console application with latest version, zip it and post it here with template file, we will check your issue and help you out to fix it.
Moreover we recommend you to kindly browse our online Documentation, especially the topics in the section/sub-section:
As i mentioned the only changes that we have made in the code are that - we have used the methods Aspose.Cells.Cell’s GetStyle() and SetStyle() property instead of Style property and nothing else and that too only because the new library doesnt have the property Style but has the seetter and getter methods, i certainly get a feeling that the issue is with the library itself and not in our code.
Still i am working on isolating the issue as required by you and i will upload the console application soon.
Just wanted to confirm that
should i simply upload the zip with the license file,
or should i password protect it,
or should i remove the license files before uploading? Please confirm
We are waiting your application to evaluate your issue properly. We really appreciate your work (as you are creating a console application to reproduce the issue) in this regard.
Also, please exclude your license file in your project, no need to attach your license file with the application.
I have tested your project and I found I think Aspose.Cells new version works the same way as MS Excel does regarding AutoFit Rows operation. For confirmation I have done the Auto-Fit operation in MS Excel manually on your older version’s exported file which will be same as per your new version’s exported file after the operation. In short, it is not an issue with the product.
See the screen shot below.
I think you may try to set the rows heights accordingly (for the first two rows) instead of setting auto-fit rows operation for the first two rows.
so, you have to first get the style of the cell, then update the formatting and then apply the style to the cell (all in three steps) accordingly. Although it adds some extra lines to the code but it would be fruitful to do it as we have eliminated the older Cell.Style property in the new versions and replaced it with Cell.GetStyle()/SetStyle approach which is more efficient and better regarding performance grounds.
This is what i was saying. That is code being the same, just using GetStyle() and SetStyle() instead of Style property affects the styling.
The answer you gave could have been the first answer to this post, and would have saved a lot of my time.
Just to add i found out that GetStyle() and SetStyel() works differently that Style property (for a particular version). But because the Style property is not available in newer version, you have to resort to GetStyle0 and SetStyle().
So in short, the newer version Aspose does break an older code by not using Style property and the substitute GetStyle() doesnt work the same as property,
thus breaking your older code.
Also, i am having some issues in Pdf as well, the only change is that instead of Aspose.Pdf.Pdf class we are now using Aspose.Pdf.Generator.Pdf class.
This is the only change that we have done in our code. Now what about this?
Well, I mentioned about Cell.GetStyle() and Cells.SetStyle() methods which are replaced by Cell.Style property in my first post. Also in your first post you did not post your project so, how could I figure it out for the issue regarding Cells.Style property. Also, in one of your later posts, you gave me the project but your main focus / issue is for Aut-Fit operation, so I sorted it out firstly. In one of your last post, you told me about the issue for some cells in the columns are not formatted properly so I double checked your code and pointed out the error. Anyways, we are happy that your issues are resolved now.
For:
“Also, i am having some issues in Pdf as well, the only change is that instead of Aspose.Pdf.Pdf class we are now using Aspose.Pdf.Generator.Pdfclass.
This is the only change that we have done in our code. Now what about this?”
Please post your query into Aspose.Pdf forums, one the developer (technical support) will help you soon there.
By the way, if you need to directly save the Excel file/workbook to PDF, you may use only Aspose.Cells component and no need to use Aspose.Pdf component for the intermediate conversion for PDF rendering any more now. See the topic for your reference:
We welcome your any further queries. Please feel free to post, if you find any other issue, we will be glad to help you more.
Also, you can download and try the Offline Java Demos of Aspose.Cells for Java.
It contains simple runnable console examples which will help you to get familiar with Aspose.Cells for Java API (s) quickly and you will be able to upgrade your existing code.