[prev in list] [next in list] [prev in thread] [next in thread]
List: poi-user
Subject: Re: Example for Using POI to import Excel and Word?
From: Stefan Neudorfer <s.neudorfer () klack ! com>
Date: 2002-03-31 4:37:34
[Download RAW message or body]
Hello Glen,
it's great - thank you.
I could not found a example so that I have some problems to go the first
steps.
Regards,
Stefan
Glen Stampoultzis wrote:
>Word support is not done yet.
>
>Here's an Excel example that reads a workbook, modifies it and writes it
>back:
>
> POIFSFileSystem fs =
> new POIFSFileSystem(new FileInputStream("workbook.xls"));
> HSSFWorkbook wb = new HSSFWorkbook(fs);
> HSSFSheet sheet = wb.getSheetAt(0);
> HSSFRow row = sheet.getRow(2);
> HSSFCell cell = row.getCell((short)3);
> if (cell == null)
> cell = row.createCell((short)3);
> cell.setCellType(HSSFCell.CELL_TYPE_STRING);
> cell.setCellValue("a test");
>
> // Write the output to a file
> FileOutputStream fileOut = new FileOutputStream("workbook.xls");
> wb.write(fileOut);
> fileOut.close();
>
>More documentation is available on the web site.
>
>Regards,
>
>Glen Stampoultzis (TriNexus Pty Ltd)
>+63 3 9753-6850 0402 835 458
>ICQ: 62722370 EMail: glens@apache.org
>
>
>
>----- Original Message -----
>From: "Stefan Neudorfer" <s.neudorfer@klack.com>
>To: <poi-user@jakarta.apache.org>
>Sent: Saturday, March 30, 2002 2:53 PM
>Subject: Example for Using POI to import Excel and Word?
>
>
>>Hi,
>>
>>we have to import and parse Excel and Word-files and we are looking for
>>a way to use POI.
>>Does someone have a simple example so that we can look for a way to use
>>POI in our applications (Swing, Batch)?
>>
>>
>>Thanks,
>>
>>
>>
>> Stefan Neudorfer
>>
>
>
>
>
[Attachment #3 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
Hello Glen,<br>
<br>
it's great - thank you.<br>
<br>
I could not found a example so that I have some problems to go the first
steps.<br>
<br>
Regards,<br>
<br>
<br>
Stefan<br>
<br>
<br>
Glen Stampoultzis wrote:<br>
<blockquote type="cite" cite="mid03ce01c1d7b2$32863010$b600a8c0@TOOTSIE">
<pre wrap="">Word support is not done yet.<br><br>Here's an Excel example that \
reads a workbook, modifies it and writes it<br>back:<br><br> POIFSFileSystem \
fs =<br> new POIFSFileSystem(new \
FileInputStream("workbook.xls"));<br> HSSFWorkbook wb = new \
HSSFWorkbook(fs);<br> HSSFSheet sheet = wb.getSheetAt(0);<br> HSSFRow \
row = sheet.getRow(2);<br> HSSFCell cell = row.getCell((short)3);<br> \
if (cell == null)<br> cell = row.createCell((short)3);<br> \
cell.setCellType(HSSFCell.CELL_TYPE_STRING);<br> cell.setCellValue("a \
test");<br><br> // Write the output to a file<br> FileOutputStream \
fileOut = new FileOutputStream("workbook.xls");<br> wb.write(fileOut);<br> \
fileOut.close();<br><br>More documentation is available on the web \
site.<br><br>Regards,<br><br>Glen Stampoultzis (TriNexus Pty Ltd)<br>+63 3 9753-6850 \
0402 835 458<br>ICQ: 62722370 EMail: <a class="moz
-txt-link-abbreviated" \
href="mailto:glens@apache.org">glens@apache.org</a><br><br><br><br>----- Original \
Message -----<br>From: "Stefan Neudorfer" <a class="moz-txt-link-rfc2396E" \
href="mailto:s.neudorfer@klack.com"><s.neudorfer@klack.com></a><br>To: <a \
class="moz-txt-link-rfc2396E" \
href="mailto:poi-user@jakarta.apache.org"><poi-user@jakarta.apache.org></a><br>Sent: \
Saturday, March 30, 2002 2:53 PM<br>Subject: Example for Using POI to import Excel \
and Word?<br><br><br></pre> <blockquote type="cite">
<pre wrap="">Hi,<br><br>we have to import and parse Excel and Word-files and we \
are looking for<br>a way to use POI.<br>Does someone have a simple example so that we \
can look for a way to use<br>POI in our applications (Swing, \
Batch)?<br><br><br>Thanks,<br><br><br><br> Stefan Neudorfer<br><br></pre> \
</blockquote> <pre wrap=""><!----><br><br><br><br></pre>
</blockquote>
<pre class="moz-signature" cols="$mailwrapcol"><br></pre>
<br>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic