Thanks,
Scott
- Code: Select all
Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
StylesCollection styles = wb.Styles;
//////////////////////////////////
// set style
//////////////////////////////////
CellStyle cs;
cs = styles.Add("1");
cs.WrapText = true;
cs.VerticalAlignment = VerticalAlignType.Top;
cs.HorizontalAlignment = HorizontalAlignType.Left;
cs.Font.FontName = "Trebuchet MS";
cs.Font.Size = 18;
cs.Font.IsItalic = true;
cs.Font.IsBold = true;
cs.Font.Color = Color.FromArgb(22, 34, 86);
//////////////////////////////////
// add data
//////////////////////////////////
ws.Range["A1"].Text = "TEST LOAN FUND";
ws.Range["A1"].Style = styles["1"];
ws.AutoFitRow(1);
ws.Range[1, 1, 1, 10].Merge();
///////////////////////////////
// save the workbook
///////////////////////////////
string fullFilePath = @"C:\TEMP\sdubose\test.xls";
if (File.Exists(fullFilePath))
{
File.Delete(fullFilePath);
}
wb.SaveToFile(fullFilePath, FileFormat.Version97to2003);