poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pratik <sharmpra...@gmail.com>
Subject Re: Rendering Shapes for 2003 excel
Date Thu, 02 Feb 2012 12:08:12 GMT
Hey Thanks Yegor Now i m able to get option of the Shape(ShapeType) by
which i can get Name of the shape.

On Thu, Feb 2, 2012 at 4:24 PM, Yegor Kozlov-4 [via Apache POI] <
ml-node+s1045710n5450328h0@n5.nabble.com> wrote:

> On Thu, Feb 2, 2012 at 2:16 PM, pratik sharma <[hidden email]<http://user/SendEmail.jtp?type=node&node=5450328&i=0>>
> wrote:
> > Ok fine i can do that by using Child Iterators, but
> EscherContainerRecord
> > conatins information of only one shape (first shape) in excel.
>
> Wrong. Top-level EscherContainerRecord  contains child containers and
> they can have their own children, etc.. To iterate over shapes you
> MUST walk the record tree.
>
> Print   escherContainer.toString()  and see the records hierarchy. All
> shapes should be there and you should see how deep you need to walk
> down to get them.
>
> Yegor
>
> > you have any idea by which i can get information of n number of shape in
> > excel ?.....onces i can get information for n number of Shapes i can
> Render
> > that information using  EscherOptRecord and EscherSpRecord.
> >
> > On Thu, Feb 2, 2012 at 3:36 PM, Yegor Kozlov <[hidden email]<http://user/SendEmail.jtp?type=node&node=5450328&i=1>>
> wrote:
> >
> >> Instead of getting the first EscherOpt record with findFirstWithId you
> >> should walk the Escher tree. One example how to that is in
> >> EscherAggregate#convertRecordsToUserModel:
> >>
> >>
> >>
> http://svn.apache.org/repos/asf/poi/trunk/src/java/org/apache/poi/hssf/record/EscherAggregate.java
> >>
> >> Yegor
> >>
> >> On Thu, Feb 2, 2012 at 1:47 PM, Pratik <[hidden email]<http://user/SendEmail.jtp?type=node&node=5450328&i=2>>
> wrote:
> >> > Thanks for the Reply.
> >> >
> >> > By using EscherContainerRecord i m able to get a data about the
> Shape.
> >> > Data like shapeName (EscherSpRecord) and Shape information
> >> > (EscherOptRecord).
> >> >
> >> > code :
> >> >
> >> > EscherAggregate escherAggregate = sheet.getDrawingEscherAggregate();
> >> >
> >> >  EscherContainerRecord _escherContainer =
> >> > escherAggregate.getEscherContainer();
> >> >
> >> > EscherOptRecord escherOptRecord = (EscherOptRecord)
> >> > escherAggregate.findFirstWithId(EscherOptRecord.RECORD_ID);
> >> >
> >> > .............
> >> >
> >> > but this is giving me data for only 1 shape in the sheet. is there a
> way
> >> in
> >> > which i can know how many shapes are there in a sheet and can get
> data
> >> for
> >> > all those shape using EscherContainerRecord ?
> >> >
> >> >
> >> > On Thu, Feb 2, 2012 at 2:36 PM, Yegor Kozlov-4 [via Apache POI] <
> >> > [hidden email] <http://user/SendEmail.jtp?type=node&node=5450328&i=3>>
> wrote:
> >> >
> >> >> Unfortunately, POI does not fully support reading properties of
> shapes
> >> >> from binary Excel files (.xls).
> >> >> This is a rather fundamental limitation of POI-HSSF: it can create
> >> >> simple drawings from scratch, but cannot modify or read existing
> ones.
> >> >>
> >> >> reading basic shape properties is simple:
> >> >>
> >> >> HSSFPatriarch drawing = sheet.getDrawingPatriarch();
> >> >> for(HSSFShape sh :  drawing.getChildren()){
> >> >>      HSSFAnchor anchor = sh.getAnchor(); // position of the shape on
> the
> >> >> sheet
> >> >>
> >> >>     if(sh instanceof HSSFTextbox){
> >> >>      ....
> >> >>     } else if instanceof HSSFPicture){
> >> >>     ...
> >> >>    }
> >> >> }
> >> >>
> >> >> getting adjustment values and formatting (color, border, etc.) is
> not
> >> >> supported.
> >> >>
> >> >> Yegor
> >> >>
> >> >> On Thu, Feb 2, 2012 at 12:38 PM, pratik sharma <[hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=5450079&i=0>>
> >> >> wrote:
> >> >> > Hi i am looking for a sample code to Render Shape and get data
> about
> >> the
> >> >> > Shape (Data like Shape Name, Adjustment value, height, width etc)
> for
> >> >> 2003
> >> >> > excel.
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: [hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=5450079&i=1>
> >> >> For additional commands, e-mail: [hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=5450079&i=2>
> >> >>
> >> >>
> >> >>
> >> >> ------------------------------
> >> >>  If you reply to this email, your message will be added to the
> >> discussion
> >> >> below:
> >> >>
> >> >>
> >>
> http://apache-poi.1045710.n5.nabble.com/Rendering-Shapes-for-2003-excel-tp5450023p5450079.html
> >> >>  To unsubscribe from Apache POI, click here<
> >>
> >
> >> >> .
> >> >> NAML<
> >>
> http://apache-poi.1045710.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >> >
> >> >>
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://apache-poi.1045710.n5.nabble.com/Rendering-Shapes-for-2003-excel-tp5450023p5450172.html
> >> > Sent from the POI - User mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5450328&i=4>
> >> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5450328&i=5>
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5450328&i=6>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=5450328&i=7>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-poi.1045710.n5.nabble.com/Rendering-Shapes-for-2003-excel-tp5450023p5450328.html
>  To unsubscribe from Apache POI, click here<http://apache-poi.1045710.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2280728&code=c2hhcm1wcmF0aWtAZ21haWwuY29tfDIyODA3Mjh8LTg1MjcxMjcyMw==>
> .
> NAML<http://apache-poi.1045710.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Rendering-Shapes-for-2003-excel-tp5450023p5450451.html
Sent from the POI - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message