пятница, 22 августа 2008 г.

CarlosAg.ExcelXmlWriter: freeze top row










For freeze top row in Microsoft Excel 2007 worksheet using CarlosAg.ExcelXmlWriter
from CarlosAg Excel Xml Writer Library use following code:

Workbook myWorkBook = new Workbook();
Worksheet myWorksheet = myWorkBook.Worksheets.Add("Data");
myWorksheet.Options.Selected = true;
myWorksheet.Options.FreezePanes = true;
myWorksheet.Options.SplitHorizontal = 1;
myWorksheet.Options.TopRowBottomPane = 1;
myWorksheet.Options.ActivePane = 2;

Also you can use CarlosAg.ExcelXmlWriter.Generator.exe from CarlosAg Excel Xml Writer Library for get c# code for Excel *.xml files saved in XML Spreadsheet format.