Saturday, 23 January 2016

Difference between toString() and getStringCellValue in Apachi POI




1) toString()

Its returns the string object.

If excel have the below data type variable then it returns the below corresponding values


-> IF String - Return String
-> IF Integer - Return Integer
-> If Date - Return Date
-> If Formula - Return formula (Not return value after formula get executed)



2) getStringCellValue()

Its return the string value if the cells contains only string, Other wise its returns exception.


If excel have the below data type variable then it returns the below corresponding values


-> IF String - Return String
-> IF Integer - Return IllegalStateException (Use getNumericCellValue )
-> If Date - Return IllegalStateException (Use getDateCellValue())
-> If Formula - Return IllegalStateException (Use getCellFormula and getCachedFormulaResultType)

3 comments:

  1. I appreciate you debunking some misconceptions about this topic. Thanks for clearing up a lot of confusion for me. The color blindness also contributes to creating accessible and inclusive environments. This test helps designers, architects, and policymakers understand color blindness and its impact on their creations. It benefits society as a whole to incorporate color schemes and patterns that are accessible to a diverse range of color vision abilities into signage, user interfaces, product packaging, and web design.

    ReplyDelete
  2. Your blog consistently offers practical advice. Thank you for your dedication to providing valuable and insightful guidance. Find fresh insights on this article. Geometry Dash Free challenges your reflexes with fast-paced levels that require perfect timing.

    ReplyDelete