//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet sheet = workbook.Worksheets[0]; IShape rectangle = sheet.Shapes.AddShape(AutoShapeType.Rectangle, 20, 50, 200, 200); rectangle.Line.DashStyle = LineDashStyle.Dash; rectangle.Line.Style = LineStyle.Single; rectangle.Line.Weight = 7; rectangle.Line.Color.RGB = System.Drawing.Color.Yellow; IShape donut = sheet.Shapes.AddShape(AutoShapeType.Donut, 260, 50, 200, 200); donut.Line.DashStyle = LineDashStyle.DashDotDot; donut.Line.Style = LineStyle.Single; donut.Line.Weight = 7; donut.Line.Color.RGB = System.Drawing.Color.Red; // Save to a pdf file workbook.Save("ShapeWithLine.pdf");
' Create a new Workbook Dim workbook As New Workbook Dim sheet As IWorksheet = workbook.Worksheets(0) Dim rectangle As IShape = sheet.Shapes.AddShape(AutoShapeType.Rectangle, 20, 50, 200, 200) rectangle.Line.DashStyle = LineDashStyle.Dash rectangle.Line.Style = LineStyle.Single rectangle.Line.Weight = 7 rectangle.Line.Color.RGB = System.Drawing.Color.Yellow Dim donut As IShape = sheet.Shapes.AddShape(AutoShapeType.Donut, 260, 50, 200, 200) donut.Line.DashStyle = LineDashStyle.DashDotDot donut.Line.Style = LineStyle.Single donut.Line.Weight = 7 donut.Line.Color.RGB = System.Drawing.Color.Red ' save to a pdf file workbook.Save("ShapeWithLine.pdf")