Aspose.Cells 导出 excel
2013-10-16 16:22
363 查看
Aspose.Cells.Workbook book = new Aspose.Cells.Workbook();
Aspose.Cells.Worksheet sheet = book.Worksheets["Sheet1"];
sheet.FreezePanes(1, 1, 1, 0);
Aspose.Cells.Style style = book.Styles[book.Styles.Add()];
style.Pattern = Aspose.Cells.BackgroundType.Solid;
style.Borders.SetStyle(Aspose.Cells.CellBorderType.Thin);
style.Borders.SetColor(System.Drawing.Color.LightSteelBlue);
style.IsTextWrapped = true;
style.Font.Size = 10;
Aspose.Cells.StyleFlag flag = new Aspose.Cells.StyleFlag();
flag.All = true;
sheet.Cells.ApplyStyle(style, flag);
style.VerticalAlignment = Aspose.Cells.TextAlignmentType.Center;
style.Font.IsBold = true;
flag.All = true;
sheet.Cells.Rows[0].ApplyStyle(style, flag);
sheet.Cells.ImportDataTable(dt, true, 0, 0, dt.Rows.Count, dt.Columns.Count, false, "yyyy-MM-dd", false);
book.Save(DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx", Aspose.Cells.FileFormatType.Excel2007Xlsx, Aspose.Cells.SaveType.OpenInExcel, Response);
Aspose.Cells.Worksheet sheet = book.Worksheets["Sheet1"];
sheet.FreezePanes(1, 1, 1, 0);
Aspose.Cells.Style style = book.Styles[book.Styles.Add()];
style.Pattern = Aspose.Cells.BackgroundType.Solid;
style.Borders.SetStyle(Aspose.Cells.CellBorderType.Thin);
style.Borders.SetColor(System.Drawing.Color.LightSteelBlue);
style.IsTextWrapped = true;
style.Font.Size = 10;
Aspose.Cells.StyleFlag flag = new Aspose.Cells.StyleFlag();
flag.All = true;
sheet.Cells.ApplyStyle(style, flag);
style.VerticalAlignment = Aspose.Cells.TextAlignmentType.Center;
style.Font.IsBold = true;
flag.All = true;
sheet.Cells.Rows[0].ApplyStyle(style, flag);
sheet.Cells.ImportDataTable(dt, true, 0, 0, dt.Rows.Count, dt.Columns.Count, false, "yyyy-MM-dd", false);
book.Save(DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx", Aspose.Cells.FileFormatType.Excel2007Xlsx, Aspose.Cells.SaveType.OpenInExcel, Response);
相关文章推荐
- 使用Aspose.Cells.dll导出数据到Excel
- C# 使用 C# Aspose.Cells导出多个Sheet的Excel .net导出Excel C#导出Excel
- C# winform 导出导入Excel/Doc 完整实例教程 使用Aspose.Cells.dll——第二篇
- aspose.Cells 导出Excel
- C# winform 导出导入Excel/Doc 完整实例教程 使用Aspose.Cells.dll——第一篇
- 利用Aspose.Cells完成easyUI中DataGrid数据的Excel导出功能
- Aspose.Cells操作说明中文版下载/Aspose.Cells.dll(for .net)下载 /Aspose C# 导出Excel 实例
- C# winform 导出导入Excel/Doc 完整实例教程 使用Aspose.Cells.dll——第三篇
- Aspose.Cells导出 Array.ArrayList.DataTable.DataColumn.DataView.DataGrid.GridView.DataReader数据源到Excel
- Aspose.Cells导出Excel(1)
- aspose.cells excel表格导入导出
- C# WinForm 导出导入Excel/Doc 完整实例教程[使用Aspose.Cells.dll]
- 使用Aspose.Cells利用模板导出Excel(C#)
- extjs+Aspose.Cells导出到Excel
- 导出excel设置样式(Aspose.Cells)
- 利用Aspose.Cells 组件导出数据到excel
- 利用Aspose.Cells和Excel模板导出复杂的统计数据
- aspose.cells根据模板导出excel
- C# WinForm 导出导入Excel/Doc 完整实例教程[使用Aspose.Cells.dll]
- Aspose.Cells.dll引用导入导出Excel