We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excel text auto-fir identifcation

Hi,

Using Aspose.Java for Cells is it possible to check if data present in excel file does that autofit in row or column. If data doesn’t fit how we can make it properly fit to rows and columns.

@poojard

The following two methods will fit your needs.

Cell.getWidthOfValue()
Cell.getHeightOfValue()

Please see the following article that explains how to use them.

Hi Shakeel,

Thanks for your response. I am using aspose.java for cells for excel to html conversion. Sometimes what happen if in my excel file the text doesn’t fit in display once we enlarge the column width we can see the complete text in that particular cell/column we could say. So in excel to HTML conversion data loss is seen there.
What my requirement is I would like to beforehand know if the text is in the display width and can be converted to HTML without any data loss. Or if it doesn’t fit how I can make sure that data in row and column will auto fit

@poojard

Please provide us one sample Excel file. Create your sample Excel file manually using Microsoft Excel and provide its actual Html and desired Html. Please also explore different properties of HtmlSaveOptions class. It might give you desired results.

RP_xls_1.xls.zip (59.8 KB)

Attached the sample excel file. Kindly check sheet with title Sheet1 original and after conversion. Text appearing half cut in few columns and I am loosing my data on conversion.
I have already checked HtmlSaveOptions, but unfortunately it doesn’t provide anything with which I can solve my problem

@poojard

We have created the html using the following code with your Excel file. Please download the html and highlight the issues you are facing in some screenshots. You can collect all of the screenshots in some MS-Word document and provide it to us. We will then log your issues in our database for investigation and for a fix.

Download Link:
output-html.zip (64.6 KB)

Java

Workbook workbook = new Workbook(dirPath + "RP_xls_1.xls");
workbook.save(dirPath + "output.html");

excel_issues.docx.zip (315.4 KB)

Taken two screenshots of issues that I need to fix on priority

@poojard

Thanks for your screenshots and using Aspose APIs.

We were able to observe the issues and logged them in our database for investigation and for a fix. Once, there is some fix or any other news for you, we will let you know asap.

These issues have been logged as

  • CELLSJAVA-42415 - Output Chart is not like Original Chart in Output HTML
  • CELLSJAVA-42417 - Background Color does not match like Excel in Output HTML
  • CELLSJAVA-42418 - Border Color does not match like Excel in Output HTML
  • CELLSJAVA-42419 - Text gets truncated in Output HTML

@poojard,

Please try our latest version/fix: Aspose.Cells for Java v17.9.3

We have fixed the following issues:
CELLSJAVA-42415 - Output Chart is not like Original Chart in Output HTML
CELLSJAVA-42417 - Background Color does not match like Excel in Output HTML
CELLSJAVA-42418 - Border Color does not match like Excel in Output HTML

Let us know your feedback.

@poojard,

This is to inform you that we have also fixed your issue (logged earlier as “CELLSJAVA-42419”). We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

The issues you have found earlier (filed as CELLSJAVA-42415,CELLSJAVA-42417,CELLSJAVA-42418,CELLSJAVA-42419) have been fixed in Aspose.Cells for Java 17.10.