//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); workbook.BookView.TabEditable = true; workbook.BookView.TabNavigationVisible = true; workbook.BookView.TabStripPosition = SpreadJSTabStripPosition.Top; object[,] data = new object[,]{ {"Name", "City", "Birthday", "Eye color", "Weight", "Height"}, {"Richard", "New York", new DateTime(1968, 6, 8), "Blue", 67, 165}, {"Nia", "New York", new DateTime(1972, 7, 3), "Brown", 62, 134}, {"Jared", "New York", new DateTime(1964, 3, 2), "Hazel", 72, 180}, {"Natalie", "Washington", new DateTime(1972, 8, 8), "Blue", 66, 163}, {"Damon", "Washington", new DateTime(1986, 2, 2), "Hazel", 76, 176}, {"Angela", "Washington", new DateTime(1993, 2, 15), "Brown", 68, 145} }; IWorksheet worksheet = workbook.Worksheets[0]; worksheet.Range["A1:F7"].Value = data; worksheet.Range["A:F"].ColumnWidth = 15; worksheet.Tables.Add(worksheet.Range["A1:F7"], true); worksheet.Copy(); worksheet.Copy(); workbook.Worksheets[1].Name = "Sheet2"; workbook.Worksheets[1].Tables[0].TableStyle = workbook.TableStyles["TableStyleMedium3"]; workbook.Worksheets[2].Name = "Sheet3"; workbook.Worksheets[2].Tables[0].TableStyle = workbook.TableStyles["TableStyleLight18"]; // Save to an excel file workbook.Save("TabStrip.xlsx");
' Create a new Workbook Dim workbook As New Workbook workbook.BookView.TabEditable = True workbook.BookView.TabNavigationVisible = True workbook.BookView.TabStripPosition = SpreadJSTabStripPosition.Left Dim data As Object(,) = { {"Name", "City", "Birthday", "Eye color", "Weight", "Height"}, {"Richard", "New York", New DateTime(1968, 6, 8), "Blue", 67, 165}, {"Nia", "New York", New DateTime(1972, 7, 3), "Brown", 62, 134}, {"Jared", "New York", New DateTime(1964, 3, 2), "Hazel", 72, 180}, {"Natalie", "Washington", New DateTime(1972, 8, 8), "Blue", 66, 163}, {"Damon", "Washington", New DateTime(1986, 2, 2), "Hazel", 76, 176}, {"Angela", "Washington", New DateTime(1993, 2, 15), "Brown", 68, 145} } Dim worksheet As IWorksheet = workbook.Worksheets(0) worksheet.Range("A1:F7").Value = data worksheet.Range("A:F").ColumnWidth = 15 worksheet.Tables.Add(worksheet.Range("A1:F7"), True) worksheet.Copy() worksheet.Copy() workbook.Worksheets(1).Name = "Sheet2" workbook.Worksheets(1).Tables(0).TableStyle = workbook.TableStyles("TableStyleMedium3") workbook.Worksheets(2).Name = "Sheet3" workbook.Worksheets(2).Tables(0).TableStyle = workbook.TableStyles("TableStyleLight18") ' save to an excel file workbook.Save("TabStrip.xlsx")