Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with parsing to String value that is Double or BigInteger #318

Closed
dashayakubovich opened this issue May 20, 2024 · 6 comments
Closed

Comments

@dashayakubovich
Copy link

Hi! @ozlerhakan
I use poiji and faced with the following issue:
can't parse to java String
image
image
but xlsx file has the following values
image
Can you help me understand what I am doing incorrectly?

Copy link

Thank you for contributing to Poiji! Feel free to create a PR If you want to contribute directly :)

@ozlerhakan
Copy link
Owner

Hi @dashayakubovich ,

Hmm interesting... could you share your excel file with me, if you don't mind?

@dashayakubovich
Copy link
Author

example.xlsx
@ozlerhakan hi, sure

@ozlerhakan
Copy link
Owner

ozlerhakan commented May 24, 2024

Apparently, in your excel file, you have predefined special formats for numbers in your cells. The problematic format number that your excel is using by default is 165. We need to remove that format from the style table using the following approach in Poiji:

        PoijiNumberFormat numberFormat = new PoijiNumberFormat();
        numberFormat.putNumberFormat((short) 165, "");
        PoijiOptions poijiOptions = PoijiOptions.PoijiOptionsBuilder.settings()
        .poijiNumberFormat(numberFormat)
        # rest of your options
        # ...
        .build();

I hope it helps your problem. You can check how to modify number formats in your excels at https://github.com/ozlerhakan/poiji?tab=readme-ov-file#modify-cells-formats

@dashayakubovich
Copy link
Author

dashayakubovich commented May 27, 2024

@ozlerhakan
I do it in this way, but no success
image
image

@ozlerhakan
Copy link
Owner

You can check what format number each cell is using with https://github.com/ozlerhakan/poiji?tab=readme-ov-file#debug-cells-formats and once you have the number, you can update it accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants