POI [ Apache]

Hi,
I have installed cfx_excelQuery [ into web-inf\lib\ ], and
registered the tag then extracted the zip[ poi-2.5.1-final-20040804
] into \web-inf\lib\ ...Then restarted the CF service ..still I am
getting this...I am using CF server 6,1,0,63958 on windows 2000
server..
Object Instantiation Exception.
Class not found: org.apache.poi.hssf.usermodel.HSSFWorkbook
The error occurred in D:\CFusionMX\wwwroot\1.cfm: line 12
10 : <cfscript>
11 : fis = createObject("java",
"java.io.FileInputStream").init("c:\template.xls");
12 : wb = createObject("java",
"org.apache.poi.hssf.usermodel.HSSFWorkbook").init(fis);
13 : sheetNumber = wb.getSheetIndex("Sheet1");
14 : fis.close();
</script>
<cfdump var="#sheetNumber#">

Hi em,
I tested your cfscript with poi-2.5.1-final-20040804.jar
installed as follows:
in cfusionmx\lib - code works
in cfusionmx and added to classpath in jvm.config - code
works
in cfusionmx\wwwroot\WEB-INF\lib - code works
I followed up with expanding the jar into WEB-INF\lib and the
code failed, just as with yours. So, install the jar without
expanding its contents and you should be good to go.

Similar Messages

  • How POI(apache) support multi-language?Urgent!!!

    Hi:
    I use POI(http://jakarta.apache.org/poi/)modify my excel(language is chinese),but excel not display chinese.
    How modify POI source code to support chinese? POI sourcecode default encoding is 8bit per char!

    Someone can help me?SOS!SOS!

  • POI-Apache ERR

    What is the solution people ?
    The file exist in c drive with 2 sheets in excel file called
    "As-Built and Design"
    ===================ERR==================
    -1
    The error occurred in D:\CFusionMX\wwwroot\1.cfm: line 16
    14 : fis.close();
    15 : </cfscript>
    16 : <cfx_ExcelQuery action="read" file="c:\template.xls"
    sheet="#sheetNumber#" variable="myQuery" />
    17 : <cfdump var="#myQuery#">
    =============Code=============
    <cfscript>
    fis = createObject("java",
    "java.io.FileInputStream").init("c:\template.xls");
    wb = createObject("java",
    "org.apache.poi.hssf.usermodel.HSSFWorkbook").init(fis);
    sheetNumber = wb.getSheetIndex("Sheet1");
    fis.close();
    </cfscript>
    <cfx_ExcelQuery action="read" file="c:\template.xls"
    sheet="#sheetNumber#" variable="myQuery" />
    <cfdump var="#myQuery#">

    What happens when you dump the value of sheetNumber before
    you call your CFX tag? Also, if the excel file is called "As-Built
    and Design", why are you trying to open template.xls? If
    sheetNumber is set to a java NULL value, that could explain some
    funky behavior by CF.

  • Modify existing excel file (POI API)

    Hi All,
    Can anybody give me a reference to an example to update/modify an exsiting excel file in java.
    For creation of excel file I am using POI API. But not getting how to update an existing excel file
    using POI API.
    I'll be thankful for your help.
    Regards
    Naz

    Tabbasum wrote:
    Hi All,
    Can anybody give me a reference to an example to update/modify an exsiting excel file in java.
    For creation of excel file I am using POI API. But not getting how to update an existing excel file
    using POI API.
    I'll be thankful for your help.
    Regards
    NazYou do know that the poi.apache.org site has some nice examples, don't you?
    http://poi.apache.org/spreadsheet/examples.html
    Many other examples exist on the Internet; Google is your friend.
    Hope that helps, Naz.
    Regards,
    Jay-Z

  • POI HSSF Excel 2002 Data error

    Hello,
    I'm using HSSF 3.0.2 Final version to create an excel document from java.
    This document contains pictures and some text under each picture in a row below. There are four sheets in the workbook and each contains about 30-40 pictures.
    I can create document fine and I can open it with Excel 2000,
    but when I try to open it with Excel 2002 and gives me data error.
    My understanding is that 2002 is supported and it seems to be a simple enough document without any fancy features
    Any idea what could be wrong?

    You can post your error and excel file to poi's mailing list.
    http://poi.apache.org/mailinglists.html

  • The supplied data appears to be in the Office 2007+ XML. POI only supports

    Hi all I'm having this exception when I'm trying to write a data to excel file.But I'm using open office not Microsoft excel.This must be the reason to get this.I'm using poi-3.0.2-beta1-20071204.jar. If any body knows a new jar or any solution please respond this.
    Thank you.
    KR.
    Samith

    Your topic subject and your message are really vague. What are you talking about?
    At least I can tell you that you can just check and download POI at their own homepage over there at [poi.apache.org|http://poi.apache.org/]. There's a beta version which supports the OpenXML format (xlsx, docx, etc). There is also another API which can handle OpenXML files: [OpenXML4J|http://www.openxml4j.org/].

  • POI and Office sw

    I would like to use POI (http://poi.apache.orgl) to export a PowerPoint to image on my server where I have a ppt file.
    I dont have MS Office loaded on my server. Can I still use POI to do this export or do I need to load MS Office PowerPoint on my server?

    POI doesn't require any Office software to do whatever it does. I run it on machines which aren't even Windows. So if it can produce that PowerPoint file, it's all you need.

  • Writing word file using POI

    HI!
    can any body help me in writing a new word file using Apache POI (Java API). any code or link.
    Thanks in advance

    http://poi.apache.org/hwpf/quick-guide.htmland
    http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/

  • How to retrieve data from a read-only Excel file

    Hi Developers,
    I'm trying to retrieve data from a read-only Excel file. I used the same code that I used to retrieve data from a normal Excel file, but it can't work.
    My code is as followed:
    try
    InputStream KpExcel = new FileInputStream("kp.xls");
    HSSFWorkbook Kpwb = new HSSFWorkbook(KpExcel);
    HSSFSheet Kpsheet = Kpwb.getSheetAt(0);
    catch(Exception e)
    e.printStackTrace();
    System.out.println("Exception: "+e.getMessage());
    The error I received is as followed:
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    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:210)
    at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:191)
    at photoproductionsystem.IncomingWIPPanel.getKp(IncomingWIPPanel.java:118)
    at photoproductionsystem.IncomingWIPPanel.<init>(IncomingWIPPanel.java:76)
    at photoproductionsystem.TabbedDisplay.<init>(TabbedDisplay.java:47)
    at photoproductionsystem.Display.create(Display.java:73)
    at photoproductionsystem.Display.init(Display.java:44)
    at photoproductionsystem.Display.main(Display.java:229)
    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)
    ... 15 more
    Can someone please help me with my problem? Thanks a lot in advance!

    Madeline wrote:
    how do I ask at Apache mailing list?I wonder why it seems to be a strange idea to some people to look at the software vendor's site for product support. :p
    http://poi.apache.org/mailinglists.html

  • How to get the actual data of a file held in IWDResource object?

    Hello,
    I am uploading a csv/excel file and writing it to the server using the FuleUpload UI and IWDResource Interface.
    I need to make some things on the data before I write it:
    1. count the number of columns are in the csv/excel file in each line.
    2. replace special characters in the file using replaceAll for example.
    My problem is how to access the data once it is stored in the IWDResource interface? All I have there is the read method which generated an InputStream object to read bytes from the file.
    Any ideas?
    Roy

    If you want to read cell level or row level data from excel you should use third party APIs. Apache POI provides such an API, you can use and read the excel documents. You can refer the POI API
    <a href="http://poi.apache.org/hssf/quick-guide.html#ReadWriteWorkbook">here</a>.
    And if you want to read the CSV file content do the following..
    FileInputStream fis=(FileInputStream)wdContext.currentContextElement().get<attribute anme>().read(false);
    byte in[]      = new byte[512];
    String csvData;
    StringBuffer csvBuffer = new StringBuffer();
    while(fis.read(in)>0)
    csvData = new String(in);
    csvBuffer.append(csvData);
    //now write the logic to validate the csv data.
    Regards
    Abhilash

  • How to get the actual page cordinate a field

    I have 2 content areas CA1, CA2. CA1 is filled with dynamic table..which will flow into multiple page..at the end of the table I want the signature ..The signature has to be upper half of the page..since contents of the table are dynamic..it could be that the content could fill 3/4 of last page..so in which case I have to page break and go to next page and printed on the positioned place.
    The layout is flowed so it can overflow..I was planning to trigger a page break by putting a dummy field after the table and calculate the position of the dummy field with 0 width, 0 height which will be right after the table. If the position (dummyfield.y) has reach more than the upper half of the page.. it will trigger  next page where the signature will be printed in the first half of the page in CA2...
    But dummyfield.y always gives me a 0..because it is with respect to the previous container or something.. Any one with brighter ideas...
    thanks

    If you want to read cell level or row level data from excel you should use third party APIs. Apache POI provides such an API, you can use and read the excel documents. You can refer the POI API
    <a href="http://poi.apache.org/hssf/quick-guide.html#ReadWriteWorkbook">here</a>.
    And if you want to read the CSV file content do the following..
    FileInputStream fis=(FileInputStream)wdContext.currentContextElement().get<attribute anme>().read(false);
    byte in[]      = new byte[512];
    String csvData;
    StringBuffer csvBuffer = new StringBuffer();
    while(fis.read(in)>0)
    csvData = new String(in);
    csvBuffer.append(csvData);
    //now write the logic to validate the csv data.
    Regards
    Abhilash

  • Problem in Reading XLSX File (MS EXCEL 2007).

    Dear All ,
    I am reading all the properties to XL sheet and then utilising it in my code .
    I am getting some problem in reading the Border of the Cell , my code is working fine with most of the Excel Sheet but it can not correctly read the Border of a few Excel files.
    I am using the method ,
    getBorderBottomEnum()
    or
    getBorderBottom()
    but I can not read the Border used correctly for all the Excel Sheet .
    Please Help.
    Please revert if I am not clear.
    Thanking You All.

    I'm guessing that your question is about Apache POI. They don't have a forum AFAIK, but they do have a [url http://poi.apache.org/mailinglists.html]mailing list.
    John

  • Excel file processing in jsp

    Hello friends
    I want to read Excel files jsp(or java).I used sql driver,but it does'nt reads the file properly.I want to read file in jsp.I went thr many sites and found many ways like apache poi,JExcel api etc
    I found JExcel api is not free.I am getting errors with poi.I found no proper documentation on it.On apache site there are many versions to download poi packages.I confused about which to download.
    If any one has used poi successfully,please let me know

    related to POI
    **POI**
    Site
    http://poi.apache.org/Api
    http://poi.apache.org/apidocs/index.htmlExamples
    http://www.google.co.in/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=7WV&q=POI+examples&btnG=Search&meta=

  • Can I display a MS Word Document as part of a page

    Hi,
    Is it possible to display a MS Word document as part of a page (i.e. in a panelForm, panelBox) with ADF Faces? Any help is appreciated.
    Best Regards,
    Salim

    Hi,
    No, its impossible. I have never had that requirement, but if you want to review Word document as JSF page fragment, you can try to create helper servlet that gets MS Word and converts it to HTML (e.g using Apache POI - library to access Microsoft format files http://poi.apache.org/ ). Then you can try display this HTML using iframe or <jsp:include> and <f:verbatim> tag in your jsf page. I'ts my fast and free think - I have never tried this.
    Kuba

  • How to set the header of the file to excel type when writing it?

    Hello,
    I am using POI API to read an excel file that I have previously written using Java, but not using POI (I've written the file using Microsoft office xml and then writing it using FileOutputStream with an xls extension).
    The problem is that when I read back the file I am getting this error:
    The system was unable to upload the file: Invalid header signature; read 7311066695147732796, expected -2226271756974174256.
    which means that the header of the file is not excel typed.
    If I manually open the file and save it as excel POI is able to read it but I don't want to do this as this entire process of writing/reading the file should be automated. I don't want to use POI for writing the file because POI cannot provide me everything that I need when Microsoft office xml can.
    So, my question is simple: Is there a way, using java, to set the header of a file to excel so that POI will recognize it as such?

    hi roy,
    @see: http://poi.apache.org/hssf/index.html
    "HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. It does not support the new Excel 2007 .xlsx OOXML file format, which is not OLE2 based."
    maybe jexcelapi supports you in writing your xls:
    http://jexcelapi.sourceforge.net/
    hth, jens

Maybe you are looking for

  • Desktop image center doesn't work after OS update

    Hi - I just updated the OS with software update.  I always had the same picture on my desktop and I used the "center" selection so it was zoomed in.  Following the OS update (10.7.5), the "center" selection no longer works.  When I click on center it

  • Can't open word doc attachments in pdf mail portfolio

    I created a pdf portfolio by converting outlook mail messages in Adobe Acrobat 9 Pro. I can open the attachments but my coworkers are unable to open email attachments that are word documents (they can open pdfs).  When they go to Preferences --> Trus

  • Lync 2013 problem with interaction in Hyper-V

    Hello, during the conference in Lync 2013 does not work the guest interaction service, which has been referred to the control (display the desktop). The guest can move the cursor, but can't click or write in Hyper-V virtual machine. In a virtual mach

  • Wacom Cintiq 12 WX

    Hi, does somebody got a Cintiq 12 WX calibrated for Adobe RGB ? I havent got enogh money to buy a spider tool or somethings else...just baught me that 12 WX and that was allready awfull expensive for me. Would be graet if you can help me. Regards atr

  • Regarding monthly subscription for UAE

    Hi All, I am planning to use Skype to call UAE from India. Hence I found the monthly subcription for 800 minutes for 79.9$ ( +VAT). But according to my usage minimum required subcription is 1000 minutes and later I may need 1200 to 1500 minutes per m