poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mck <mickey...@taosnet.com>
Subject Re: Problem with order of HSSF Listener events
Date Fri, 05 Aug 2011 17:07:58 GMT
I set the record listener parameter to null (see code below) and ran it. 
Got a RecordFormatException: The content of an excel record cannot 
exceed 8224 bytes exception.
Using poi-3.8-beta3

----

package biffviewerexample;
import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.InputStream;

import java.io.PrintStream;

import org.apache.poi.hssf.dev.BiffViewer;

public class BiffViewerExample {

public BiffViewerExample(String filename) {
try {

InputStream inputStream = new FileInputStream(filename);
FileOutputStream fileOutputStream = new 
FileOutputStream("C:\\BiffViewerOutput.txt");
PrintStream printStream = new PrintStream(fileOutputStream);
//BiffViewer.BiffRecordListener biffRecordListener = new 
BiffRecordListener();
boolean dumpInterpretedRecords = true;
BiffViewer.createRecords(inputStream, printStream, null, 
dumpInterpretedRecords);
printStream.close();
fileOutputStream.close();
inputStream.close();
}
catch (org.apache.poi.hssf.record.RecordFormatException e){
System.err.println ("BiffViewerExample: RecordFormatException" + e);
}
catch (Exception e){
System.err.println ("BiffViewerExample: Error in writing to file" + e);
}
//String[] stringArray = new String[1];
//stringArray[0] = filename;
//BiffViewer.main(stringArray);
}

public static void main(String[] args) {

String filename = "C:\\test.xls";
new BiffViewerExample (filename);
}

}



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message