Jon,

Try to go with my second suggestion if you can. Use Excel to create a
template that you open and process with POI. That way you can be sure the
logo is sized and positioned exactly as you want.

I have checked this morning and POI will not corrupt the image at all once
it has been positioned on the worksheet. If you can use this technique, it
will help you to neatly side step the problem you are facing.

David, thanks for digging out that older post.

Yours

Mark B



Jon Brisbin-2 wrote:
> 
> 
> On Jun 3, 2009, at 12:07 PM, Dave Fisher wrote:
> 
>> Take a look at the thread starting March 18, 2009 by AKewalramani  
>> and the subject of "Anchor type methods in XSSF" includes responses  
>> from Yegor:
>>
>>>> This was easy to achieve in HSSF because  the  HSSFClientAnchor  
>>>> class had a setAnchorType
>>>> method which I could set a value to "2" and the image would move  
>>>> with the cell and it would
>>>> not resize itself as the cell size is changed.
>>
>> Regards,
>> Dave
> 
> If I set the anchor type to "2", I still have to multiply the pixel  
> height and width of my image by seemingly random values. In other  
> words, if I multiply the width of my image by 5.4 and the height of my  
> image by 3, I get a reasonable facsimile of the original inside my  
> spreadsheet.
> 
> Besides all of this being extraordinarily non-intuitive, I did search  
> extensively for example code, etc... and couldn't find anything that  
> says "to insert an image into your spreadsheet, keep A, B, and C, in  
> mind...", citing the above strangeness. It would seem that the POI  
> developers would have documented the fact that you have know the  
> secret codes to enter to get the results you're looking for,  
> especially if you simply have a requirement to generate a spreadsheet  
> to email to a non-technical user and you've never done that before and  
> you have heard about POI only second-hand and you don't have time to  
> spend digging into the source code of the thing just so you can use it  
> in a small, non-critical task.
> 
> It's been a very frustrating experience so far, to say the least...
> 
> Jon Brisbin
> Portal Webmaster
> NPC International, Inc.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problems-adding-logo-image-to-spreadsheet-tp23851486p23864586.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to