Search in sources :

Example 1 with MissingRecordAwareHSSFListener

use of org.apache.poi.hssf.eventusermodel.MissingRecordAwareHSSFListener in project poi by apache.

the class XLS2CSVmra method process.

/**
	 * Initiates the processing of the XLS file to CSV
	 */
public void process() throws IOException {
    MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
    formatListener = new FormatTrackingHSSFListener(listener);
    HSSFEventFactory factory = new HSSFEventFactory();
    HSSFRequest request = new HSSFRequest();
    if (outputFormulaValues) {
        request.addListenerForAllRecords(formatListener);
    } else {
        workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
        request.addListenerForAllRecords(workbookBuildingListener);
    }
    factory.processWorkbookEvents(request, fs);
}
Also used : HSSFEventFactory(org.apache.poi.hssf.eventusermodel.HSSFEventFactory) SheetRecordCollectingListener(org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder.SheetRecordCollectingListener) MissingRecordAwareHSSFListener(org.apache.poi.hssf.eventusermodel.MissingRecordAwareHSSFListener) HSSFRequest(org.apache.poi.hssf.eventusermodel.HSSFRequest) FormatTrackingHSSFListener(org.apache.poi.hssf.eventusermodel.FormatTrackingHSSFListener)

Aggregations

SheetRecordCollectingListener (org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder.SheetRecordCollectingListener)1 FormatTrackingHSSFListener (org.apache.poi.hssf.eventusermodel.FormatTrackingHSSFListener)1 HSSFEventFactory (org.apache.poi.hssf.eventusermodel.HSSFEventFactory)1 HSSFRequest (org.apache.poi.hssf.eventusermodel.HSSFRequest)1 MissingRecordAwareHSSFListener (org.apache.poi.hssf.eventusermodel.MissingRecordAwareHSSFListener)1