Patrick: Why do you say this? Did you read Joan's original message (She was
attempting to model her program after the quick guide example of how to
insert an image into a spreadsheet with POI)? Have you even read
http://jakarta.apache.org/poi/hssf/quick-guide.html#DrawingShapes ? 

In fact, I believe JExcelAPI only allows you to insert images from a file,
and only if the file is in PNG format. POI image support will support any
image that can be made with java.awt. It seems to me to be far more flexible
than JExcel. Also, POI supports some of the basic Office Drawing
functionality such as lines, arcs, arrows, grouping, etc. None of that is
supported by JExcelAPI yet (at least as far as I know).

That being said, I will admit that JExcelAPI seems to be a bit more stable
than POI. Also, JExcelAPI has preliminary support for comments (which are
actually part of the Escher drawing layer). One of the big problems with POI
is that you cannot update a worksheet that already contains an Escher layer.
You must either create a new one from scratch, or leave the existing one
untouched (Has this changed yet?)

Both APIs have a *long* way to go. Neither supports (to the best of my
knowledge)

- Charts
- Embedded OLE pictures
- Embedded forms objects, such as radio buttons and drop down boxes
- Word Art
- Microsoft Applets such as Org Chart or Equation Editor

(to name a few).

-----Original Message-----
From: Patrick Fidler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 04, 2005 2:27 AM
To: POI Users List
Subject: Re: Urgent~ why I can't insert an image into excel by poi

POI does not support image inclusion in Excel files, so you can't use it
for this purpose. There is a far better API for managing Excel
spreadsheets in Java called JExcelApi. See
http://jexcelapi.sourceforge.net/. Generally JExcelAPI is far more
efficient and straightforward than POI. The WriteableImage class in
there makes image writing simple and easy, for example:

WritableImage wi= new WritableImage(imagecol, imagerow, imagewidth,
imageheight, new File(params.IMAGESFILE()));
writeSheet.addImage(wi);

good luck.


[EMAIL PROTECTED] wrote:

>Dear all
>    Does anyone can insert an image into a excel file?
>I use the quick guide in hssf help as my program code..but it not work!
>It can generate a excel successfully, but an empty content..
>When I close this file, excel will alert unexpect error..
>Anyone can help me to solve this issue.......  
>
>
>    a = new HSSFClientAnchor( 0, 0, 1023, 255, (short) 1, 0, (short) 1, 0
);
>    group = patriarch.createGroup( a );
>    group.setCoordinates( 0, 0, 80 * 4 , 12 * 23  );
>    float verticalPointsPerPixel = a.getAnchorHeightInPoints(sheet) /
(float)Math.abs(group.getY2() - group.getY1());
>    g = new EscherGraphics( group, wb, Color.black, verticalPointsPerPixel
);
>    g2d = new EscherGraphics2d( g );
>    g2d.drawimage(image, ...............)     //image object is created by
java.awt
>
>
>Joan
>
>  
>


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

Reply via email to