Re: Shared formulas

2007-05-18 Thread dkarr


kix wrote:
> 
> Hi,
> I use POI to import quite large and complex Excel files having a lot of
> formulas. Some of these formulars are stored as "shared formulas". I can
> open the file, but when I try to call HSSFFormulaEvaluator.evaluate() I
> get a RecordFormatException on some cells:
> 
> org.apache.poi.hssf.record.RecordFormatException: Coding Error: Expected
> ExpPtg to be converted from Shared to Non-Shared Formula
>   at
> org.apache.poi.hssf.record.formula.ExpPtg.toFormulaString(ExpPtg.java:78)
>   at
> org.apache.poi.hssf.model.FormulaParser.toFormulaString(FormulaParser.java:886)
>   at
> org.apache.poi.hssf.model.FormulaParser.toFormulaString(FormulaParser.java:868)
>   at
> org.apache.poi.hssf.usermodel.HSSFCell.getCellFormula(HSSFCell.java:630)
> 
> I think there is a bug in the implementation of shared formulas. I'm using
> the current POI 3.0 RC. The problem also occured in POI 2.5.1 (not an
> Exception but a text like "NO IDEA SHARED FORMULA" was shown.
> 

Has some workaround been found for this?  I just discovered that I'm seeing
the same problem.  I tried upgrading to 3.0-rc4, but I get the same result.
-- 
View this message in context: 
http://www.nabble.com/Shared-formulas-tf3713978.html#a10687139
Sent from the POI - User mailing list archive at Nabble.com.


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



Also getting "Coding Error: Expected ExpPtg to be converted from Shared to Non-Shared Formula" exception

2007-05-18 Thread Karr, David
I would have responded to the original chain on this, but I already
deleted that from my email.

I just noticed a new exception in my POI-based application:

Coding Error: Expected ExpPtg to be converted from Shared to
Non-Shared Formula

I tried downloading the latest release (the ftp site says "3.0-FINAL",
but the zip file says "3.0-rc4"), and I still get this.

Failing a quick fix in POI for this, what exactly does this error mean,
and is there something I can change in my spreadsheet to work around
this problem?  I need to fix this pretty quickly (today).

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



RE: reading MS word file

2007-05-18 Thread Dmitry Goldenberg
http://textmining.org/



From: Henry Lu [mailto:[EMAIL PROTECTED]
Sent: Fri 5/18/2007 7:22 AM
To: POI Users List
Subject: Re: reading MS word file



Where do i download the

org.textmining package?

-Henry


Dmitry Goldenberg wrote:
> Henry,
> 
> There are a few things you can try.
> 
> 1. Take a look at org.textmining's Word text extractor:
>
> org.textmining.text.extraction.WordExtractor
>
> All you have to do is this:
>
> new WordExtractor().extractText(inputStream)
>
> 2. There is also the POI extractor:
>
> org.apache.poi.hdf.extractor.WordDocument
>
> All you do is:
>
> WordDocument wd = new WordDocument(is);
> StringWriter docTextWriter = new StringWriter();
> wd.writeAllText(new PrintWriter(docTextWriter));
> docTextWriter.close();
> text = docTextWriter.toString();
>
> 3. I'd also check out the following:
>
> org.semanticdesktop.aperture.extractor.word.WordExtractor
>
> here: http://aperture.sourceforge.net/doc/javadoc/index.html
>
> Hope this helps,
> - Dmitry
>
>
> 
>
> From: Henry Lu [mailto:[EMAIL PROTECTED]
> Sent: Thu 5/17/2007 1:19 PM
> To: poi-user@jakarta.apache.org
> Subject: reading MS word file
>
>
>
> Is there an example/code  to read a MS Word file for text line by line.
> All I am interested in is the text regardless format, style, font...
>
> -Henry
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> Mailing List: http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>
>
>
>  

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




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

Re: reading MS word file

2007-05-18 Thread Nick Burch

On Fri, 18 May 2007, Henry Lu wrote:

Can somwone tell me where to download the svn package for POI?


You can either do a svn checkout yourself, and build it with ant:
http://jakarta.apache.org/site/cvsindex.html

Or download nightly builds from:
http://encore.torchbox.com/poi-svn-build/

Nick

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



Re: reading MS word file

2007-05-18 Thread Henry Lu

Can somwone tell me where to download the svn package for POI?

-Henry
  


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



Re: reading MS word file

2007-05-18 Thread Henry Lu

Where do i download the

org.textmining package?

-Henry


Dmitry Goldenberg wrote:

Henry,
 
There are a few things you can try.
 
1. Take a look at org.textmining's Word text extractor:


org.textmining.text.extraction.WordExtractor

All you have to do is this: 


new WordExtractor().extractText(inputStream)

2. There is also the POI extractor:

org.apache.poi.hdf.extractor.WordDocument

All you do is:

WordDocument wd = new WordDocument(is);
StringWriter docTextWriter = new StringWriter();
wd.writeAllText(new PrintWriter(docTextWriter));
docTextWriter.close();
text = docTextWriter.toString();

3. I'd also check out the following:

org.semanticdesktop.aperture.extractor.word.WordExtractor

here: http://aperture.sourceforge.net/doc/javadoc/index.html

Hope this helps,
- Dmitry




From: Henry Lu [mailto:[EMAIL PROTECTED]
Sent: Thu 5/17/2007 1:19 PM
To: poi-user@jakarta.apache.org
Subject: reading MS word file



Is there an example/code  to read a MS Word file for text line by line.
All I am interested in is the text regardless format, style, font...

-Henry

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




  


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



Re: how to save a excel file using POI

2007-05-18 Thread Rajeshwar Mothe

hey raghav

is it the thing u did

if not send me u r code snippet and thanks for sending intresting querys

and where r u working now

and how the culture in u r company




import java.io.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

 public class POIFS
 {



 public POIFS(){

 }
 public static void main(String[] args){
 try
 {

POIFSFileSystem fs = new POIFSFileSystem(
new FileInputStream(
"C:\\raju.xls"));

  // create a workbook out of the input stream
  HSSFWorkbook wb = new HSSFWorkbook(fs);

  // get a reference to the worksheet
  HSSFSheet sheet = wb.getSheetAt(0);

  // create rows from 5 fill values in the 3rd column
  HSSFRow row1 = sheet.createRow((short) 4);


  // create a cell on the 3rd column
  HSSFCell c1_3 = row1.createCell((short) 3);



 FileOutputStream out = new FileOutputStream("C:\\result.xls");
 wb.write(out);
 }
  catch (Throwable t){
 t.printStackTrace();
   }
 }


 }


by Cheers
RAJESHWAR


Re: how to save a excel file using POI

2007-05-18 Thread Rajeshwar Mothe

hey raghav

its intresting i think u did with overriding output stream i suppose.

just send the code snippet just to watch

and good work keep it up

u rock it

Cheers
RAJESHWAR


Re: how to save a excel file using POI

2007-05-18 Thread Raghav
Rajeshwar,

I was able to modify the file and save it back. 

Thanks for your help

Raghav





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



Re: how to save a excel file using POI

2007-05-18 Thread Raghav
Rajeshwar Mothe  gmail.com> writes:

> 
>  Hi raghava
> 
>  just write it into an out put stream and
> 
>   use request.getOutputStream();
> 
>  it will give an option to save
> 
> then save it
> 
>  if it is not still clear then reply me with u r entire code snippet i will
> help u
> 
>  cheers
> 
>  RAJESHWAR
> 
>  VALUE LABS , INDIA
> 

Hi Rajeshwar,

I am using any servlet in my code, it is simple java application trying to
modify an existing java file. 

POIFSFileSystem fs = new POIFSFileSystem( 
  new FileInputStream( 
  "E:/samples/ReadExcel.xls"));

// create a workbook out of the input stream
HSSFWorkbook wb = new HSSFWorkbook(fs);

// get a reference to the worksheet
HSSFSheet sheet = wb.getSheetAt(0);

// create rows from 5 fill values in the 3rd column
HSSFRow row1 = sheet.createRow((short) 4);


// create a cell on the 3rd column
HSSFCell c1_3 = row1.createCell((short) 3);

// create a cell style
HSSFCellStyle style1 = wb.createCellStyle();
   

c1_3.setCellStyle(style1);

// now I need to save this modified excel file

Thanks in advance

Raghav


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



Re: how to save a excel file using POI

2007-05-18 Thread Rajeshwar Mothe

Hi raghava

just write it into an out put stream and

 use request.getOutputStream();

it will give an option to save

then save it

if it is not still clear then reply me with u r entire code snippet i will
help u

cheers

RAJESHWAR

VALUE LABS , INDIA


Re: Want to save a excel file after opening it

2007-05-18 Thread Nick Burch

On Fri, 18 May 2007, Raghav wrote:
My question here is, how do I save back this same file to the file 
system. I am not able to get the writing stream to this because it is 
still open by POIFS.


Call write on your workbook:
http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFWorkbook.html#write(java.io.OutputStream)

Nick

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



how to save a excel file using POI

2007-05-18 Thread Raghav
Hi Experts,

I am reading a excel file from my file system (E:/myFile.xls) using the POIFS
package. Using the POI package for excel, I modify the contents of this file.

My question here is, how do I save back this same file to the file system. I am
not able to get the writing stream to this because it is still open by POIFS.

The code goes like this:
POIFSFileSystem fs = new POIFSFileSystem( 
   new FileInputStream( "E:/myFile.xls"));



// AFter this I modify the file and then want to save this excel file, please
let me know how can I do this


Thanks in advance
Raghav 


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



Want to save a excel file after opening it

2007-05-18 Thread Raghav
Hi Experts,

I am reading a excel file from my file system (E:/myFile.xls) using the POIFS
package. Using the POI package for excel, I modify the contents of this file.

My question here is, how do I save back this same file to the file system. I am
not able to get the writing stream to this because it is still open by POIFS.

The code goes like this:
POIFSFileSystem fs = new POIFSFileSystem( 
   new FileInputStream( "E:/myFile.xls"));  


// AFter this I modify the file and then want to save this excel file, please
let me know how can I do this


Thanks in advance
Raghav 


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