Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Spreadsheet .NET
>
Tutorial
> Set Header
The following example shows you how to set worksheet's header.
C# example
using System; using Independentsoft.Office; using Independentsoft.Office.Spreadsheet; namespace Sample { class Program { static void Main(string[] args) { Worksheet sheet1 = new Worksheet(); sheet1["A1"] = new Cell(100); Workbook book = new Workbook(); book.Sheets.Add(sheet1); sheet1.HeaderFooterSettings.OddHeader = "test header"; SheetView view1 = new SheetView(); view1.ZoomScale = 50; view1.ZoomScaleNormalView = 50; view1.Index = 0; sheet1.Views.Add(view1); book.Save("c:\\test\\output.xlsx", true); } } }
VB example
Imports System Imports Independentsoft.Office Imports Independentsoft.Office.Spreadsheet Module Module1 Sub Main(ByVal args As String()) Dim sheet1 As New Worksheet() sheet1("A1") = New Cell(100) Dim book As New Workbook() book.Sheets.Add(sheet1) sheet1.HeaderFooterSettings.OddHeader = "test header" Dim view1 As New SheetView() view1.ZoomScale = 50 view1.ZoomScaleNormalView = 50 view1.Index = 0 sheet1.Views.Add(view1) book.Save("c:\test\output.xlsx", True) End Sub End Module
Need help? Ask our developers:
Name*
Email*
Message*