Apache POI-Java: Excel utility tricks

  1. Passing empty string in a cell
    Sometimes we feel the need of passing null/blank value in excel to avoid the null pointer exception and we can handle this from excel sheet without having to handle from code.
    – If you want to pass empty string just type opening single quote ( ‘ ) and it will be treated as empty string for apache poi
  2. Passing number as string
    If you want to pass number or decimal as string , prefix with opening single quote ( ‘ ) and it will take it as string value.
    Ex: ‘20.00 , ’29
  3. Treating a null cell as blank
    We can make use of Row policy to treat a cell as blank.

Leave a Reply