Example #1
0
        private void btnAddTotalShapes_Click(object sender, EventArgs e)
        {
            ExcelBinder excelbinder = new ExcelBinder();

            excelbinder.NewDocument();

            excelbinder.Visible = true;

            excelbinder.SetActiveWorkSheet(1);

            int Left = 10;
            int Top  = 10;

            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeLineCallout1, Left, Top, 100, 20);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeRectangle, Left + 120, Top, 100, 20);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeRightArrow, Left + 220, Top, 100, 20);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeLeftArrow, Left + 320, Top, 100, 20);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeLeftRightArrow, Left + 420, Top, 100, 20);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeUpArrow, Left + 520, Top, 100, 20);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeRightTriangle, Left, Top + 150, 150, 150);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeOctagon, Left + 200, Top + 150, 150, 150);
            excelbinder.InsertShapes(Shapes.ShapeDefine.MsoShapeType.msoShapeOval, Left + 400, Top + 150, 150, 150);

            excelbinder.SaveDocument(Path.Combine(Environment.CurrentDirectory, "testshapes.xlsx"));

            excelbinder.CloseDocument();

            excelbinder.QuitDocument();
        }
Example #2
0
        private void btnAddShape_Click(object sender, EventArgs e)
        {
            ExcelBinder excelbinder = new ExcelBinder();

            excelbinder.NewDocument();

            excelbinder.Visible = true;

            excelbinder.SetActiveWorkSheet(1);

            Shapes.ShapeDefine.MsoShapeType stype = GetShapeType(cbShapeType.SelectedIndex);
            excelbinder.InsertShapes(stype, 100, 100, 150, 20);

            excelbinder.SaveDocument(Path.Combine(Environment.CurrentDirectory, "testshapes" + (int)stype + ".xlsx"));

            excelbinder.CloseDocument();

            excelbinder.QuitDocument();
        }