You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Avinash Kewalramani <AK...@accelrys.com> on 2009/03/18 18:13:02 UTC

Anchor type methods in XSSF

Hi

I am trying to fit different size images and text in the same column or row
The key goal is to maintain the image widths and height across the rows and columns
but size the col width to the   biggest image width.

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.

In XSSFClientAnchor there is no such method and I am really hurting because of this. I have substantaial code
written out in XSSF which I don't want to change to HSSF and also we want to support the newer Excel files.

Can someone with knowledge of image resizing please tell me why this feature is gone and if there is a workaround for this in
the XSSf implementation. I did not see any examples for this in the code base.I am using v3.5 beta4.
I think it was a really useful feature and would really like to see something like this in XSSF .

Any help/cpmments/pointers are really appreciated.

Regards
A




RE: Anchor type methods in XSSF

Posted by Avinash Kewalramani <AK...@accelrys.com>.
thanks a lot Yegor!

Avinash

-----Original Message-----
From: Yegor Kozlov [mailto:yegor@dinom.ru] 
Sent: Saturday, March 21, 2009 9:29 AM
To: POI Users List
Subject: Re: Anchor type methods in XSSF

added in r756965
Daily builds can be downloaded from http://encore.torchbox.com/poi-svn-build/

Regards,
Yegor

> thanks Yegor!
> 
> I think it will be really helpful.
> 
> Regards
> A
> 
> -----Original Message-----
> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
> Sent: Wednesday, March 18, 2009 11:29 AM
> To: POI Users List
> Subject: Re: Anchor type methods in XSSF
> 
> XSSFClientAnchor  is really missing this feature.
> When constructing XSSFPicture the resizing behavior is hardcoded to "Move With Cells but Do Not Resize".
> See XSSFDrawing.createShape:
> 
>      public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex)
>      {
>          PackageRelationship rel = addPictureReference(pictureIndex);
> 
>          CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
>          ctAnchor.setEditAs(STEditAs.ONE_CELL); //should be taken from XSSFClientAnchor !
>          CTPicture ctShape = ctAnchor.addNewPic();
>          ctShape.set(XSSFPicture.prototype());
> 
>          XSSFPicture shape = new XSSFPicture(this, ctShape);
>          shape.anchor = anchor;
>          shape.setPictureReference(rel);
>          return shape;
>      }
> 
> I will try to find time to add this support.
> 
> Yegor
> 
>> Hi
>>
>> I am trying to fit different size images and text in the same column or row
>> The key goal is to maintain the image widths and height across the rows and columns
>> but size the col width to the   biggest image width.
>>
>> 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.
>>
>> In XSSFClientAnchor there is no such method and I am really hurting because of this. I have substantaial code
>> written out in XSSF which I don't want to change to HSSF and also we want to support the newer Excel files.
>>
>> Can someone with knowledge of image resizing please tell me why this feature is gone and if there is a workaround for this in
>> the XSSf implementation. I did not see any examples for this in the code base.I am using v3.5 beta4.
>> I think it was a really useful feature and would really like to see something like this in XSSF .
>>
>> Any help/cpmments/pointers are really appreciated.
>>
>> Regards
>> A
>>
>>
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Anchor type methods in XSSF

Posted by Yegor Kozlov <ye...@dinom.ru>.
added in r756965
Daily builds can be downloaded from http://encore.torchbox.com/poi-svn-build/

Regards,
Yegor

> thanks Yegor!
> 
> I think it will be really helpful.
> 
> Regards
> A
> 
> -----Original Message-----
> From: Yegor Kozlov [mailto:yegor@dinom.ru] 
> Sent: Wednesday, March 18, 2009 11:29 AM
> To: POI Users List
> Subject: Re: Anchor type methods in XSSF
> 
> XSSFClientAnchor  is really missing this feature.
> When constructing XSSFPicture the resizing behavior is hardcoded to "Move With Cells but Do Not Resize".
> See XSSFDrawing.createShape:
> 
>      public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex)
>      {
>          PackageRelationship rel = addPictureReference(pictureIndex);
> 
>          CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
>          ctAnchor.setEditAs(STEditAs.ONE_CELL); //should be taken from XSSFClientAnchor !
>          CTPicture ctShape = ctAnchor.addNewPic();
>          ctShape.set(XSSFPicture.prototype());
> 
>          XSSFPicture shape = new XSSFPicture(this, ctShape);
>          shape.anchor = anchor;
>          shape.setPictureReference(rel);
>          return shape;
>      }
> 
> I will try to find time to add this support.
> 
> Yegor
> 
>> Hi
>>
>> I am trying to fit different size images and text in the same column or row
>> The key goal is to maintain the image widths and height across the rows and columns
>> but size the col width to the   biggest image width.
>>
>> 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.
>>
>> In XSSFClientAnchor there is no such method and I am really hurting because of this. I have substantaial code
>> written out in XSSF which I don't want to change to HSSF and also we want to support the newer Excel files.
>>
>> Can someone with knowledge of image resizing please tell me why this feature is gone and if there is a workaround for this in
>> the XSSf implementation. I did not see any examples for this in the code base.I am using v3.5 beta4.
>> I think it was a really useful feature and would really like to see something like this in XSSF .
>>
>> Any help/cpmments/pointers are really appreciated.
>>
>> Regards
>> A
>>
>>
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: Anchor type methods in XSSF

Posted by Avinash Kewalramani <AK...@accelrys.com>.
thanks Yegor!

I think it will be really helpful.

Regards
A

-----Original Message-----
From: Yegor Kozlov [mailto:yegor@dinom.ru] 
Sent: Wednesday, March 18, 2009 11:29 AM
To: POI Users List
Subject: Re: Anchor type methods in XSSF

XSSFClientAnchor  is really missing this feature.
When constructing XSSFPicture the resizing behavior is hardcoded to "Move With Cells but Do Not Resize".
See XSSFDrawing.createShape:

     public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex)
     {
         PackageRelationship rel = addPictureReference(pictureIndex);

         CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
         ctAnchor.setEditAs(STEditAs.ONE_CELL); //should be taken from XSSFClientAnchor !
         CTPicture ctShape = ctAnchor.addNewPic();
         ctShape.set(XSSFPicture.prototype());

         XSSFPicture shape = new XSSFPicture(this, ctShape);
         shape.anchor = anchor;
         shape.setPictureReference(rel);
         return shape;
     }

I will try to find time to add this support.

Yegor

> Hi
> 
> I am trying to fit different size images and text in the same column or row
> The key goal is to maintain the image widths and height across the rows and columns
> but size the col width to the   biggest image width.
> 
> 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.
> 
> In XSSFClientAnchor there is no such method and I am really hurting because of this. I have substantaial code
> written out in XSSF which I don't want to change to HSSF and also we want to support the newer Excel files.
> 
> Can someone with knowledge of image resizing please tell me why this feature is gone and if there is a workaround for this in
> the XSSf implementation. I did not see any examples for this in the code base.I am using v3.5 beta4.
> I think it was a really useful feature and would really like to see something like this in XSSF .
> 
> Any help/cpmments/pointers are really appreciated.
> 
> Regards
> A
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Anchor type methods in XSSF

Posted by Yegor Kozlov <ye...@dinom.ru>.
XSSFClientAnchor  is really missing this feature.
When constructing XSSFPicture the resizing behavior is hardcoded to "Move With Cells but Do Not Resize".
See XSSFDrawing.createShape:

     public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex)
     {
         PackageRelationship rel = addPictureReference(pictureIndex);

         CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
         ctAnchor.setEditAs(STEditAs.ONE_CELL); //should be taken from XSSFClientAnchor !
         CTPicture ctShape = ctAnchor.addNewPic();
         ctShape.set(XSSFPicture.prototype());

         XSSFPicture shape = new XSSFPicture(this, ctShape);
         shape.anchor = anchor;
         shape.setPictureReference(rel);
         return shape;
     }

I will try to find time to add this support.

Yegor

> Hi
> 
> I am trying to fit different size images and text in the same column or row
> The key goal is to maintain the image widths and height across the rows and columns
> but size the col width to the   biggest image width.
> 
> 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.
> 
> In XSSFClientAnchor there is no such method and I am really hurting because of this. I have substantaial code
> written out in XSSF which I don't want to change to HSSF and also we want to support the newer Excel files.
> 
> Can someone with knowledge of image resizing please tell me why this feature is gone and if there is a workaround for this in
> the XSSf implementation. I did not see any examples for this in the code base.I am using v3.5 beta4.
> I think it was a really useful feature and would really like to see something like this in XSSF .
> 
> Any help/cpmments/pointers are really appreciated.
> 
> Regards
> A
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org