Hello Mark,
Thanks for your help. I found another way so I do not have to manage my own
POI-implementation. I do something like this:
if ( cell.getCellType() == XSSFCell.CELL_TYPE_FORMULA )
{
final String oldFormula = cell.getCellFormula();
final String newFormula = "IF( \"\" = ( " + oldFormula + " ), \"BlAnK\", "
+ oldFormula + " )";
cell.setCellFormula( newFormula );
}
String value = formatter.formatCellValue( cell, formulaEvaluator );
if ( " BlAnK ".equals( value ) ) {
vValue = null;
}
I do not know, if it works for every formula. For my import everything works
fine. Only BlAnK has to be unique.
Kind regards,
Philipp Bönisch
Software Engineer Rail & Transit Solutions
CSC Deutschland GmbH
p: +49 351 47771 50 | f: +49 351 47771 11 | [email protected] | www.csc.com/de
| 01069 Dresden Germany | Bergstr. 2
-----Ursprüngliche Nachricht-----
Von: Mark Beardsley [mailto:[email protected]]
Gesendet: Dienstag, 1. Dezember 2015 17:34
An: [email protected]
Betreff: Re: Import Excel: How to get a blank, when the result of a formula is
blank?
Well, ISBLANK() is an Excel function -
https://support.office.com/en-us/article/IS-functions-0f2d7971-6019-40a0-a171-f2d869135665
- that will indicate whether or not a cell is blank. In addition, there is
nothing at all preventing you from creating your own version of POI with that
change made to the dereferenceResult() method. All you would need to do is
obtain the source for the project, modify it and build your own local version.
This page will get you started - https://poi.apache.org/howtobuild.html - and
it may be a better option than waiting for a change to the project itself as
that may require some discussion.
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Import-Excel-How-to-get-a-blank-when-the-result-of-a-formula-is-blank-tp5721160p5721173.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional
commands, e-mail: [email protected]
CSC Deutschland GmbH • Registered Office: Abraham-Lincoln-Park 1, 65189
Wiesbaden, Germany • Board of Directors: Claus Schünemann (Chairman),
Josef Ranner • Chairman of the Supervisory Board: William L. Deckelman
• Registered in Germany: HRB 11307 • CSC • This is a PRIVATE
message. If you are not the intended recipient, please delete without copying
and kindly advise us by e-mail of the mistake in delivery. • NOTE:
Regardless of content, this e-mail shall not operate to bind CSC to any order
or other contract unless pursuant to explicit written agreement or government
initiative expressly permitting the use of e-mail for such purpose.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]