Return-Path: X-Original-To: apmail-poi-user-archive@www.apache.org Delivered-To: apmail-poi-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6CCBC9D99 for ; Thu, 2 Feb 2012 12:08:42 +0000 (UTC) Received: (qmail 29936 invoked by uid 500); 2 Feb 2012 12:08:41 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 29883 invoked by uid 500); 2 Feb 2012 12:08:41 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Received: (qmail 29871 invoked by uid 99); 2 Feb 2012 12:08:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2012 12:08:40 +0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.139.236.26 is neither permitted nor denied by domain of sharmpratik@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Feb 2012 12:08:33 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RsvSW-0003nK-Aa for user@poi.apache.org; Thu, 02 Feb 2012 04:08:12 -0800 Date: Thu, 2 Feb 2012 04:08:12 -0800 (PST) From: Pratik To: user@poi.apache.org Message-ID: In-Reply-To: References: Subject: Re: Rendering Shapes for 2003 excel MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4244_24820852.1328184492263" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_4244_24820852.1328184492263 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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]> > 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]> > 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]> > 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] > > 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] > >> For additional commands, e-mail: [hidden email] > >> > >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > > > ------------------------------ > 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 > . > 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. ------=_Part_4244_24820852.1328184492263--