Exporting Excel with custom shape objects

Posted by: mkiran88 on 8 September 2017, 3:22 pm EST

  • Posted 8 September 2017, 3:22 pm EST

    I have designed a custom shape class as follow.
    class RectangleWithCircle : PSShape, ISerializable
    private Size ellSize = new Size(12, 12);
    public RectangleWithCircle()
    this.Size = new Size(20,20);

    public override void OnPaint(System.Drawing.Graphics g, System.Drawing.Rectangle rectInput)
    // base.OnPaint(g, rectInput);
    g.DrawRectangle(Pens.Black, rectInput);
    Rectangle ellipseRest = new System.Drawing.Rectangle(rectInput.Location.X + (rectInput.Width - ellSize.Width) / 2,
    rectInput.Location.Y + (rectInput.Height - ellSize.Height) / 2,ellSize.Width,ellSize.Height);
    g.DrawEllipse(Pens.Black, ellipseRest);


    When I add my custom shape object to a sheet it is displaying on the sheet but when I export it to excel.It is not exporting into excel.So what is the solution for this.
  • Replied 8 September 2017, 3:22 pm EST


    Sorry, only built-in shapes and camera shapes can be exported to Excel.

  • Replied 8 September 2017, 3:22 pm EST

    When you are providing custom controls. It should have a flexibility to serialize custom shapes into excel as well.

  • Replied 8 September 2017, 3:22 pm EST


    We are escalating this as an enhancement request. We will update you once we hear anything from our concerned team.

    Tracking id for your issue is:- #146463

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels