Coder Social home page Coder Social logo

ParentGroup of ExcelDrawing about epplus HOT 4 OPEN

FedePorti avatar FedePorti commented on June 3, 2024
ParentGroup of ExcelDrawing

from epplus.

Comments (4)

JanKallman avatar JanKallman commented on June 3, 2024

It seems like there is a bug when trying to access child drawing via the name. I will add a fix for that.
For now, use a linq query or similar...

                var groupDrawing = ((ExcelGroupShape)sheet.Drawings["img_d2_bt"]);
                var childLine1 = groupDrawing.Drawings.FirstOrDefault(x=> x.Name=="D2_Line1_BT");
                 //Instead of...
                 var childLine2 = groupDrawing.Drawings["D2_Line2_BT"];
                 //...Or use the index:
                  var childc = groupDrawing.Drawings[3];

The Size property will be null on drawings that have the EditAs property set to OfficeOpenXml.Drawing.eEditAs.TwoCell
Depending on the EditAs property value, you use the properties From, To, Position or Size to get/set the drawings position.
The ParentGroup will be set to null for all top-level drawing (in the worksheet.Drawings Collection). Group Drawings (like "D2_Line1_BT"), have the ParentGroup property set to the group drawing that contains it (in this case "img_d2_bt").

from epplus.

FedePorti avatar FedePorti commented on June 3, 2024

Thank you, I use linq and it works. And also works the Size, I already have the property EditAs set to OneCell but after I call the Size (so I move before and it works).

from epplus.

JanKallman avatar JanKallman commented on June 3, 2024

Great, I have added a fix for the Name Indexer issue.

from epplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.