//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; worksheet.Columns[3].ColumnWidthInPixel = 100; CheckBoxCellType cellType = new CheckBoxCellType { Caption = "CheckBox", TextTrue = "True", TextFalse = "False", IsThreeState = true, TextAlign = CheckBoxAlign.Right }; worksheet.Columns[3].CellType = cellType; worksheet.Range["D1:D10"].Value = true; ButtonCellType buttonCellType = new ButtonCellType { Text = "Button", ButtonBackColor = "Azure", MarginLeft = 10, MarginRight = 10 }; worksheet.Rows[3].CellType = buttonCellType; // Save to a pdf file workbook.Save("AddRowColumnCellType.pdf");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) worksheet.Columns(3).ColumnWidthInPixel = 100 Dim cellType As New CheckBoxCellType With { .Caption = "CheckBox", .TextTrue = "True", .TextFalse = "False", .IsThreeState = True, .TextAlign = CheckBoxAlign.Right } worksheet.Columns(3).CellType = cellType worksheet.Range("D1:D10").Value = True Dim buttonCellType As New ButtonCellType With { .Text = "Button", .ButtonBackColor = "Azure", .MarginLeft = 10, .MarginRight = 10 } worksheet.Rows(3).CellType = buttonCellType ' save to a pdf file workbook.Save("AddRowColumnCellType.pdf")