Regarding checkcell functionality in 8.3.4 aspose version

Hi Team,

In excel while sum up the value i am getting -7.5999 e5 value in cell. how to round this value is 8.3.4 version. In 2.5.3 version it is getting as 0. Please suggest me any solution.


Thanks & Regards,
Saravanan Mani

Hi Saravanan,

I am afraid, I didn’t understand your inquiry. Please be kind enough to elaborate your concerns by sharing more details, samples spreadsheet, code snippet and/or screenshots that may help us get some idea of your requirements. Thank you for your cooperation.

Hi Team,

Please explain the checkcell() in aspose version 8.3.4


Thanks
Saravanan Mani

Hi Saravanan,


Please note, Cells.checkCell method can be used to detect if a particular cell (referenced via row & column index pair) has been initialized or not. In case the said method returns an object of the Cell that mean the particular cell has been initialized and related functions such as value inquiry can be performed on it. However, if the method return null, that mean the cell has not been initialized.

Usage scenario could be as follow.

Java


Cell tempCell = cells.checkCell(row_counter, col_counter);
if (tempCell != null) {
String temp = tempCell.getStringValue();

Hi Babar,

As mentioned above post if cell value is -7.5999 e5 then how to round the value using check cell.

Please suggest the solution.

Thanks & Regards,
Saravanan Mani

Hi Saravanan,


Is this value (-7.5999 e5) an exponential or e5 is a cell reference? This part of your inquiry is not making sense that is the reason we asked you to provide the sample spreadsheet for better understanding. Please share your actual spreadsheet (or a sample containing dummy data) and your desired results so we could look into the matter. .

Hi,

we are getting -7.10543E-15 value in cell.Can you provide me the solution to make the cell value as 0?

Please find the attachment of the spreadsheet and Screenshot of the value.

Hi Saravanan,


Thank you for the sample.

Please note, the cells in column T are formatted as General, that mean; the values will be displayed as they are in the dependent cells. You may workaround this situation by changing the format of the column or a particular cell and retrieve the value using Cell.DisplayStringValue if you are using this value in your application. Moreover, if you have Cells.checkCell method used anywhere in your application then please note it cannot alter the formatting of the cell. It is only used to detect if the cell has been initialized or not.

Please check the following piece of code that changes the format of the Column T to read the exponential value -7.10543E-15 as 0. Feel free to tweak the code to suit your application requirement.

Java

Workbook book = new Workbook(“C:/temp/a3M0xf7WCA.xls”);
Worksheet sheet = book.getWorksheets().get(“regionalOrderSumm33”);
Cells cells = sheet.getCells();
ColumnCollection columns = cells.getColumns();
Column column = columns.get(CellsHelper.columnNameToIndex(“T”));
Style style = book.createStyle();
style.setNumber(1);
StyleFlag flag = new StyleFlag();
flag.setNumberFormat(true);
column.applyStyle(style, flag);
System.out.println(cells.get(“T12”).getDisplayStringValue());
System.out.println(cells.get(“T12”).getValue());
book.save(“C:/temp/output.xls”);


0 -7.10543E-15

Hi,

We made the code changes and it resolved exponential values problem.But its changing the decimal value to rounded value in some cells.(0.69 to 1) and getting null exception while generating report.Kindly provide me the solution to solve this issue.

Hi Saravanan,


Please be kind enough to create a new thread for every distinct problem you encounter. This will simply help us in tracking your requests in the Aspose support forums more efficiently. In case you wish us to review the past discussion, you can provide the link to the previous thread in new one for reference. Moreover, please share the updated code (preferably a standalone executable sample application) along with input & output spreadsheets for thorough investigation.

Thank you for your understanding and cooperation.

Hi Team,


We added the code which is available in code changes.png Screen shot based on the suggestions given in the earlier post.(Regarding checkcell functionality in 8.3.4 aspose version).

It Resolved the problem but its creating issues in the attached SS highlighted area.Because its changing the decimal value to rounded value in some cells.(0.69 to 1) and getting #### value in cell because of this fix…Kindly provide me the solution to solve this issue.

Hi Team,


We added the code which is available in code changes.png Screen shot based on the suggestions given in the earlier post.(Regarding checkcell functionality in 8.3.4 aspose version).

It Resolved the problem but its creating issues in the attached SS highlighted area.Because its changing the decimal value to rounded value in some cells.(0.69 to 1) and getting #### value in cell because of this fix…Kindly provide me the solution to solve this issue.

Hi,


Please follow up on your other thread that you have recently created for same issues.