poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jana Kraemer <KRAEM...@de.ibm.com>
Subject Re: AW: Autofilter for Excel with HSSF??
Date Wed, 28 Jun 2006 12:53:09 GMT
Now I tried the suggestion to create a template. I created a Workbook with 
3 sheets. Each Sheet has a
header which includes the Filter. When i try to open this template now i 
get this Message:

java.lang.reflect.InvocationTargetException 
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method) 
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown 
Source) 
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
        at java.lang.reflect.Constructor.newInstance(Unknown Source) 
        at org.apache.poi.hssf.record.RecordFactory.createRecord(
RecordFactory.java:224) 
        at org.apache.poi.hssf.record.RecordFactory.createRecords(
RecordFactory.java:160) 
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(
HSSFWorkbook.java:163) 
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(
HSSFWorkbook.java:130) 
        at performance.Result2Excel.createSheetTime(Result2Excel.java:56) 
        at performance.QueriesLesen.QueriesExecute(QueriesLesen.java:74) 
        at performance.QueriesLesen.<init>(QueriesLesen.java:42) 
        at performance.SwtDialog$6.widgetSelected(SwtDialog.java:247) 
        at org.eclipse.swt.widgets.TypedListener.handleEvent(
TypedListener.java:90) 
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66
) 
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) 
        at org.eclipse.swt.widgets.Display.runDeferredEvents(
Display.java:3080) 
        at org.eclipse.swt.widgets.Display.readAndDispatch(
Display.java:2713) 
        at performance.SwtDialog.main(SwtDialog.java:97) 
Caused by: java.lang.ArrayIndexOutOfBoundsException 
        at java.lang.System.arraycopy(Native Method) 
        at org.apache.poi.hssf.record.UnknownRecord.<init>(
UnknownRecord.java:62) 
        at org.apache.poi.hssf.record.SubRecord.createSubRecord(
SubRecord.java:57) 
        at org.apache.poi.hssf.record.ObjRecord.fillFields(
ObjRecord.java:99) 
        at org.apache.poi.hssf.record.Record.fillFields(Record.java:90) 
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55) 
        at org.apache.poi.hssf.record.ObjRecord.<init>(ObjRecord.java:61) 
        ... 18 more 
Exception in thread "main" 
org.apache.poi.hssf.record.RecordFormatException: Unable to construct 
record instance, the following exception occured: null 
        at org.apache.poi.hssf.record.RecordFactory.createRecord(
RecordFactory.java:237) 
        at org.apache.poi.hssf.record.RecordFactory.createRecords(
RecordFactory.java:160) 
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(
HSSFWorkbook.java:163) 
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(
HSSFWorkbook.java:130) 
        at performance.Result2Excel.createSheetTime(Result2Excel.java:56) 
        at performance.QueriesLesen.QueriesExecute(QueriesLesen.java:74) 
        at performance.QueriesLesen.<init>(QueriesLesen.java:42) 
        at performance.SwtDialog$6.widgetSelected(SwtDialog.java:247) 
        at org.eclipse.swt.widgets.TypedListener.handleEvent(
TypedListener.java:90) 
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66
) 
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) 
        at org.eclipse.swt.widgets.Display.runDeferredEvents(
Display.java:3080) 
        at org.eclipse.swt.widgets.Display.readAndDispatch(
Display.java:2713) 
        at performance.SwtDialog.main(SwtDialog.java:97) 

My Java-Code looks like that:

public void createSheetTime(Resultset resultSet) throws SQLException, 
IOEXception {
 
        POIFSFileSystem fs = new POIFSFileSystem(new 
FileInputStream("file.xls")) ;
        HSSFWorkbook wb = new HSSFWorkbook(fs);      --> here my 
application terminates
        ...

In the web i read, that this could be managed if i enable AutoFilter. But 
i have no idea how to do that.







"Karsten Voges" <karsten.voges@jato-consulting.de> 
06/28/2006 01:17 PM
Please respond to
"POI Users List"


To
"'POI Users List'" <poi-user@jakarta.apache.org>
cc

Subject
AW: Autofilter for Excel with HSSF??






I do not know about an API for this, but you could get it by using a
template where you have autofilters.

Hth,
Karsten. 

-----Urspr√ľngliche Nachricht-----
Von: Jana Kraemer [mailto:KRAEMERJ@de.ibm.com] 
Gesendet: Mittwoch, 28. Juni 2006 12:38
An: poi-user@jakarta.apache.org
Betreff: Autofilter for Excel with HSSF??

Hi there,

Is there a possibility to place autofilter in EXCL with HSSF ? I have
searched the web, however, no solution found. I am grateful about every
hint. With pleasure also links to homepages or Tutorials.


Greetings,
Jana


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message