Hi Alexey,
Worksheet sheet = wb.getWorksheets().get(0);
sheet.autoFitColumn(1);
Cells cells = sheet.getCells();
Cell cell = cells.get(“C4”);
System.out.println("DisplayStringValue " + cell.getDisplayStringValue());
System.out.println("Value " + cell.getValue());
Hi Babar Raza.
Hi Alexey,
Thanks for using Aspose.Cells.
Please use Cell.getStringValue() instead. For numeric values, Cell.StringValue will give the formatted result.
Hopefully, it should fulfill your requirements. Let us know if you encounter any other issue. We will look into it and help you asap.
Hi Shakeel Faiz.
Hi Alexey,
Thanks for your feedback and using Aspose.Cells.
Kindly explain in detail how Cell.getStringValue() does not fit your needs. You can provide us sample xls file, screenshot, sample code and expected output. It will help us look into your requirements precisely and we will see if your requested feature could be implemented in future releases.
Hello there is example. A Flag “display zeros” is ignored by library. Anyway i need some method, that will return “15464654” for first case and “” for second case. I think it should be very easy to return string value before width of column applying
Hi Alexey,
Thanks for your sample code and using Aspose.Cells.
After running your code, I think, Cell.getStringValue() is returning correct results but Cell.getDisplayStringValue() are not returning correct results, they should return “” instead of 0 or 0.00 values.
I got the following output results.
Console Output:
Cell.getStringValue() results
Expected :15464654 Received:15464654 //returning correct result
Expected : Received:0 //returning correct result
Expected : Received:0.00 //returning correct result
Cell.getDisplayStringValue() results
Expected : Received:0 // should return ""
Expected : Received:0.00 //should return ""
Let me know if got your requirements correct.
Please also explain what do you mean by “return string value before width of column applying”
Hi Shakeel Faiz.
Hi Alexey,
Thanks for your posting and using Aspose.Cells.
We have logged your requirements in our database for investigation. We will look into it and see if your requested feature could be implemented. Please spare us some time, once, there is some update for you, we will let you know asap.
This issue has been logged as CELLSJAVA-40845.
Hi Shakeel. Yes i need a new method in your API (or parameter for getDisplayStringValue), that will returns formatted cells value, as it will be displayed in infinity wide cell.
Hi Alexey,
Thanks for your posting and using Aspose.Cells.
We have already logged your requirements. Please spare us some time. Once, we will have some update for you, we will let you know asap.
Hi Alexey,
Thanks for using Aspose.Cells.
We have evaluated this issue further. To get the same behavior with MS Excel, Cell.StringValue also should
give “” for zeros when DisplayZeros is false.
So from the coming new
fix, Cell.StringValue/DisplayStringValue will both return “” for this case.
Hi Alexey,
Thanks for using Aspose.Cells for Java.
We have fixed the issue relating to DisplayZeros set as false.
Please download and try this fix: Aspose.Cells for Java (Latest Version) and let us know your feedback.
The issues you have found earlier (filed as CELLSJAVA-40845) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.