Github user ijokarumawak commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2194#discussion_r143922178
  
    --- Diff: 
nifi-nar-bundles/nifi-poi-bundle/nifi-poi-processors/src/main/java/org/apache/nifi/processors/poi/ConvertExcelToCSVProcessor.java
 ---
    @@ -220,45 +287,43 @@ public void process(InputStream inputStream) throws 
IOException {
          * @param session
          *  The NiFi ProcessSession instance for the current invocation.
          */
    -    private void handleExcelSheet(ProcessSession session, FlowFile 
originalParentFF,
    -            SharedStringsTable sst, final InputStream sheetInputStream, 
String sName) throws IOException {
    +    private void handleExcelSheet(ProcessSession session, FlowFile 
originalParentFF, final InputStream sheetInputStream, ExcelSheetReadConfig 
readConfig,
    +                                  CSVFormat csvFormat) throws IOException {
     
             FlowFile ff = session.create();
             try {
    +            final DataFormatter formatter = new DataFormatter();
    +            final InputSource sheetSource = new 
InputSource(sheetInputStream);
    +
    +            final SheetToCSV sheetHandler = new SheetToCSV(readConfig, 
csvFormat);
    +
    +            final XMLReader parser = SAXHelper.newXMLReader();
    +            final XSSFSheetXMLHandler handler = new XSSFSheetXMLHandler(
    +                    readConfig.getStyles(), null, 
readConfig.getSharedStringsTable(), sheetHandler, formatter, false);
    --- End diff --
    
    It seems we can get original cell values if we don't pass a style here. 
I've checked XSSFSheetXMLHandler briefly and find it checks if style is 
specified. I haven't tried it yet, but it seems it's possible.
    
https://github.com/apache/poi/blob/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java#L277-L292


---

Reply via email to