RE: question

2004-07-28 Thread Lee, Insoo
Hi,
Sorry for emailing you directly... It's been really hard to get a hold of
someone who knows HWPF...
I am trying to create a new word doc with a table in it..
Could you please give me a quick pointer on how to do it?
Table class doesn't seem to have a public constructor...

Thanks
Insoo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question

2004-07-28 Thread Tim Forbis
Insoo,

The table class does not have a constructor, but most of the variables you may need 
are in the Paragraph Properties class, specifically there is a variable "fInTable."  
Possibly if you set this to true, it would mark that Paragraph as in a table, and 
treat it as such.  As far as the end of the rows, I believe the Property "fTtp" 
contains only an "end of row" marker the word will recognize.  For more details, I 
found this file that detail the fields more than POI does, but it is in C code, not 
java.
These lines of code will help you specifically with the Tables.
http://www.koffice.org/developer/apidocs/filters/html/mswordgenerated_8h-source.html#l03492
 

This is also a good resource for any of you using POI that would like more detail on 
what some of these variables are.  I know I found it very helpful.
http://www.koffice.org/developer/apidocs/filters/html/mswordgenerated_8h-source.html

Sincerely,
Tim Forbis



-Original Message-
From: Lee, Insoo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 9:39 AM
To: 'POI Users List'
Subject: RE: question

Hi,
Sorry for emailing you directly... It's been really hard to get a hold of
someone who knows HWPF...
I am trying to create a new word doc with a table in it..
Could you please give me a quick pointer on how to do it?
Table class doesn't seem to have a public constructor...

Thanks
Insoo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: question

2004-07-28 Thread wolfgang unger
Hi Insoo,
I failed on this problem also so far...
I felt doing the right thing, but the word doc
is corrupt after inserting the table.
I look for my source, but it may take a little bit, I'm
busy.
The construction of the table-class was not the problem..
If i have a solution, I'll let you know..
Would you do the same for me?
regards wolfgang

> Hi,
> Sorry for emailing you directly... It's been really hard to get a hold of
> someone who knows HWPF...
> I am trying to create a new word doc with a table in it..
> Could you please give me a quick pointer on how to do it?
> Table class doesn't seem to have a public constructor...
> 
> Thanks
> Insoo
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question

2004-07-28 Thread Lee, Insoo
Thank you very much for taking time to reply back.

Could you please tell me what I'm doing is correct (looking to create a new
doc with a table)

1. 
//create a new HWPFDocument 
//couldn't figure out how to do it... Just opening up empty word doc
as a template now..)

HWPFDocument doc = new HWPFDocument(new
FileInputStream("template.doc"));

2. 
// get a Range  - I think there is only 1 Range per document?
Range r = doc.getRange();

3.  // get a section - not sure if this step is necessary Only 1
section avaialble per doc?
Section s = r.getSection( 0 );

4.  // instanciate a ParagraphProperties and set relevant properties
ParagraphProperties pp = new ParagraphProperties();

5.  // add it to the section.
s.insertBefore or After ( ... )

6.  // save it to a new file
doc.write(new FileOutputStream("out.doc"));


-Original Message-
From: Tim Forbis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 10:56 AM
To: 'POI Users List'
Subject: RE: question


Insoo,

The table class does not have a constructor, but most of the variables you
may need are in the Paragraph Properties class, specifically there is a
variable "fInTable."  Possibly if you set this to true, it would mark that
Paragraph as in a table, and treat it as such.  As far as the end of the
rows, I believe the Property "fTtp" contains only an "end of row" marker the
word will recognize.  For more details, I found this file that detail the
fields more than POI does, but it is in C code, not java. These lines of
code will help you specifically with the Tables.
http://www.koffice.org/developer/apidocs/filters/html/mswordgenerated_8h-sou
rce.html#l03492 

This is also a good resource for any of you using POI that would like more
detail on what some of these variables are.  I know I found it very helpful.
http://www.koffice.org/developer/apidocs/filters/html/mswordgenerated_8h-sou
rce.html

Sincerely,
Tim Forbis



-Original Message-
From: Lee, Insoo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 9:39 AM
To: 'POI Users List'
Subject: RE: question

Hi,
Sorry for emailing you directly... It's been really hard to get a hold of
someone who knows HWPF... I am trying to create a new word doc with a table
in it.. Could you please give me a quick pointer on how to do it? Table
class doesn't seem to have a public constructor...

Thanks
Insoo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question

2004-07-28 Thread Tim Forbis
Insoo, 

That seems correct.  You are correct in Step 2 that there is only one range per 
document  In step number three you asked if there was only one section.  In most 
documents that is true.  But (in word) each time you go to "insert->break->section 
break" you will create a new section, also if you change the page setup (size, 
orientation, etc.) you will create a new section.  But from the pseudocode that you 
have included, this seems to be the correct way.  As I've said before, I've never 
written to a file, only read.  But looking at the methods in the Range class, this 
appears that it will work.
Just a side note, each table cell, as well as the "end of Row" marker, all get their 
own paragraph.  So if you had a table with three columns and five rows, it would 
contain _20_ paragraphs (three for each row + one for the endOfRow).
However, I do not know how it marks the end of cells.  Because, as we know, you can 
have multiple paragrpah in the same cell; and I know POI reflects this when reading.  
You may want to read the Table class to see how it gets the table, so that you may 
understand how it divides the table into cells.

Good luck,
Tim Forbis



-Original Message-
From: Lee, Insoo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 10:18 AM
To: '[EMAIL PROTECTED]'
Cc: 'POI Users List'
Subject: RE: question

Thank you very much for taking time to reply back.

Could you please tell me what I'm doing is correct (looking to create a new
doc with a table)

1. 
//create a new HWPFDocument 
//couldn't figure out how to do it... Just opening up empty word doc
as a template now..)

HWPFDocument doc = new HWPFDocument(new
FileInputStream("template.doc"));

2. 
// get a Range  - I think there is only 1 Range per document?
Range r = doc.getRange();

3.  // get a section - not sure if this step is necessary Only 1
section avaialble per doc?
Section s = r.getSection( 0 );

4.  // instanciate a ParagraphProperties and set relevant properties
ParagraphProperties pp = new ParagraphProperties();

5.  // add it to the section.
s.insertBefore or After ( ... )

6.  // save it to a new file
doc.write(new FileOutputStream("out.doc"));


-Original Message-
From: Tim Forbis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 10:56 AM
To: 'POI Users List'
Subject: RE: question


Insoo,

The table class does not have a constructor, but most of the variables you
may need are in the Paragraph Properties class, specifically there is a
variable "fInTable."  Possibly if you set this to true, it would mark that
Paragraph as in a table, and treat it as such.  As far as the end of the
rows, I believe the Property "fTtp" contains only an "end of row" marker the
word will recognize.  For more details, I found this file that detail the
fields more than POI does, but it is in C code, not java. These lines of
code will help you specifically with the Tables.
http://www.koffice.org/developer/apidocs/filters/html/mswordgenerated_8h-sou
rce.html#l03492 

This is also a good resource for any of you using POI that would like more
detail on what some of these variables are.  I know I found it very helpful.
http://www.koffice.org/developer/apidocs/filters/html/mswordgenerated_8h-sou
rce.html

Sincerely,
Tim Forbis



-Original Message-
From: Lee, Insoo [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 9:39 AM
To: 'POI Users List'
Subject: RE: question

Hi,
Sorry for emailing you directly... It's been really hard to get a hold of
someone who knows HWPF... I am trying to create a new word doc with a table
in it.. Could you please give me a quick pointer on how to do it? Table
class doesn't seem to have a public constructor...

Thanks
Insoo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: question

2006-11-13 Thread Paul Häder

Ann,

when you're dealing with large files like that, you might want to try 
increasing the JVM's maximum heap size with the "-Xmx" option.


Paul

Gossard, Ann L. wrote:


Question: Is POI able to support multiple reading and writing to
different XLS files? I have 3 XLS files, 1 is read only, and I handle
this one by reading in everything I need then closing and doing garbage
collection. The other two are read/write and can get pretty big, i.e.
1000 excel sheets in one doc. I get an 'out-of-memory' exception on the
workbook.write(out);  for the 1000 sheet workbook. The other excel file
has only one sheet but 1000 lines on Sheet1. Suggestions?

If this has come up previously, then please forward to me the suggested
solution.

Thank you,

Ann
 




-
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: question

2006-11-13 Thread Gossard, Ann L.
I tried that. I made it 1G and it still did it.

Thanks for the response. 

-Original Message-
From: Paul Häder [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 13, 2006 1:30 PM
To: POI Users List
Subject: Re: question

Ann,

when you're dealing with large files like that, you might want to try 
increasing the JVM's maximum heap size with the "-Xmx" option.

Paul

Gossard, Ann L. wrote:

>Question: Is POI able to support multiple reading and writing to 
>different XLS files? I have 3 XLS files, 1 is read only, and I handle 
>this one by reading in everything I need then closing and doing garbage 
>collection. The other two are read/write and can get pretty big, i.e.
>1000 excel sheets in one doc. I get an 'out-of-memory' exception on the 
>workbook.write(out);  for the 1000 sheet workbook. The other excel file 
>has only one sheet but 1000 lines on Sheet1. Suggestions?
>
>If this has come up previously, then please forward to me the suggested 
>solution.
>
>Thank you,
>
>Ann
>  
>


-
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: question

2006-11-13 Thread Anthony Andrews
Have you tried forcing the JVM to run the garbage collector before calling the 
write method? I do not know if it will help at all but you can quite quickly 
make the necessary cahnge to your code and run it to check.

"Gossard, Ann L." <[EMAIL PROTECTED]> wrote: I tried that. I made it 1G and it 
still did it.

Thanks for the response. 

-Original Message-
From: Paul Häder [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 13, 2006 1:30 PM
To: POI Users List
Subject: Re: question

Ann,

when you're dealing with large files like that, you might want to try 
increasing the JVM's maximum heap size with the "-Xmx" option.

Paul

Gossard, Ann L. wrote:

>Question: Is POI able to support multiple reading and writing to 
>different XLS files? I have 3 XLS files, 1 is read only, and I handle 
>this one by reading in everything I need then closing and doing garbage 
>collection. The other two are read/write and can get pretty big, i.e.
>1000 excel sheets in one doc. I get an 'out-of-memory' exception on the 
>workbook.write(out);  for the 1000 sheet workbook. The other excel file 
>has only one sheet but 1000 lines on Sheet1. Suggestions?
>
>If this has come up previously, then please forward to me the suggested 
>solution.
>
>Thank you,
>
>Ann
>  
>


-
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/



 
-
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.

RE: question

2006-11-13 Thread Gossard, Ann L.
I have a fix for the moment. The first build of the application I am building 
only requires an excel spreadsheet of 256 pages, to be written. Where I was 
getting 'out-of-memory' exceptions with the POI_2.5.1, I am not getting the 
exception with POI_3.0_alpha2. I will let you know if I experience anything 
like this again.

Thanks everyone.

Ann 

-Original Message-
From: Anthony Andrews [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 13, 2006 2:03 PM
To: POI Users List
Subject: RE: question

Have you tried forcing the JVM to run the garbage collector before calling the 
write method? I do not know if it will help at all but you can quite quickly 
make the necessary cahnge to your code and run it to check.

"Gossard, Ann L." <[EMAIL PROTECTED]> wrote: I tried that. I made it 1G and it 
still did it.

Thanks for the response. 

-Original Message-
From: Paul Häder [mailto:[EMAIL PROTECTED]
Sent: Monday, November 13, 2006 1:30 PM
To: POI Users List
Subject: Re: question

Ann,

when you're dealing with large files like that, you might want to try 
increasing the JVM's maximum heap size with the "-Xmx" option.

Paul

Gossard, Ann L. wrote:

>Question: Is POI able to support multiple reading and writing to 
>different XLS files? I have 3 XLS files, 1 is read only, and I handle 
>this one by reading in everything I need then closing and doing garbage 
>collection. The other two are read/write and can get pretty big, i.e.
>1000 excel sheets in one doc. I get an 'out-of-memory' exception on the 
>workbook.write(out);  for the 1000 sheet workbook. The other excel file 
>has only one sheet but 1000 lines on Sheet1. Suggestions?
>
>If this has come up previously, then please forward to me the suggested 
>solution.
>
>Thank you,
>
>Ann
>  
>


-
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/



 
-
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.

-
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: Question regarding HWPF

2006-04-10 Thread Angelo zerr
Hi,
perhaps you will be interest with RTFTemplate project. RTFTEmplate is RTF to
RTF
engine which is enable to manage RTF model. So you can design your RTF model
with MERGEFIELD
and replace it with your data. See at http://rtftemplate.sourceforge.net/
for more informations.
Regards
Angelo

2006/4/10, Kumar, Karthik <[EMAIL PROTECTED]>:
>
> Hi,
> I need to take a word template, and fill in the "blanks" with real data
> and save it back as a .doc file. Is POI the right way to do it? From
> what I see, POI's support for MS Word files is still very rudimentary
> and undocumented.
> If POI's HWPF is the right way to di it, how do I do it?
> If not, what's the alternative?
> Any help is appreciated.
>
> Karthik Kumar
> MBS/ABS Analytics
> Banc of America Securities, LLC
> (704) 683-5188
>
>
>


Re: Question about drawing charts

2003-08-25 Thread Avik Sengupta

While you can certainly display cells, Charts are very much a work in progress, and so 
not usable right now. 


   ---Original Message---
   > From: Shalab Goel <[EMAIL PROTECTED]>
   > Subject: Question about drawing charts
   > Sent: 25 Aug 2003 23:27:41
   >
   >  Hello Everyone,
   >  
   >  I just joined this list. POI is like a GodSend for me because I have been
   >  looking for a solution to
   >  generate Excel from JSP on the fly. In addition to displaying the cells, I
   >  am also interested in
   >  drawing Charts/Graphs in my generated Excel.
   >  
   >  Can I do that all using HSSF? I will appreciate your feedback.
   >  
   >  Regards
   >  Shalab Goel
   >  
   >  
   >  
   >  
   >  -
   >  To unsubscribe, e-mail: [EMAIL PROTECTED]
   >  For additional commands, e-mail: [EMAIL PROTECTED]
   ---Original Message---




Re: Question about shifting rows

2003-09-09 Thread Avik Sengupta
2.0pre3 is a pre-release version of what is going to be POI version2.0 .
Its got many new features, and while it is stable for many people to use
in production, you have to test that for yourself. Get if from the dev
subdirectory of 'downloads'

On Tue, 2003-09-09 at 15:42, "Нина Маслов" wrote:
> Hi everyone,
> 
> I am new to POI and this list, so forgive me for a stupid question. I am using poi 
> 1.5.1 and I need an ability to shift(insert/remove) rows. Someone mentioned here 
> 2.0-pre3 where they were getting an error doing shiftRows on HSSFSheet. As I 
> undestand 1.5.1 doesn't support shiftRows. So what is 2.0-pre3? And where does one 
> go to get it? :)
> 
> Thanks a lot.
> 
> Nina.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Question on using HSSFDataFormat

2003-10-02 Thread Shawn Laubach
First, you need to direct emails to the poi-users mailing list.  The answer
is yes, you need to be using one of the new versions.  We're currently at
2.0 pre 3.

Shawn
  -Original Message-
  From: Craig Ostovich [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 02, 2003 10:20 AM
  To: [EMAIL PROTECTED]
  Subject: Question on using HSSFDataFormat


  Hi my name is Craig Ostovich, I am new to JAVA and I have been
experimenting with HSSF.  Now that I have learned how to fill the
spreadsheet with data I am attempting to do some custom formatting of date,
time and timestamp fields.  However, it appears as though the methods for
HSSFDataFormat do not exist.

  Attempting to create a custom date format as follows: m/d/ h:mm AM/PM

  Using jar file:  jakarta-poi-1.5.1-final-20020615.jar

  . . . received Java exception "java.lang.NoSuchMethodError: getFormat"
when calling method  "getFormat" with signature "()V" in class
"org.apache.poi.hssf.usermodel.HSSFDataFormat".

  Is there an updated jar file that I should be using?

  I would greatly appreciate any assistance and/or suggestions you could
offer!!


  Thanks much


Re: Question regarding wordxp documents

2004-03-18 Thread Ryan Ackley
I don't know, post a bug to bugzilla and attach the document.

- Original Message - 
From: "Sathyanarayanan, Srinivasan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 18, 2004 7:59 AM
Subject: Question regarding wordxp documents


> All,
>
> I have a wordxp document and I can able to read the document and right it
> back to another document.  But the output contains some illegible text in
it
> when it was written back as a .txt document.  Is this normal behaviour or
am
> I missing something??.
>
> Please clarify,
> Srini
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question regarding wordxp documents

2004-03-18 Thread wan bo
Hi All,

I am new to POI. Currently have a  project need to
write to MS word.If anyone has example in how HWPF
works would be great.

Thanks a lot.

Jane.

__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question on HSSFSheet formating

2004-04-29 Thread Danny Mui
There is a zoom feature I believe you can use to enlarge/shrink the data 
content.

Hope that solves that for ya.

Pavan Guduru wrote:
Hello All,
I have recently started used HSSF. Is there any way I can make the sheet to fit the size of the window on the screen. I know that we can print it to fit in a page, but to view it, can you make an HSSFSheet fit in window , so that it need not be scrolled.
 
I think there is such function available in VB, if VB is used for maipulating the excel files.
 
Any help would be greatly appreciated.
 
Thanks
Meena

		
-
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: question re setCellType(HSSFCell.CELL_TYPE_BLANK)

2004-08-06 Thread Michael Zalewski
A CELL_TYPE_BLANK cell can have formatting applied, such as borders and
background colors.

There is no need to set CELL_TYPE_BLANK if you don't need the formatting (it
would only waste space).

-Original Message-
From: Steve [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 05, 2004 10:42 PM
To: POI Users List
Subject: question re setCellType(HSSFCell.CELL_TYPE_BLANK)


Is it valid to use:   xcell.setCellType(HSSFCell.CELL_TYPE_BLANK);
Is there any reason to do that, rather than simply not creating the cell?

Thanks,
Steve


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Question about Reading from Database

2003-02-04 Thread Amon, Jennifer
look at java.sql and combine that with the hssf stuff. It works quite well.

-Original Message-
From: Qgh Rohgy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 2:14 PM
To: [EMAIL PROTECTED]
Subject: Question about Reading from Database


Hello All,

I am new to POI.

I want to read data from Oracle Tables and insert that
data into an Excel WorkSheet (.xls file)

Could someone please send me a small sample code of
how this could be done??
I basically want to get an idea as to how data can be
read and put in the Excel sheet.


Thanks in advance,
qgh

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This email has been scanned for all known viruses prior to entering the Moen
network. 



This email has been scanned for all known viruses.
___

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Question about POI Excel API

2003-08-10 Thread Michael Zalewski
I know Eclipse (actually SWT) supports OLE objects. But I was unaware that
there was any specific support for Excel. Can you tell me something I don't
know?

(Well... probably you can tell me *lots* I don't know. But can you tell me
about any SWT Excel libraries or articles?)

And one more comment. POI will work better even if it runs on a server where
you *can* install MS-Office. If you run Excel through Automation, you will
be limited to a single thread. And you must use a Security Context that can
use the screen. And many other problems.

Michael Zalewski

-Original Message-
From: Brett Knights [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 1:08 PM
To: 'POI Users List'
Subject: RE: Question about POI Excel API

If your desktop is Windows and you want to push data into Excel then you can
easily do this by calling Excel as an ActiveEx object. There are libs
included with Eclipse to accomplish this.

IMO POI is the tool to use if you want to manipulate Excel spreadsheets on a
server where you don't want to install or can't install MS-Office.

HTH

Brett Knights




-
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: Question about POI Excel API

2003-08-14 Thread Andrew C. Oliver
BTW if you do that on windows (OLE Server), its not in fact multithreaded.

DDE has nothing to do with the scope of POI's HSSF.  That¹s for
communicating WIN 3.0 style with a windows application.  HSSF is a direct
port of the file format.

-andy

On 8/8/03 1:07 PM, "Brett Knights" <[EMAIL PROTECTED]> wrote:

> If your desktop is Windows and you want to push data into Excel then you can
> easily do this by calling Excel as an ActiveEx object. There are libs
> included with Eclipse to accomplish this.
> 
> IMO POI is the tool to use if you want to manipulate Excel spreadsheets on a
> server where you don't want to install or can't install MS-Office.
> 
> HTH
> 
> Brett Knights
> 
>> -Original Message-
>> From: Prashant Patel [mailto:[EMAIL PROTECTED]
>> Sent: Friday, August 08, 2003 9:56 AM
>> To: [EMAIL PROTECTED]
>> Cc: [EMAIL PROTECTED]
>> Subject: Question about POI Excel API
>> 
>> 
>> I am new to POI. We are currently looking for a tool that allows our
>> desktop application (written in Java) to interface with MS Excel. This
>> tool should provide access to most of all features MS excel has. Can I
>> achieve this with POI API? If not, Can anybody tell me which
>> product in
>> the market provides this type of functionalities? I really appreciate
>> any help. Does POI support following features?
>> 
>>  
>> 
>> *Dynamic Data Exchange functionality
>> 
>> * Read/Write comment from/to cell
>> 
>> * Graphs (Whatever Graphs supported by MS excel, are they
>> supported in POI?)
>> 
>> * Read/write/update/create/delete worksheet and workbooks
>> 
>> * Copy/paste data from one worksheet to another
>> 
>> *Copy worksheet from one workbook to another/same workbook
>> 
>> * Assign formula to cell
>> 
>> *Format Cell
>> 
>>  
>> 
>>  
>> 
>> Thanks
>> 
>> Prashant Patel
>> 
>>  
>> 
>> 
> 
> -
> 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/
> 

-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got 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: Question about POI Excel API

2003-08-14 Thread Brett Knights


> -Original Message-
> From: Michael Zalewski [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 4:04 PM
> To: POI Users List
> Subject: RE: Question about POI Excel API
> 
> 
> I know Eclipse (actually SWT) supports OLE objects. But I was 
> unaware that
> there was any specific support for Excel. Can you tell me 
> something I don't
> know?
> 
> (Well... probably you can tell me *lots* I don't know. But 
> can you tell me
> about any SWT Excel libraries or articles?)

Sorry nothing Excel specific. Just the stuff at:
http://www.eclipse.org/articles/Article-ActiveX%20Support%20in%20SWT/ActiveX
%20Support%


> 
> And one more comment. POI will work better even if it runs on 
> a server where
> you *can* install MS-Office. If you run Excel through 
> Automation, you will
> be limited to a single thread. And you must use a Security 
> Context that can
> use the screen. And many other problems.

Recall though this is a desktop app. I did not intend to endorse the use of
Excel on a server.

> 
> -Original Message-
> From: Brett Knights [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 1:08 PM
> To: 'POI Users List'
> Subject: RE: Question about POI Excel API
> 
> If your desktop is Windows and you want to push data into 
> Excel then you can
> easily do this by calling Excel as an ActiveEx object. There are libs
> included with Eclipse to accomplish this.
> 
> IMO POI is the tool to use if you want to manipulate Excel 
> spreadsheets on a
> server where you don't want to install or can't install MS-Office.
> 
> HTH
> 
> Brett Knights
> 
> 
> 
> 
> -
> 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: Question about POI Excel API

2003-08-14 Thread Brett Knights
If your desktop is Windows and you want to push data into Excel then you can
easily do this by calling Excel as an ActiveEx object. There are libs
included with Eclipse to accomplish this.

IMO POI is the tool to use if you want to manipulate Excel spreadsheets on a
server where you don't want to install or can't install MS-Office. 

HTH

Brett Knights

> -Original Message-
> From: Prashant Patel [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 9:56 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Question about POI Excel API
> 
> 
> I am new to POI. We are currently looking for a tool that allows our
> desktop application (written in Java) to interface with MS Excel. This
> tool should provide access to most of all features MS excel has. Can I
> achieve this with POI API? If not, Can anybody tell me which 
> product in
> the market provides this type of functionalities? I really appreciate
> any help. Does POI support following features?
> 
>  
> 
> * Dynamic Data Exchange functionality
> 
> * Read/Write comment from/to cell
> 
> * Graphs (Whatever Graphs supported by MS excel, are they
> supported in POI?)
> 
> * Read/write/update/create/delete worksheet and workbooks
> 
> * Copy/paste data from one worksheet to another 
> 
> * Copy worksheet from one workbook to another/same workbook 
> 
> * Assign formula to cell
> 
> * Format Cell 
> 
>  
> 
>  
> 
> Thanks
> 
> Prashant Patel
> 
>  
> 
> 

-
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: Question concerning Excel Filters and POI...

2002-12-17 Thread Vikas Pathak
Hi,

 U can do this through POI using Java.
If any graph is inside your Spreadsheet u can go for POI using HSSF.Otherwise
u can use jxl.jar to update the Excel Sheet.

Thanks & regards
Kalpana Kanniappan

"Richard S. Huntrods" wrote:

> I am using POI quite happily to create .xls files from my servlet
> application.
>
> However, because of a client request, I must currently perform a manul
> step on each output spreadsheet. The following actions must be
> performed, then the file saved and sent to the user:
>
> open spreadsheet
> select row #4
> click "Data / Filter / Autofilter"
> save the file.
>
> Is there a way to apply this autofilter from within Java using POI?
>
> Thanks in advance,
>
> -Richard
>
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Question concerning Excel Filters and POI...

2002-12-17 Thread Dennis Doubleday
Are you generating Excel from scratch? If you use a template approach
(read the template and fill in data in the appropriate places), then you
could preselect row #4 autofilter in the template.

The template approach also lets you put VBA in your output (I think you
have to be using at least 1.8 or a nightly build for that, though.)

> -Original Message-
> From: Richard S. Huntrods [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, December 16, 2002 3:50 PM
> To: [EMAIL PROTECTED]
> Subject: Question concerning Excel Filters and POI...
> 
> 
> I am using POI quite happily to create .xls files from my servlet 
> application.
> 
> However, because of a client request, I must currently 
> perform a manul 
> step on each output spreadsheet. The following actions must be 
> performed, then the file saved and sent to the user:
> 
> open spreadsheet
> select row #4
> click "Data / Filter / Autofilter"
> save the file.
> 
> Is there a way to apply this autofilter from within Java using POI?
> 
> Thanks in advance,
> 
> -Richard
> 
> 
> --
> To unsubscribe, e-mail:   
>  [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: 
> 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Question concerning Excel Filters and POI...

2002-12-17 Thread Richard S. Huntrods


From: "Dennis Doubleday" <[EMAIL PROTECTED]>

Are you generating Excel from scratch? If you use a template approach
(read the template and fill in data in the appropriate places), then you
could preselect row #4 autofilter in the template.


Yes, I'm generating the file from scratch. Is there an example of the 
template approach? This sounds perfect!

Cheers,

-Richard


The template approach also lets you put VBA in your output (I think you
have to be using at least 1.8 or a nightly build for that, though.)


-Original Message-
From: Richard S. Huntrods [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 16, 2002 3:50 PM
To: [EMAIL PROTECTED]
Subject: Question concerning Excel Filters and POI...


I am using POI quite happily to create .xls files from my servlet 
application.

However, because of a client request, I must currently 
perform a manul 
step on each output spreadsheet. The following actions must be 
performed, then the file saved and sent to the user:

open spreadsheet
select row #4
click "Data / Filter / Autofilter"
save the file.

Is there a way to apply this autofilter from within Java using POI?

Thanks in advance,

-Richard


--
To unsubscribe, e-mail:   
 [EMAIL PROTECTED]>
For 
additional commands, 
e-mail: 


 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Question concerning Excel Filters and POI...

2002-12-18 Thread Richard S. Huntrods
Unfortunately, the template idea will not work. Data/Filter/Autofilter 
must have data in the cell before you can apply it.  You cannot apply 
the autofilter to an empty cell in a template. Therefore, I must still 
create the spreadsheet from scratch, then apply the autofilter.

The question again becomes - is there a way to invoke Excel menu items 
from POI? Specifically, I need to select a row, then apply the data 
"autofilter" to that row.

Thanks,

-Richard


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



RE: Question concerning Excel Filters and POI...

2002-12-18 Thread Dennis Doubleday

> Unfortunately, the template idea will not work. 
> Data/Filter/Autofilter 
> must have data in the cell before you can apply it.  You cannot apply 
> the autofilter to an empty cell in a template. Therefore, I 
> must still 
> create the spreadsheet from scratch, then apply the autofilter.

So put dummy data in the cell in the template. You're going to overwrite
it anyway.

> 
> The question again becomes - is there a way to invoke Excel 
> menu items 
> from POI? Specifically, I need to select a row, then apply the data 
> "autofilter" to that row.

None that I know of, but I'm not an expert yet.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Question concerning Excel Filters and POI...

2002-12-23 Thread Richard S. Huntrods


Unfortunately, the template idea will not work. 
Data/Filter/Autofilter 
must have data in the cell before you can apply it.  You cannot apply 
the autofilter to an empty cell in a template. Therefore, I 
must still 
create the spreadsheet from scratch, then apply the autofilter.
 


So put dummy data in the cell in the template. You're going to overwrite
it anyway.
 

Well, I tried that last night. I have and example (from the POI 
archives) that writes a spreadsheet, or copies an existing spreadsheet, 
or modifies an existing spreadsheet. It all works fine. However, when I 
edited (using excel) a spreadsheet and added the autofilter as per my 
requirements, the POI "spreadsheet copy" function produced something 
that excel cannot open. It appears the autofilter is not something 
currently supported by POI.

Oh well.  I built a one-button macro to do the job in "post 
processing" instead.

-R

 


The question again becomes - is there a way to invoke Excel 
menu items 
from POI? Specifically, I need to select a row, then apply the data 
"autofilter" to that row.
   


None that I know of, but I'm not an expert yet.

 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Question concerning Excel Filters and POI...

2002-12-23 Thread Andrew C. Oliver
the only way this will get fixed is if people send us sample before and 
after trainwrecks and simple code examples reproducing it...

Richard S. Huntrods wrote:



Unfortunately, the template idea will not work.


Data/Filter/Autofilter must have data in the cell before you can 
apply it.  You cannot apply the autofilter to an empty cell in a 
template. Therefore, I must still create the spreadsheet from 
scratch, then apply the autofilter.

 


So put dummy data in the cell in the template. You're going to overwrite
it anyway.
 

Well, I tried that last night. I have and example (from the POI 
archives) that writes a spreadsheet, or copies an existing 
spreadsheet, or modifies an existing spreadsheet. It all works fine. 
However, when I edited (using excel) a spreadsheet and added the 
autofilter as per my requirements, the POI "spreadsheet copy" function 
produced something that excel cannot open. It appears the autofilter 
is not something currently supported by POI.

Oh well.  I built a one-button macro to do the job in "post 
processing" instead.

-R

 


The question again becomes - is there a way to invoke Excel menu 
items from POI? Specifically, I need to select a row, then apply 
the data "autofilter" to that row.

  


None that I know of, but I'm not an expert yet.

 



--
To unsubscribe, e-mail:   

For additional commands, e-mail: 







--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: question getting started making a patch

2003-02-26 Thread Danny Mui
2 ways that i know to fix this:

1) copy junit-3.7.jar to that directory
2) run build from the command line (with ant) and centipede will 
download the jars that it needs.  Isn't that cool?

danny

Melvin Loehr wrote:

Guys,

I have been using POI for a while and love it.  I have decided to try some contributions.  I just checked out the latest source code from cvs (using eclipse).   However, it gives an error in my task list:

Missing required library: 'jakarta-poi/tools/cents/junit.cent/lib/junit-3.7.jar'. jakarta-poi  Build path

Any ideas on what i am doing wrong?  Sorry! I am a newbie

Ruel Loehr

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: question getting started making a patch

2003-02-26 Thread Melvin Loehr
rate-records - generate excel records
 generate-types --- generate word types



BUILD FAILED
F:\finaleclipse\eclipse\workspace\jakarta-poi\build.xml:63: Could not create
t
k or type of type: centipede-user-input.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
 - You have misspelt 'centipede-user-input'.
   Fix: check your spelling.
 - The task needs an external JAR file to execute
   and this is not found at the right place in the classpath.
   Fix: check the documentation for dependencies.
   Fix: declare the task.
 - The task is an Ant optional task and optional.jar is absent
   Fix: look for optional.jar in ANT_HOME/lib, download if needed
 - The task was not built into optional.jar as dependent
   libraries were not found at build time.
   Fix: look in the JAR to verify, then rebuild with the needed
   libraries, or download a release version from apache.org
 - The build file was written for a later version of Ant
   Fix: upgrade to at least the latest release version of Ant
 - The task is not an Ant core or optional task
   and needs to be declared using .

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.

Total time: 4 seconds

F:\finaleclipse\eclipse\workspace\jakarta-poi>
- Original Message -
From: "Danny Mui" <[EMAIL PROTECTED]>
To: "POI Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 10:06 AM
Subject: Re: question getting started making a patch


> 2 ways that i know to fix this:
>
> 1) copy junit-3.7.jar to that directory
> 2) run build from the command line (with ant) and centipede will
> download the jars that it needs.  Isn't that cool?
>
> danny
>
> Melvin Loehr wrote:
>
> >Guys,
> >
> >I have been using POI for a while and love it.  I have decided to try
some contributions.  I just checked out the latest source code from cvs
(using eclipse).   However, it gives an error in my task list:
> >
> >Missing required library:
'jakarta-poi/tools/cents/junit.cent/lib/junit-3.7.jar'. jakarta-poi  Build
path
> >
> >
> >Any ideas on what i am doing wrong?  Sorry! I am a newbie
> >
> >Ruel Loehr
> >
> >
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: question getting started making a patch

2003-02-26 Thread Danny Mui
e\jakarta-poi\build.xml
   --
These are the most common build targets.
You can also invoke them directly; see build.xml for more info.
Builds will be in /build directory, distributions in /dist.
all -- creates the jars and the site
compile -- compiles the source code
test - performs the jUnit tests
jar -- create the jar files
docs - generates the html docs - clean not needed
javadocs - generates the API documentation
site - generates the html site (docs+reports)
clean  cleans the build directory
dist - creates src and bin distributions
scratchpad --- build-run scratchpad code
contrib -- build-run contributed code
generate-records - generate excel records
generate-types --- generate word types


BUILD FAILED
F:\finaleclipse\eclipse\workspace\jakarta-poi\build.xml:63: Could not create
t
k or type of type: centipede-user-input.
Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'centipede-user-input'.
  Fix: check your spelling.
- The task needs an external JAR file to execute
  and this is not found at the right place in the classpath.
  Fix: check the documentation for dependencies.
  Fix: declare the task.
- The task is an Ant optional task and optional.jar is absent
  Fix: look for optional.jar in ANT_HOME/lib, download if needed
- The task was not built into optional.jar as dependent
  libraries were not found at build time.
  Fix: look in the JAR to verify, then rebuild with the needed
  libraries, or download a release version from apache.org
- The build file was written for a later version of Ant
  Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
  and needs to be declared using .
Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath
Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
Total time: 4 seconds

F:\finaleclipse\eclipse\workspace\jakarta-poi>
- Original Message -
From: "Danny Mui" <[EMAIL PROTECTED]>
To: "POI Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 10:06 AM
Subject: Re: question getting started making a patch
 

2 ways that i know to fix this:

1) copy junit-3.7.jar to that directory
2) run build from the command line (with ant) and centipede will
download the jars that it needs.  Isn't that cool?
danny

Melvin Loehr wrote:

   

Guys,

I have been using POI for a while and love it.  I have decided to try
 

some contributions.  I just checked out the latest source code from cvs
(using eclipse).   However, it gives an error in my task list:
 

Missing required library:
 

'jakarta-poi/tools/cents/junit.cent/lib/junit-3.7.jar'. jakarta-poi  Build
path
 

Any ideas on what i am doing wrong?  Sorry! I am a newbie

Ruel Loehr



 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: question getting started making a patch

2003-02-26 Thread Ruel Loehr
Danny your the man.

I got it to build.  Baby steps my friend.

Hey do any of you guys use eclipse to develop this in?  In setup tricks or
tips??

Ruel
- Original Message -
From: "Danny Mui" <[EMAIL PROTECTED]>
To: "POI Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 10:54 AM
Subject: Re: question getting started making a patch


> I remember a nice menu describing the targets that you had below:
>
>  all -- creates the jars and the site
>  compile -- compiles the source code
>  test - performs the jUnit tests
>  jar -- create the jar files
>  docs - generates the html docs - clean not needed
>  javadocs - generates the API documentation
>  site - generates the html site (docs+reports)
>  clean  cleans the build directory
>  dist - creates src and bin distributions
>  scratchpad --- build-run scratchpad code
>  contrib -- build-run contributed code
>  generate-records - generate excel records
>  generate-types --- generate word types
>
> running build.bat/build.sh without targets got that error for me.
>
> Use a target and you should be golden.
>
> i.e.
>
> build compile
>
> or
>
> build all
>
> or even better
>
> build test
>
>
>
> Melvin Loehr wrote:
>
> >Very cool.
> >
> >But i have to admit i am being a dumb-dumb today.   I  tried running
> >build.bat but it fails.  Any clues?  I am sure some of you have ran
across
> >this before...
> >
> >Ruel Loehr
> >IBM
> >
> >
> >-cent-unjar-expand:
> >Expanding
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\checkstyle
> >ent.jar...
> >Expanding:
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\checkstyl
> >cent.jar into F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents
> >...
>
>F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\checkstyle.cent.
> >r expanded in checkstyle.
> >
> >-cent-unjar-expand:
> >Expanding
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\forrest.ce
> >.jar...
> >Expanding:
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\forrest.c
> >t.jar into F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents
> >...
>
>F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\forrest.cent.jar
> >xpanded in forrest.
> >
> >-cent-unjar-expand:
> >Expanding
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\javasrc.ce
> >.jar...
> >Expanding:
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\javasrc.c
> >t.jar into F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents
> >...
>
>F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\javasrc.cent.jar
> >xpanded in javasrc.
> >
> >-cent-unjar-expand:
> >Expanding
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\jdepend.ce
> >.jar...
> >Expanding:
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\jdepend.c
> >t.jar into F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents
> >...
>
>F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\jdepend.cent.jar
> >xpanded in jdepend.
> >
> >-cent-unjar-expand:
> >Expanding
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\junit.cent
> >ar...
> >Expanding:
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\junit.cen
> >jar into F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents
> >...
F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\junit.cent.jar
> >e
> >anded in junit.
> >
> >-cent-unjar-expand:
> >Expanding
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\umldoclet.
> >nt.jar...
> >Expanding:
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\umldoclet
> >ent.jar into F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents
> >...
>
>F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\umldoclet.cent.j
> > expanded in umldoclet.
> >Deleting directory
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\M
> >A-INF
> >
> >-prepare-src:
> >Created dir: F:\finaleclipse\eclipse\workspace\jakarta-poi\build\java
> >Created dir: F:\finaleclipse\eclipse\workspace\jakarta-poi\build\classes
> >Copying 319 files to
> >F:\finaleclipse\eclipse\workspace\jakarta-poi\build\java
> >Created dir:
> >F:\finaleclipse\eclipse\workspace\jakar

Re: question getting started making a patch

2003-02-26 Thread Danny Mui
I use eclipse,  I like it a lot.

Haven't had many problems, i use cvs from the command line and build 
from there too.

I think Avik checked in a .project file at the root ;).

One trick, when running (and writing hopefully!!) the unit tests, we 
place existing excel files in 
jakarta-poi/src/testcases/org/apache/poi/hssf/data and retrieve it by 
using  System.getProperty("HSSF.testdata.path");  To set this path when 
running a unit test from Eclipse, add a *VM* property (the lower box):

-DHSSF.testdata.path=W:\\jakarta-poi\\src\\testcases\\org\\apache\\poi\\hssf\\data

That's the only trick I know!

danny

Ruel Loehr wrote:

Danny your the man.

I got it to build.  Baby steps my friend.

Hey do any of you guys use eclipse to develop this in?  In setup tricks or
tips??
Ruel
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: question getting started making a patch

2003-03-03 Thread Andrew C. Oliver
end.cent.jar
is
todate with respect to jdepend.
No need to expand it.
-cent-unjar-keep:
F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\junit.cent.jar 
is
up
date with respect to junit.
No need to expand it.

-cent-unjar-keep:
F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\cents\umldoclet.cent.jar
i
uptodate with respect to umldoclet.
No need to expand it.
Deleting:
F:\finaleclipse\eclipse\workspace\jakarta-poi\tools\tmp\tasks.proper
es
interactive:

   --

 jakarta-poi 1.11   [2003]

   --
Using Apache Ant version 1.5alpha compiled on April 2 2002
Build file F:\finaleclipse\eclipse\workspace\jakarta-poi\build.xml
   --
These are the most common build targets.
You can also invoke them directly; see build.xml for more info.
Builds will be in /build directory, distributions in /dist.
all -- creates the jars and the site
compile -- compiles the source code
test - performs the jUnit tests
jar -- create the jar files
docs - generates the html docs - clean not needed
javadocs - generates the API documentation
site - generates the html site (docs+reports)
clean  cleans the build directory
dist - creates src and bin distributions
scratchpad --- build-run scratchpad code
contrib -- build-run contributed code
generate-records - generate excel records
generate-types --- generate word types


BUILD FAILED
F:\finaleclipse\eclipse\workspace\jakarta-poi\build.xml:63: Could not 
create
t
k or type of type: centipede-user-input.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'centipede-user-input'.
  Fix: check your spelling.
- The task needs an external JAR file to execute
  and this is not found at the right place in the classpath.
  Fix: check the documentation for dependencies.
  Fix: declare the task.
- The task is an Ant optional task and optional.jar is absent
  Fix: look for optional.jar in ANT_HOME/lib, download if needed
- The task was not built into optional.jar as dependent
  libraries were not found at build time.
  Fix: look in the JAR to verify, then rebuild with the needed
  libraries, or download a release version from apache.org
- The build file was written for a later version of Ant
  Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
  and needs to be declared using .
Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath
Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
Total time: 4 seconds

F:\finaleclipse\eclipse\workspace\jakarta-poi>
- Original Message -
From: "Danny Mui" <[EMAIL PROTECTED]>
To: "POI Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 10:06 AM
Subject: Re: question getting started making a patch
 

2 ways that i know to fix this:

1) copy junit-3.7.jar to that directory
2) run build from the command line (with ant) and centipede will
download the jars that it needs.  Isn't that cool?
danny

Melvin Loehr wrote:

  

Guys,

I have been using POI for a while and love it.  I have decided to try


some contributions.  I just checked out the latest source code from cvs
(using eclipse).   However, it gives an error in my task list:
 

Missing required library:


'jakarta-poi/tools/cents/junit.cent/lib/junit-3.7.jar'. jakarta-poi  
Build
path
 

Any ideas on what i am doing wrong?  Sorry! I am a newbie

Ruel Loehr






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: question about single cell named ranges

2003-10-22 Thread Avik Sengupta
This might be a bug.. i'll check. 

On Tue, 2003-10-21 at 01:46, Michael Hollander wrote:
> hi --
> 
> i would like to create name in the spreadsheet that only spans a single cell, such 
> as Sheet0!$A$1.
> 
> String sheetName = "Sheet0";
> HSSFName name = book.createName();
> name.setNameName("cellName");
> name.setReference(sheetName + "!$A$1");
> 
> i'm getting an exception when i call this.  it looks like this:
> 
> * java.lang.ArrayIndexOutOfBoundsException: 1 
> * at org.apache.poi.hssf.record.formula.Area3DPtg.setArea(Area3DPtg.java:285) 
> * at org.apache.poi.hssf.record.NameRecord.setAreaReference(NameRecord.java:694) 
> * at org.apache.poi.hssf.usermodel.HSSFName.setReference(HSSFName.java:165) 
> * at 
> com.amaranth.spread.XlsValueAccessTest.configureBook(XlsValueAccessTest.java:117) 
> * at 
> com.amaranth.spread.XlsValueAccessTest.testPositionSetValueGetValueDate(XlsValueAccessTest.java:90)
>  
> * at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
> * at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> * at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>  
> 
> if i set the reference to "!$A1:$A1" then i don't get the error, and i can use the 
> named cell.  however, this is inconsistent to how my client wants to see things.  
> any hints?
> 
> 
> 
> CONFIDENTIALITY AND SECURITY NOTICE:
> 
> This e-mail, including any attachments, may contain confidential and proprietary 
> information and may be legally privileged or otherwise protected by law. It may be 
> read and used solely by the intended recipient(s), and any review, use or 
> distribution by others is strictly prohibited. If you are not an intended recipient, 
> please notify us immediately by replying to the sender and delete this e-mail, 
> including any attachments, from your system immediately without reading, copying or 
> distributing them. Thank you for your cooperation.
> 
> Amaranth and its affiliates retain all proprietary rights they may have in the 
> information. We cannot give any assurances that this e-mail or any attachments are 
> free of viruses or other harmful code. We reserve the right to monitor, intercept 
> and block all communications involving our computer systems.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: question about single cell named ranges

2004-01-16 Thread Paulo L. de Carvalho
Marot Laurent wrote:
Hi guys,

i 'm facing the problem below when trying to set a name to a cell 

i get this exception trying the code below
java.lang.ArrayIndexOutOfBoundsException: 1 at org.apache.poi.hssf.record.formula.Area3DPtg.setArea(Area3DPtg.java:285) at org.apache.poi.hssf.record.NameRecord.setAreaReference(NameRecord.java:747) at org.apache.poi.hssf.usermodel.HSSFName.setReference(HSSFName.java:164) at org.apache.jsp.Excel_jsp._jspService(Excel_jsp.java:72) 



wb.setSheetName(0,"Catalogue");
wb.setSheetName(1,"HW per Site");
HSSFName nomTest = wb.createName();
nomTest.setNameName("test");
nomTest.setReference("Catalogue!$A$1");
Tsa bug.

Try a workaround:

nomTest.setReference("Catalogue!$A$1:$A$1");

PC



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: question about single cell named ranges

2004-01-16 Thread Marot Laurent
i've just tried it.

i get no more runtime exception but Excel crashed when i try to open the file: just a 
warning "file error: data may be lost ..."

-Message d'origine-
De : Paulo L. de Carvalho [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 16 janvier 2004 13:54
À : [EMAIL PROTECTED]
Objet : Re: question about single cell named ranges


Marot Laurent wrote:
>> Hi guys,
>> 
>> i 'm facing the problem below when trying to set a name to a cell 
>> 
>> i get this exception trying the code below
>> java.lang.ArrayIndexOutOfBoundsException: 1 at 
>> org.apache.poi.hssf.record.formula.Area3DPtg.setArea(Area3DPtg.java:285) at 
>> org.apache.poi.hssf.record.NameRecord.setAreaReference(NameRecord.java:747) at 
>> org.apache.poi.hssf.usermodel.HSSFName.setReference(HSSFName.java:164) at 
>> org.apache.jsp.Excel_jsp._jspService(Excel_jsp.java:72) 
>> 
>> 
>> 
>> wb.setSheetName(0,"Catalogue");
>> wb.setSheetName(1,"HW per Site");
>> 
>> HSSFName nomTest = wb.createName();
>> nomTest.setNameName("test");
>> nomTest.setReference("Catalogue!$A$1");

Tsa bug.

Try a workaround:

nomTest.setReference("Catalogue!$A$1:$A$1");


PC



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Question about Cell Styles in Excell

2004-05-11 Thread Munishwar Singh Bajwa, Noida
hello ppl, 

I have a assignment to convert a dynamically generated jsp page to excel .
I've been able to obtain the same use the following code snippet ...

response.setContentType("application/vnd.ms-excel");
response.setHeader(
"Content-Disposition","inline; filename=report.xls");

My problem however was that my jsp page table was basically a report having
product list which included product images (jpg/gif) . When i used this code
the pictures were coming fine , but my actual requirement was to obtain the
excel as an attachment i.e using

response.setContentType("application/vnd.ms-excel");
response.setHeader(
"Content-Disposition","attachment; filename=report.xls");

so that the open/save dialogue box could be shown to the user .However using
the later code snippet, the pictures in the excel sheet could not be
obtained. Could some-one please tell me how to go about with this problem so
that the excel file having the table and images could be displayed as well
as the dialogue box for save/open be displayed to the user so that he can
decide accordingly.

Thanks !
Munishwar


Disclaimer: 

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Question about Cell Styles in Excell

2004-05-11 Thread Marot Laurent
Hi Guys,

I think that template using is the easyest way to create an maintain High-level 
formated cells in sheets.

Just one problem encountered : when i have two differents font style in a single 
sample, POI usage will erased the second style used;

Has someone already noticed this problem ?


-Message d'origine-
De : Karl-Heinz Zengerle [mailto:[EMAIL PROTECTED]
Envoyé : mardi 11 mai 2004 10:29
À : 'POI Users List'
Objet : AW: Question about Cell Styles in Excell


Hi Felipe.

If you use a template and it's is already preformatted on cell level you
needn't do anything. If cells are newly created (e.g. just formatting a
whole row in the template) cells are newly created (and a style doesn't
apply then).

Directly in POI you might be right.

Regards,Karl-Heinz.

-Ursprüngliche Nachricht-
Von: Felipe Castro [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 10. Mai 2004 23:44
An: [EMAIL PROTECTED]
Betreff: Question about Cell Styles in Excell

Hi,

Let me see if I get it straight. Please suppose I have a simple table
with 1 title row, two data rows and 6 columns. Each of these rows has
it's own fill color and each of the data columns has it's own data
format (the title row is, of course, formed of strings). If the only way
to set a fill color and data format is by a cell style, does that mean
that I have to create 6 * 2 + 1 = 13 different cell styles to accomplish
the desired format? Is that right?

Thanks,

Felipe


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about Cell Styles in Excell

2004-05-11 Thread Felipe Castro
Thank you for all your feedback..

Yes... I'm just trying to alternate colors on data rows. The need to
create different styles for each cell almost makes impracticable the use of
POI for decently formatted sheets. Maybe POI could think of some kind of
style hierarchy or, at least, implement the "clone" method in the
HSSFCellStyle class. If one could clone a style, he could change only the
cell data format and wouldn't need to reset all style properties for each
cell with a different format.

I'm not sure but I thought of that in less than 5 minutes... There must
be a good reason for not implementing it.

As for templates, I don't know exactly how to use them. Should I create
an empty 2 line table (in the template) and use POI to get those lines
styles and aply them to new cells?

Thanks again,

Felipe

- Original Message - 
From: "Mehner, Björn" <[EMAIL PROTECTED]>
To: "POI Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 4:38 AM
Subject: AW: Question about Cell Styles in Excell


>
>
> > Let me see if I get it straight. Please suppose I have a
> > simple table with 1 title row, two data rows and 6 columns.
> > Each of these rows has it's own fill color and each of the
> > data columns has it's own data format (the title row is, of
> > course, formed of strings). If the only way to set a fill
> > color and data format is by a cell style, does that mean that
> > I have to create 6 * 2 + 1 = 13 different cell styles to
> > accomplish the desired format? Is that right?
>
> Unfortunately I think you are right. Do you really have to have
> different colors each data row? Sounds strange to me. What are you doing
> if the table has more than 2 rows? Alternating colours?
>
> ciao Bodo
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about Cell Styles in Excell

2004-05-11 Thread Felipe Castro
I see, but I don't know beforehand how many rows I'll write. Also, the
"table" I'm trying to write should be "centered" on the sheet for
readability. I don't use the upper, lower, left and rightmost rows and
columns of my sheet. I don't know if templates would help...


- Original Message - 
From: "Karl-Heinz Zengerle" <[EMAIL PROTECTED]>
To: "'POI Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 11:49 AM
Subject: AW: Question about Cell Styles in Excell


> Hi Felipe.
>
> In Excel you can also set styles for whole rows or columns and then
> override some styles of specific cells (e.g. header cells). So it should
> also be possible in POI. This way the quantity of settings should be
> small.
>
> When I hear alternating styles I'ld first think about styles on higher
> level.
>
> Regards, Karl-Heinz.
>
>
> -Ursprüngliche Nachricht-
> Von: Felipe Castro [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 11. Mai 2004 16:39
> An: POI Users List
> Betreff: Re: Question about Cell Styles in Excell
>
> Thank you for all your feedback..
>
> Yes... I'm just trying to alternate colors on data rows. The need to
> create different styles for each cell almost makes impracticable the use
> of
> POI for decently formatted sheets. Maybe POI could think of some kind of
> style hierarchy or, at least, implement the "clone" method in the
> HSSFCellStyle class. If one could clone a style, he could change only
> the
> cell data format and wouldn't need to reset all style properties for
> each
> cell with a different format.
>
> I'm not sure but I thought of that in less than 5 minutes... There
> must
> be a good reason for not implementing it.
>
> As for templates, I don't know exactly how to use them. Should I
> create
> an empty 2 line table (in the template) and use POI to get those lines
> styles and aply them to new cells?
>
> Thanks again,
>
> Felipe
>
> - Original Message - 
> From: "Mehner, Björn" <[EMAIL PROTECTED]>
> To: "POI Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, May 11, 2004 4:38 AM
> Subject: AW: Question about Cell Styles in Excell
>
>
> >
> >
> > > Let me see if I get it straight. Please suppose I have a
> > > simple table with 1 title row, two data rows and 6 columns.
> > > Each of these rows has it's own fill color and each of the
> > > data columns has it's own data format (the title row is, of
> > > course, formed of strings). If the only way to set a fill
> > > color and data format is by a cell style, does that mean that
> > > I have to create 6 * 2 + 1 = 13 different cell styles to
> > > accomplish the desired format? Is that right?
> >
> > Unfortunately I think you are right. Do you really have to have
> > different colors each data row? Sounds strange to me. What are you
> doing
> > if the table has more than 2 rows? Alternating colours?
> >
> > ciao Bodo
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Question about Cell Styles in Excell

2004-05-11 Thread Ling, Curtis
I'm still pretty new at HSSF, so this might be a dumb suggestion, but isn't
it possible to define only three styles (one for the header row, one for odd
rows, one for even), and then reuse those styles?

So ... The code/pseudocode might look like ...

HSSFCellStyle  HeadStyle = Workbook.createCellStyle();
HSSFCellStyle  OddStyle = Workbook.createCellStyle();
HSSFCellStyle  EvenStyle = Workbook.createCellStyle();

HeadStyle.setFillBackgroundColor(HSSFCellStyle.RED);
OddStyle.setFillBackgroundColor(HSSFCellStyle.GREEN);
EvenStyle.setFillBackgroundColor(HSSFCellStyle.BLUE);

...

if ( (HSSFRow.getRowNum() mod 2) == 0)
  Cell.setCellStyle(EvenStyle);
else
  Cell.setCellStyle(OddStyle);

...


?

Curtis

-Original Message-
From: Felipe Castro [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 11, 2004 9:06 AM
To: POI Users List
Subject: Re: Question about Cell Styles in Excell


I see, but I don't know beforehand how many rows I'll write. Also, the
"table" I'm trying to write should be "centered" on the sheet for
readability. I don't use the upper, lower, left and rightmost rows and
columns of my sheet. I don't know if templates would help...


- Original Message - 
From: "Karl-Heinz Zengerle" <[EMAIL PROTECTED]>
To: "'POI Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 11:49 AM
Subject: AW: Question about Cell Styles in Excell


> Hi Felipe.
>
> In Excel you can also set styles for whole rows or columns and then
> override some styles of specific cells (e.g. header cells). So it should
> also be possible in POI. This way the quantity of settings should be
> small.
>
> When I hear alternating styles I'ld first think about styles on higher
> level.
>
> Regards, Karl-Heinz.
>
>
> -Ursprüngliche Nachricht-
> Von: Felipe Castro [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 11. Mai 2004 16:39
> An: POI Users List
> Betreff: Re: Question about Cell Styles in Excell
>
> Thank you for all your feedback..
>
> Yes... I'm just trying to alternate colors on data rows. The need to
> create different styles for each cell almost makes impracticable the use
> of
> POI for decently formatted sheets. Maybe POI could think of some kind of
> style hierarchy or, at least, implement the "clone" method in the
> HSSFCellStyle class. If one could clone a style, he could change only
> the
> cell data format and wouldn't need to reset all style properties for
> each
> cell with a different format.
>
> I'm not sure but I thought of that in less than 5 minutes... There
> must
> be a good reason for not implementing it.
>
> As for templates, I don't know exactly how to use them. Should I
> create
> an empty 2 line table (in the template) and use POI to get those lines
> styles and aply them to new cells?
>
> Thanks again,
>
> Felipe
>
> - Original Message - 
> From: "Mehner, Björn" <[EMAIL PROTECTED]>
> To: "POI Users List" <[EMAIL PROTECTED]>
> Sent: Tuesday, May 11, 2004 4:38 AM
> Subject: AW: Question about Cell Styles in Excell
>
>
> >
> >
> > > Let me see if I get it straight. Please suppose I have a
> > > simple table with 1 title row, two data rows and 6 columns.
> > > Each of these rows has it's own fill color and each of the
> > > data columns has it's own data format (the title row is, of
> > > course, formed of strings). If the only way to set a fill
> > > color and data format is by a cell style, does that mean that
> > > I have to create 6 * 2 + 1 = 13 different cell styles to
> > > accomplish the desired format? Is that right?
> >
> > Unfortunately I think you are right. Do you really have to have
> > different colors each data row? Sounds strange to me. What are you
> doing
> > if the table has more than 2 rows? Alternating colours?
> >
> > ciao Bodo
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question about Cell Styles in Excell

2004-05-11 Thread Felipe Castro
Hi Curtis,

Yes... the problem here is that each column has it's own data format. The
data format is also specified in the style so you end up with (2 * number of
columns) styles. I still think that a better approach would be to have the
"clone()" method implemented.

- Original Message - 
From: "Ling, Curtis" <[EMAIL PROTECTED]>
To: "'POI Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 12:21 PM
Subject: RE: Question about Cell Styles in Excell


> I'm still pretty new at HSSF, so this might be a dumb suggestion, but
isn't
> it possible to define only three styles (one for the header row, one for
odd
> rows, one for even), and then reuse those styles?
>
> So ... The code/pseudocode might look like ...
>
> HSSFCellStyle  HeadStyle = Workbook.createCellStyle();
> HSSFCellStyle  OddStyle = Workbook.createCellStyle();
> HSSFCellStyle  EvenStyle = Workbook.createCellStyle();
>
> HeadStyle.setFillBackgroundColor(HSSFCellStyle.RED);
> OddStyle.setFillBackgroundColor(HSSFCellStyle.GREEN);
> EvenStyle.setFillBackgroundColor(HSSFCellStyle.BLUE);
>
> ...
>
> if ( (HSSFRow.getRowNum() mod 2) == 0)
>   Cell.setCellStyle(EvenStyle);
> else
>   Cell.setCellStyle(OddStyle);
>
> ...
>
>
> ?
>
> Curtis
>
> -----Original Message-
> From: Felipe Castro [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 11, 2004 9:06 AM
> To: POI Users List
> Subject: Re: Question about Cell Styles in Excell
>
>
> I see, but I don't know beforehand how many rows I'll write. Also, the
> "table" I'm trying to write should be "centered" on the sheet for
> readability. I don't use the upper, lower, left and rightmost rows and
> columns of my sheet. I don't know if templates would help...
>
>
> - Original Message - 
> From: "Karl-Heinz Zengerle" <[EMAIL PROTECTED]>
> To: "'POI Users List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, May 11, 2004 11:49 AM
> Subject: AW: Question about Cell Styles in Excell
>
>
> > Hi Felipe.
> >
> > In Excel you can also set styles for whole rows or columns and then
> > override some styles of specific cells (e.g. header cells). So it should
> > also be possible in POI. This way the quantity of settings should be
> > small.
> >
> > When I hear alternating styles I'ld first think about styles on higher
> > level.
> >
> > Regards, Karl-Heinz.
> >
> >
> > -Ursprüngliche Nachricht-
> > Von: Felipe Castro [mailto:[EMAIL PROTECTED]
> > Gesendet: Dienstag, 11. Mai 2004 16:39
> > An: POI Users List
> > Betreff: Re: Question about Cell Styles in Excell
> >
> > Thank you for all your feedback..
> >
> > Yes... I'm just trying to alternate colors on data rows. The need to
> > create different styles for each cell almost makes impracticable the use
> > of
> > POI for decently formatted sheets. Maybe POI could think of some kind of
> > style hierarchy or, at least, implement the "clone" method in the
> > HSSFCellStyle class. If one could clone a style, he could change only
> > the
> > cell data format and wouldn't need to reset all style properties for
> > each
> > cell with a different format.
> >
> > I'm not sure but I thought of that in less than 5 minutes... There
> > must
> > be a good reason for not implementing it.
> >
> > As for templates, I don't know exactly how to use them. Should I
> > create
> > an empty 2 line table (in the template) and use POI to get those lines
> > styles and aply them to new cells?
> >
> > Thanks again,
> >
> > Felipe
> >
> > - Original Message - 
> > From: "Mehner, Björn" <[EMAIL PROTECTED]>
> > To: "POI Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, May 11, 2004 4:38 AM
> > Subject: AW: Question about Cell Styles in Excell
> >
> >
> > >
> > >
> > > > Let me see if I get it straight. Please suppose I have a
> > > > simple table with 1 title row, two data rows and 6 columns.
> > > > Each of these rows has it's own fill color and each of the
> > > > data columns has it's own data format (the title row is, of
> > > > course, formed of strings). If the only way to set a fill
> > > > color and data format is by a cell style, does that mean that
> > > > I have to create 6 * 2 + 1 = 13 different cell styles to
> > > > accomplish the desired fo

Re: Question about Cell Styles in Excell

2004-05-17 Thread Danny Mui
Actually there is a row background color feature that has been requested 
before.  Try voting for that bug if that will help you.  Maybe some 
contributor (or even yourself) will take a crack at it then!

Felipe Castro wrote:
Hi Curtis,
Yes... the problem here is that each column has it's own data format. The
data format is also specified in the style so you end up with (2 * number of
columns) styles. I still think that a better approach would be to have the
"clone()" method implemented.
- Original Message - 
From: "Ling, Curtis" <[EMAIL PROTECTED]>
To: "'POI Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 12:21 PM
Subject: RE: Question about Cell Styles in Excell


I'm still pretty new at HSSF, so this might be a dumb suggestion, but
isn't
it possible to define only three styles (one for the header row, one for
odd
rows, one for even), and then reuse those styles?
So ... The code/pseudocode might look like ...
HSSFCellStyle  HeadStyle = Workbook.createCellStyle();
HSSFCellStyle  OddStyle = Workbook.createCellStyle();
HSSFCellStyle  EvenStyle = Workbook.createCellStyle();
HeadStyle.setFillBackgroundColor(HSSFCellStyle.RED);
OddStyle.setFillBackgroundColor(HSSFCellStyle.GREEN);
EvenStyle.setFillBackgroundColor(HSSFCellStyle.BLUE);
...
if ( (HSSFRow.getRowNum() mod 2) == 0)
 Cell.setCellStyle(EvenStyle);
else
 Cell.setCellStyle(OddStyle);
...
?
Curtis
-Original Message-
From: Felipe Castro [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 9:06 AM
To: POI Users List
Subject: Re: Question about Cell Styles in Excell
I see, but I don't know beforehand how many rows I'll write. Also, the
"table" I'm trying to write should be "centered" on the sheet for
readability. I don't use the upper, lower, left and rightmost rows and
columns of my sheet. I don't know if templates would help...
- Original Message - 
From: "Karl-Heinz Zengerle" <[EMAIL PROTECTED]>
To: "'POI Users List'" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 11:49 AM
Subject: AW: Question about Cell Styles in Excell


Hi Felipe.
In Excel you can also set styles for whole rows or columns and then
override some styles of specific cells (e.g. header cells). So it should
also be possible in POI. This way the quantity of settings should be
small.
When I hear alternating styles I'ld first think about styles on higher
level.
Regards, Karl-Heinz.
-Ursprüngliche Nachricht-
Von: Felipe Castro [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 11. Mai 2004 16:39
An: POI Users List
Betreff: Re: Question about Cell Styles in Excell
   Thank you for all your feedback..
   Yes... I'm just trying to alternate colors on data rows. The need to
create different styles for each cell almost makes impracticable the use
of
POI for decently formatted sheets. Maybe POI could think of some kind of
style hierarchy or, at least, implement the "clone" method in the
HSSFCellStyle class. If one could clone a style, he could change only
the
cell data format and wouldn't need to reset all style properties for
each
cell with a different format.
   I'm not sure but I thought of that in less than 5 minutes... There
must
be a good reason for not implementing it.
   As for templates, I don't know exactly how to use them. Should I
create
an empty 2 line table (in the template) and use POI to get those lines
styles and aply them to new cells?
   Thanks again,
   Felipe
- Original Message - 
From: "Mehner, Björn" <[EMAIL PROTECTED]>
To: "POI Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 4:38 AM
Subject: AW: Question about Cell Styles in Excell



Let me see if I get it straight. Please suppose I have a
simple table with 1 title row, two data rows and 6 columns.
Each of these rows has it's own fill color and each of the
data columns has it's own data format (the title row is, of
course, formed of strings). If the only way to set a fill
color and data format is by a cell style, does that mean that
I have to create 6 * 2 + 1 = 13 different cell styles to
accomplish the desired format? Is that right?
Unfortunately I think you are right. Do you really have to have
different colors each data row? Sounds strange to me. What are you
doing
if the table has more than 2 rows? Alternating colours?
ciao Bodo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Question about Cell Styles in Excell

2004-05-17 Thread Danny Mui
haven't really delved too deeply into your issue but:
1) hmmm...response.reset() common problem in dealing with PDF files 
before you generate your output.  Im going to put that into the FAQ really.

Munishwar Singh Bajwa, Noida wrote:
hello ppl, 

I have a assignment to convert a dynamically generated jsp page to excel .
I've been able to obtain the same use the following code snippet ...
response.setContentType("application/vnd.ms-excel");
response.setHeader(
"Content-Disposition","inline; filename=report.xls");
My problem however was that my jsp page table was basically a report having
product list which included product images (jpg/gif) . When i used this code
the pictures were coming fine , but my actual requirement was to obtain the
excel as an attachment i.e using
response.setContentType("application/vnd.ms-excel");
response.setHeader(
"Content-Disposition","attachment; filename=report.xls");
so that the open/save dialogue box could be shown to the user .However using
the later code snippet, the pictures in the excel sheet could not be
obtained. Could some-one please tell me how to go about with this problem so
that the excel file having the table and images could be displayed as well
as the dialogue box for save/open be displayed to the user so that he can
decide accordingly.
Thanks !
Munishwar
Disclaimer: 

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Question about Emailing Excel file(.xls) from browser

2003-02-04 Thread Michael Zalewski
Are you asking if it is possible have a web application send an .xls format
file as an E-Mail attachment? Or are you asking if it is possible to
download an .xls which can be saved from the client? I guess I don't
understand what you mean by 'the browser excel format'.

Either one is possible. But I don't think you can prevent a user from saving
the .xls if you send it by setting
response.setContentType("application/msexcel")

Or are you wanting to download some initial data in a .xls file, have the
user make some additional changes, then save the modified .xls back to the
webserver?

To send the E-Mail attachment, check out commons Email (here at Jakarta).
You will need to instal Java-Mail on your web server, and give your Web
Server access to some SMTP mail server.

To have the user be able to save the sheet you send, you probably need to
implement Web-DAV.  Check out Slide (also here at Jakarta).

To control whether the sheet opens inside Internet Explorer or launches
Excel in another window -- that is a client browser setting. I think the
default is to open the sheet inside Internet Explorer, but it might change
with the various point releases and patches to IE.

-Original Message-
From: Qgh Rohgy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 6:16 PM
To: [EMAIL PROTECTED]
Subject: Question about Emailing Excel file(.xls) from browser


Hello,

Kindly Let me know if this is feasible :-

I am displaying data from a Database table on the
browser in an excel format.
i.e by setting
response.setContentType("application/msexcel");

Once the User is OK with the data he has got, he wants
the same to be emailed to him in an excel sheet format
(i.e xls file).

My Question :-

Is it possible for me to get the excel file .xls from
the data displayed on the browser(which is also in
excel format).??

I know that if I set the
response.setContentType("application/vnd.ms-excel");
I can give user the option to save or open the excel
file.

I do not want the user to save the file directly. The
file needs to be emailed to him along with some other
files.

Hence, again, my question is - is it possible to write
to an excel file directly from the browser excel
format.
How could this be done?

Thanks much,
qgh



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Question about Emailing Excel file(.xls) from browser

2003-02-05 Thread Brian Glick
I think what you would want to do is the following:

1) Create the xls file on the server
2) Serve the file to the browser
3) If the user likes the data, email the file that resides on the server
4) Delete the file from the server.

Brian Glick
Freightek, Inc.
(215) 887-6100
[EMAIL PROTECTED]

-Original Message-
From: Qgh Rohgy [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 04, 2003 6:16 PM
To: [EMAIL PROTECTED]
Subject: Question about Emailing Excel file(.xls) from browser

Hello,

Kindly Let me know if this is feasible :-

I am displaying data from a Database table on the
browser in an excel format.
i.e by setting
response.setContentType("application/msexcel");

Once the User is OK with the data he has got, he wants
the same to be emailed to him in an excel sheet format
(i.e xls file).

My Question :-

Is it possible for me to get the excel file .xls from
the data displayed on the browser(which is also in
excel format).??

I know that if I set the 
response.setContentType("application/vnd.ms-excel");
I can give user the option to save or open the excel
file.

I do not want the user to save the file directly. The
file needs to be emailed to him along with some other
files.

Hence, again, my question is - is it possible to write
to an excel file directly from the browser excel
format.
How could this be done?

Thanks much,
qgh



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Question about Emailing Excel file(.xls) from browser

2003-02-05 Thread Qgh Rohgy
Hello,

Thanks Brian Glick  and Michael Zalewski for your
replies.
Unfortunately it doesnt answer my questions :(

I am a newbie to this whole reading writing excel and
also to POI. I am trying to find a best solution for
my problem.

I have tried to explain in detail by problem below...

Let me know if you need me to explain my poroblem in
further details.

Thanks much

===
By excel format on the browser,
I mean displaying the contents using
response.setcontent("application/msexcel");

Step 1: 
The user selects some parameters (from couple of
dropdowns) and makes a search. The database is
searched to match the paramters he has selected and
the results are dynamically displayed on in the excel
format on the browser. When the results are displayed,
on the same screen, the user can still make another
search - till the time he is happy with his searched
results.

Step 2:
The user then moves on to other screens to select some
other components.

Step 3:
Finally, after navigation to a couple of screens, he
wants the entire package to be emailed to him. i.e the
Excel Sheet in Step 1 and couple of other files.

Hence,
1) I cannot just display the excel from the server on
the browser. There are tons of other functionalities 
also like 'Searching using the dropdown parameters'
which have to happen on the same screen .

2) Now that the database has been queried for the
parameters and the results are got on the browser, I
do not want to make the same search on the database
just to create the excel sheet to be emailed.

Question:
Hence I ask, is it possible for me to create an excel
file automatically when the user moves on to Step2
from Step 1 above and finally email the same to him?
The excel file needs to be created without querying
the databse again and from the displayed data on the
browser.

I know that the user can still save the excel on his
machine anyways in Step 1 itself. We are fine with
that.
But I want to email him this file along with other
files in Step 3.



--- Brian Glick <[EMAIL PROTECTED]> wrote:
> I think what you would want to do is the following:
> 
> 1) Create the xls file on the server
> 2) Serve the file to the browser
> 3) If the user likes the data, email the file that
> resides on the server
> 4) Delete the file from the server.
> 
> Brian Glick
> Freightek, Inc.
> (215) 887-6100
> [EMAIL PROTECTED]
> 
> -Original Message-
> From: Qgh Rohgy [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, February 04, 2003 6:16 PM
> To: [EMAIL PROTECTED]
> Subject: Question about Emailing Excel file(.xls)
> from browser
> 
> Hello,
> 
> Kindly Let me know if this is feasible :-
> 
> I am displaying data from a Database table on the
> browser in an excel format.
> i.e by setting
> response.setContentType("application/msexcel");
> 
> Once the User is OK with the data he has got, he
> wants
> the same to be emailed to him in an excel sheet
> format
> (i.e xls file).
> 
> My Question :-
> 
> Is it possible for me to get the excel file .xls
> from
> the data displayed on the browser(which is also in
> excel format).??
> 
> I know that if I set the 
> response.setContentType("application/vnd.ms-excel");
> I can give user the option to save or open the excel
> file.
> 
> I do not want the user to save the file directly.
> The
> file needs to be emailed to him along with some
> other
> files.
> 
> Hence, again, my question is - is it possible to
> write
> to an excel file directly from the browser excel
> format.
> How could this be done?
> 
> Thanks much,
> qgh
> 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.com
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 



__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [Question] HSSFSheet, set format to an entire column?

2006-02-24 Thread bchallamel
Ok,

I found old post about this subject.

It seems POI is not ready to do this, but an issue is to use a macro to
set the format for a column
Have a look to this post: Problem with Cell formatting at columns level

Example:

To set all the column X to the format Date:

Sub Macro1()
Columns("X:X").Select
Selection.NumberFormat = "m/d/"
End Sub


It seems with POI, it is not possible to add a macro dynamically in a
workbook, maybe it is, but i didn't find any example.

Any idea?

thx

Benjamin CHALLAMEL


> Hello,
>
> Question about Excel file.
> I'm working with this JAR : poi-2.5.1-final-20040804.jar
> My version of Excel : Excel 2003
>
> I recently posted about loosing style for an HSSFCell(no answer, need more
> details?).
>
>
>
> My new question is about setting the format for an entire column.
>
> Is it possible to set a unique format for an entire column (column B for
> example) using the API?
>
> Because if I set the format to each Cell of a column, Excel after 4000
> cells prompt a warning: “Number of different format to big for Excel”.
> And I'm loosing the format for all cells after the 4000° cell.
>
> Any idea?
>
> Thx in advance.
>
> Benjamin CHALLAMEL
>
> -
> 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: [Question]HSSFRow.getCell(cellNb),loosing border if no data i n the cell

2006-02-07 Thread Donahue, Michael
Benjamin -

If I under stand your question correctly  HSSFCells have both a Cell
Style and Cell Type associated with them.  If you intend to have an empty
cell you should set the Cell Type to HSSFCell.CELL_TYPE_BLANK and create a
Cell Style with the appropriate borders and Data Format, etc.  The HSSFCell
class has get/set methods for the Cell Style, Cell Type, and of course the
Cell Value.  To create a new Cell Style see the
HSSFWorkbook.createCellStyle() method.

I haven't seen this happen before but if you are loosing the formatting
after you update the value of a cell, you could save the Cell Style before
you set the Type and Value and then set it back after you set the Type and
Value to make sure the Cell Style (borders, etc) are set the way you want.

I hope this helps,

- MJD

One somewhat related caveat that is not well documented:  You need to try to
share Cell Styles between all cells with identical formatting.  Do not
create a new Cell Style for each cell you create unless they are truly
formatted uniquely.  This creates a management nightmare if you have very
many Cell Styles, but it's a necessary aspect of the beasties.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006 10:56 AM
To: poi-user@jakarta.apache.org
Subject: [Question]HSSFRow.getCell(cellNb),loosing border if no data in the
cell

Hello,

I'm working with this JAR : poi-2.5.1-final-20040804.jar

My problem is about reading a HSSFCell and loosing the border.

We have a HSSFRow.
I'm getting the value for a HSSFCell from a HSSFRow, with this method:
oneCell = oneRow.getCell((short) cellNb);
For both cases (describe after), there is a border on the specified cell:

1)Case "there is a value in the cell" and a border:

-> "oneRow.getCell((short) cellNb)" return a HSSFCell object, after I can
set an other value
-> the value has a border

2)Case "there is no value in the cell" and a border:

-> "oneRow.getCell((short) cellNb)" return null,
-> I have to create a HSSFCell (oneCell = oneRow.createCell((short)
cellNb)) to set the value
-> I have lost the border.

Do you know if I'm using the API in a wrong way, or maybe the I can get
the Style of a HSSFCell somewhere?

Thanx in advanced.

Benjamin CHALLAMEL


-
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/

 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


-
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: [Question]HSSFRow.getCell(cellNb), loosing border if no data i n the cell

2006-02-08 Thread bchallamel
Thanks for your message Michael,

My problem happens when I read a file (HSSFWorkbook), like using a
template to create my own dynamic Excel file.

For a HSSFWorkbook, and for a HSSFSheet I use a loop to parse each row
(HSSFRow).
To have the HSSFCell, I use this method : oneRow.getCell((short) cellNb)
-If ((the cell has a value inside) && (a style(a border for example)))
{
   I get the correct object HSSFCell with the method  oneRow.getCell( 
(short) cellNb)
}

-If((the cell has NO value)&& (a style(a border for example)))
{
I get the null Object with the method oneRow.getCell((short) cellNb)
To catch the style of this cell, I need to use this method:
HSSFCell.getCellStyle
But it is not possible to apply a method to a null object!
}

I Hope this text makes it more clear.

Benjamin CHALLAMEL


> Benjamin -
>
> If I under stand your question correctly  HSSFCells have both a Cell
> Style and Cell Type associated with them.  If you intend to have an empty
> cell you should set the Cell Type to HSSFCell.CELL_TYPE_BLANK and create a
> Cell Style with the appropriate borders and Data Format, etc.  The
> HSSFCell
> class has get/set methods for the Cell Style, Cell Type, and of course the
> Cell Value.  To create a new Cell Style see the
> HSSFWorkbook.createCellStyle() method.
>
> I haven't seen this happen before but if you are loosing the formatting
> after you update the value of a cell, you could save the Cell Style before
> you set the Type and Value and then set it back after you set the Type and
> Value to make sure the Cell Style (borders, etc) are set the way you want.
>
> I hope this helps,
>
> - MJD
>
> One somewhat related caveat that is not well documented:  You need to try
> to
> share Cell Styles between all cells with identical formatting.  Do not
> create a new Cell Style for each cell you create unless they are truly
> formatted uniquely.  This creates a management nightmare if you have very
> many Cell Styles, but it's a necessary aspect of the beasties.
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 07, 2006 10:56 AM
> To: poi-user@jakarta.apache.org
> Subject: [Question]HSSFRow.getCell(cellNb),loosing border if no data in
> the
> cell
>
> Hello,
>
> I'm working with this JAR : poi-2.5.1-final-20040804.jar
>
> My problem is about reading a HSSFCell and loosing the border.
>
> We have a HSSFRow.
> I'm getting the value for a HSSFCell from a HSSFRow, with this method:
> oneCell = oneRow.getCell((short) cellNb);
> For both cases (describe after), there is a border on the specified cell:
>
> 1)Case "there is a value in the cell" and a border:
>
> -> "oneRow.getCell((short) cellNb)" return a HSSFCell object, after I can
> set an other value
> -> the value has a border
>
> 2)Case "there is no value in the cell" and a border:
>
> -> "oneRow.getCell((short) cellNb)" return null,
> -> I have to create a HSSFCell (oneCell = oneRow.createCell((short)
> cellNb)) to set the value
> -> I have lost the border.
>
> Do you know if I'm using the API in a wrong way, or maybe the I can get
> the Style of a HSSFCell somewhere?
>
> Thanx in advanced.
>
> Benjamin CHALLAMEL
>
>
> -
> 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/
>
> 
> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
> 
>
> -
> 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: [Question]HSSFRow.getCell(cellNb), loosing border if no data i n the cell

2006-02-08 Thread Donahue, Michael
Benjamin -

Ok, the problem is a little different than I had first thought.  In your
case, I think you will need to either figure out which style you are using
in other cells that exist with the desired formatting or you can create a
new HSSFCellStyle that mimics the settings you need and then after you
create the new cells with HSSFCell cell = HSSFRow.createCell(column) you
will need to do a cell.setCellStyle(cellStyleId) to set the proper
formatting.

So, first check to see if the cell exists, if so use it, else if it returns
null then create a new cell and set the value & style.

- MJD

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 08, 2006 3:11 AM
To: POI Users List
Cc: 'POI Users List'
Subject: RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data i
n the cell

Thanks for your message Michael,

My problem happens when I read a file (HSSFWorkbook), like using a
template to create my own dynamic Excel file.

For a HSSFWorkbook, and for a HSSFSheet I use a loop to parse each row
(HSSFRow).
To have the HSSFCell, I use this method : oneRow.getCell((short) cellNb)
-If ((the cell has a value inside) && (a style(a border for example)))
{
   I get the correct object HSSFCell with the method  oneRow.getCell( 
(short) cellNb)
}

-If((the cell has NO value)&& (a style(a border for example)))
{
I get the null Object with the method oneRow.getCell((short) cellNb)
To catch the style of this cell, I need to use this method:
HSSFCell.getCellStyle
But it is not possible to apply a method to a null object!
}

I Hope this text makes it more clear.

Benjamin CHALLAMEL


> Benjamin -
>
> If I under stand your question correctly  HSSFCells have both a Cell
> Style and Cell Type associated with them.  If you intend to have an empty
> cell you should set the Cell Type to HSSFCell.CELL_TYPE_BLANK and create a
> Cell Style with the appropriate borders and Data Format, etc.  The
> HSSFCell
> class has get/set methods for the Cell Style, Cell Type, and of course the
> Cell Value.  To create a new Cell Style see the
> HSSFWorkbook.createCellStyle() method.
>
> I haven't seen this happen before but if you are loosing the formatting
> after you update the value of a cell, you could save the Cell Style before
> you set the Type and Value and then set it back after you set the Type and
> Value to make sure the Cell Style (borders, etc) are set the way you want.
>
> I hope this helps,
>
> - MJD
>
> One somewhat related caveat that is not well documented:  You need to try
> to
> share Cell Styles between all cells with identical formatting.  Do not
> create a new Cell Style for each cell you create unless they are truly
> formatted uniquely.  This creates a management nightmare if you have very
> many Cell Styles, but it's a necessary aspect of the beasties.
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 07, 2006 10:56 AM
> To: poi-user@jakarta.apache.org
> Subject: [Question]HSSFRow.getCell(cellNb),loosing border if no data in
> the
> cell
>
> Hello,
>
> I'm working with this JAR : poi-2.5.1-final-20040804.jar
>
> My problem is about reading a HSSFCell and loosing the border.
>
> We have a HSSFRow.
> I'm getting the value for a HSSFCell from a HSSFRow, with this method:
> oneCell = oneRow.getCell((short) cellNb);
> For both cases (describe after), there is a border on the specified cell:
>
> 1)Case "there is a value in the cell" and a border:
>
> -> "oneRow.getCell((short) cellNb)" return a HSSFCell object, after I can
> set an other value
> -> the value has a border
>
> 2)Case "there is no value in the cell" and a border:
>
> -> "oneRow.getCell((short) cellNb)" return null,
> -> I have to create a HSSFCell (oneCell = oneRow.createCell((short)
> cellNb)) to set the value
> -> I have lost the border.
>
> Do you know if I'm using the API in a wrong way, or maybe the I can get
> the Style of a HSSFCell somewhere?
>
> Thanx in advanced.
>
> Benjamin CHALLAMEL
>
>
> -
> 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/
>
>

> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and f

RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data i n the cell

2006-02-09 Thread bchallamel
Hi Michael,

I thought when the HSSFCell has no value but a style, POI with this method
(Row.getCell((short) cellNb)), should return an object HSSFCell not null
instead of a null object.
And after a getValue() should return null, but a getCellStyle() should
return the HSSFCellStyle not null !
What do you think about this?

I understand what you said before… if the HSSFCell is null, I should
create one with the same style as the cell before for example.

benjamin,
> Benjamin -
>
> Ok, the problem is a little different than I had first thought.  In your
> case, I think you will need to either figure out which style you are using
> in other cells that exist with the desired formatting or you can create a
> new HSSFCellStyle that mimics the settings you need and then after you
> create the new cells with HSSFCell cell = HSSFRow.createCell(column) you
> will need to do a cell.setCellStyle(cellStyleId) to set the proper
> formatting.
>
> So, first check to see if the cell exists, if so use it, else if it
> returns
> null then create a new cell and set the value & style.
>
> - MJD
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 08, 2006 3:11 AM
> To: POI Users List
> Cc: 'POI Users List'
> Subject: RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data
> i
> n the cell
>
> Thanks for your message Michael,
>
> My problem happens when I read a file (HSSFWorkbook), like using a
> template to create my own dynamic Excel file.
>
> For a HSSFWorkbook, and for a HSSFSheet I use a loop to parse each row
> (HSSFRow).
> To have the HSSFCell, I use this method : oneRow.getCell((short) cellNb)
> -If ((the cell has a value inside) && (a style(a border for example)))
> {
>I get the correct object HSSFCell with the method  oneRow.getCell(
> (short) cellNb)
> }
>
> -If((the cell has NO value)&& (a style(a border for example)))
> {
>   I get the null Object with the method oneRow.getCell((short) cellNb)
>   To catch the style of this cell, I need to use this method:
> HSSFCell.getCellStyle
>   But it is not possible to apply a method to a null object!
> }
>
> I Hope this text makes it more clear.
>
> Benjamin CHALLAMEL
>
>
>> Benjamin -
>>
>> If I under stand your question correctly  HSSFCells have both a Cell
>> Style and Cell Type associated with them.  If you intend to have an
>> empty
>> cell you should set the Cell Type to HSSFCell.CELL_TYPE_BLANK and create
>> a
>> Cell Style with the appropriate borders and Data Format, etc.  The
>> HSSFCell
>> class has get/set methods for the Cell Style, Cell Type, and of course
>> the
>> Cell Value.  To create a new Cell Style see the
>> HSSFWorkbook.createCellStyle() method.
>>
>> I haven't seen this happen before but if you are loosing the formatting
>> after you update the value of a cell, you could save the Cell Style
>> before
>> you set the Type and Value and then set it back after you set the Type
>> and
>> Value to make sure the Cell Style (borders, etc) are set the way you
>> want.
>>
>> I hope this helps,
>>
>> - MJD
>>
>> One somewhat related caveat that is not well documented:  You need to
>> try
>> to
>> share Cell Styles between all cells with identical formatting.  Do not
>> create a new Cell Style for each cell you create unless they are truly
>> formatted uniquely.  This creates a management nightmare if you have
>> very
>> many Cell Styles, but it's a necessary aspect of the beasties.
>>
>>
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, February 07, 2006 10:56 AM
>> To: poi-user@jakarta.apache.org
>> Subject: [Question]HSSFRow.getCell(cellNb),loosing border if no data in
>> the
>> cell
>>
>> Hello,
>>
>> I'm working with this JAR : poi-2.5.1-final-20040804.jar
>>
>> My problem is about reading a HSSFCell and loosing the border.
>>
>> We have a HSSFRow.
>> I'm getting the value for a HSSFCell from a HSSFRow, with this method:
>> oneCell = oneRow.getCell((short) cellNb);
>> For both cases (describe after), there is a border on the specified
>> cell:
>>
>> 1)Case "there is a value in the cell" and a border:
>>
>> -> "oneRow.getCell((short) cellNb)" return a HSSFCell object, after I
>> can
>> set an other value
>> -> the value has a border
>>
>> 2)Case "there is no value in the cell&q

RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data i n the cell

2006-02-09 Thread Donahue, Michael

Benjamin -

Ok I think I see where you are confused.

Case 1)   Cell does not exist and you get a null when you request it.
Create and format the cell.

Case 2)   Cell exists.  In this case the Cell can have a number of different
Cell Types such as BOOLEAN, DOUBLE, DATE, NUMERIC, BLANK, etc.  Before you
try and get a value from a cell you need to check the Cell Type so you know
which method to call.  If your Cell Type is HSSFCell.CELL_TYPE_BLANK, then
to add a value, you set the Cell Type to the appropriate Cell Type and then
set the value.  I don't think you need to set the Cell Style after doing
this, but if the formatting is lost for some reason you can do the
setCellStyle(cellStyleId) and you'll be fine.  Otherwise, if the cell is
already of the Cell Type want, just update the value.

- MJD

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 09, 2006 3:13 AM
To: POI Users List
Cc: 'POI Users List'
Subject: RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data i
n the cell

Hi Michael,

I thought when the HSSFCell has no value but a style, POI with this method
(Row.getCell((short) cellNb)), should return an object HSSFCell not null
instead of a null object.
And after a getValue() should return null, but a getCellStyle() should
return the HSSFCellStyle not null !
What do you think about this?

I understand what you said before... if the HSSFCell is null, I should
create one with the same style as the cell before for example.

benjamin,
> Benjamin -
>
> Ok, the problem is a little different than I had first thought.  In your
> case, I think you will need to either figure out which style you are using
> in other cells that exist with the desired formatting or you can create a
> new HSSFCellStyle that mimics the settings you need and then after you
> create the new cells with HSSFCell cell = HSSFRow.createCell(column) you
> will need to do a cell.setCellStyle(cellStyleId) to set the proper
> formatting.
>
> So, first check to see if the cell exists, if so use it, else if it
> returns
> null then create a new cell and set the value & style.
>
> - MJD
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 08, 2006 3:11 AM
> To: POI Users List
> Cc: 'POI Users List'
> Subject: RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data
> i
> n the cell
>
> Thanks for your message Michael,
>
> My problem happens when I read a file (HSSFWorkbook), like using a
> template to create my own dynamic Excel file.
>
> For a HSSFWorkbook, and for a HSSFSheet I use a loop to parse each row
> (HSSFRow).
> To have the HSSFCell, I use this method : oneRow.getCell((short) cellNb)
> -If ((the cell has a value inside) && (a style(a border for example)))
> {
>I get the correct object HSSFCell with the method  oneRow.getCell(
> (short) cellNb)
> }
>
> -If((the cell has NO value)&& (a style(a border for example)))
> {
>   I get the null Object with the method oneRow.getCell((short) cellNb)
>   To catch the style of this cell, I need to use this method:
> HSSFCell.getCellStyle
>   But it is not possible to apply a method to a null object!
> }
>
> I Hope this text makes it more clear.
>
> Benjamin CHALLAMEL
>
>
>> Benjamin -
>>
>> If I under stand your question correctly  HSSFCells have both a Cell
>> Style and Cell Type associated with them.  If you intend to have an
>> empty
>> cell you should set the Cell Type to HSSFCell.CELL_TYPE_BLANK and create
>> a
>> Cell Style with the appropriate borders and Data Format, etc.  The
>> HSSFCell
>> class has get/set methods for the Cell Style, Cell Type, and of course
>> the
>> Cell Value.  To create a new Cell Style see the
>> HSSFWorkbook.createCellStyle() method.
>>
>> I haven't seen this happen before but if you are loosing the formatting
>> after you update the value of a cell, you could save the Cell Style
>> before
>> you set the Type and Value and then set it back after you set the Type
>> and
>> Value to make sure the Cell Style (borders, etc) are set the way you
>> want.
>>
>> I hope this helps,
>>
>> - MJD
>>
>> One somewhat related caveat that is not well documented:  You need to
>> try
>> to
>> share Cell Styles between all cells with identical formatting.  Do not
>> create a new Cell Style for each cell you create unless they are truly
>> formatted uniquely.  This creates a management nightmare if you have
>> very
>> many Cell Styles, but it's a necessary aspect of the beasties.
>>
>&g

RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data i n the cell

2006-02-10 Thread bchallamel
Hi Michael,

This is like a private coversation.

Next week, I will not be available.

It seems maybe I was confused with this HSFFCell null.

Thanks for your details.

I plan to wait 1-2 weeks and to see if my templates problems are solved.

If there is still a problem, I will create a simple example to show you in
details.

Have a good day, Benjamin
>
> Benjamin -
>
> Ok I think I see where you are confused.
>
> Case 1)   Cell does not exist and you get a null when you request it.
> Create and format the cell.
>
> Case 2)   Cell exists.  In this case the Cell can have a number of
> different
> Cell Types such as BOOLEAN, DOUBLE, DATE, NUMERIC, BLANK, etc.  Before you
> try and get a value from a cell you need to check the Cell Type so you
> know
> which method to call.  If your Cell Type is HSSFCell.CELL_TYPE_BLANK, then
> to add a value, you set the Cell Type to the appropriate Cell Type and
> then
> set the value.  I don't think you need to set the Cell Style after doing
> this, but if the formatting is lost for some reason you can do the
> setCellStyle(cellStyleId) and you'll be fine.  Otherwise, if the cell is
> already of the Cell Type want, just update the value.
>
> - MJD
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 09, 2006 3:13 AM
> To: POI Users List
> Cc: 'POI Users List'
> Subject: RE: [Question]HSSFRow.getCell(cellNb), loosing border if no data
> i
> n the cell
>
> Hi Michael,
>
> I thought when the HSSFCell has no value but a style, POI with this method
> (Row.getCell((short) cellNb)), should return an object HSSFCell not null
> instead of a null object.
> And after a getValue() should return null, but a getCellStyle() should
> return the HSSFCellStyle not null !
> What do you think about this?
>
> I understand what you said before... if the HSSFCell is null, I should
> create one with the same style as the cell before for example.
>
> benjamin,
>> Benjamin -
>>
>> Ok, the problem is a little different than I had first thought.  In your
>> case, I think you will need to either figure out which style you are
>> using
>> in other cells that exist with the desired formatting or you can create
>> a
>> new HSSFCellStyle that mimics the settings you need and then after you
>> create the new cells with HSSFCell cell = HSSFRow.createCell(column) you
>> will need to do a cell.setCellStyle(cellStyleId) to set the proper
>> formatting.
>>
>> So, first check to see if the cell exists, if so use it, else if it
>> returns
>> null then create a new cell and set the value & style.
>>
>> - MJD
>>
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, February 08, 2006 3:11 AM
>> To: POI Users List
>> Cc: 'POI Users List'
>> Subject: RE: [Question]HSSFRow.getCell(cellNb), loosing border if no
>> data
>> i
>> n the cell
>>
>> Thanks for your message Michael,
>>
>> My problem happens when I read a file (HSSFWorkbook), like using a
>> template to create my own dynamic Excel file.
>>
>> For a HSSFWorkbook, and for a HSSFSheet I use a loop to parse each row
>> (HSSFRow).
>> To have the HSSFCell, I use this method : oneRow.getCell((short) cellNb)
>> -If ((the cell has a value inside) && (a style(a border for example)))
>> {
>>I get the correct object HSSFCell with the method
>> oneRow.getCell(
>> (short) cellNb)
>> }
>>
>> -If((the cell has NO value)&& (a style(a border for example)))
>> {
>>  I get the null Object with the method oneRow.getCell((short) cellNb)
>>  To catch the style of this cell, I need to use this method:
>> HSSFCell.getCellStyle
>>  But it is not possible to apply a method to a null object!
>> }
>>
>> I Hope this text makes it more clear.
>>
>> Benjamin CHALLAMEL
>>
>>
>>> Benjamin -
>>>
>>> If I under stand your question correctly  HSSFCells have both a
>>> Cell
>>> Style and Cell Type associated with them.  If you intend to have an
>>> empty
>>> cell you should set the Cell Type to HSSFCell.CELL_TYPE_BLANK and
>>> create
>>> a
>>> Cell Style with the appropriate borders and Data Format, etc.  The
>>> HSSFCell
>>> class has get/set methods for the Cell Style, Cell Type, and of course
>>> the
>>> Cell Value.  To create a new Cell Style see the
>>> HSSFWorkbook.createCellStyle() method.
>>