日期:2014-05-20 浏览次数:21522 次
using Aspose.Cells; //已经添加了应用
……
public void Export(string querySql)
{
DataTable dt = ExcuteDataTable(querySql);
dt.TableName = "A";
if (dt.Rows.Count == 0)
return;
WorkbookDesigner designer = new WorkbookDesigner();
designer.Open(@"D:\book1.xls");
designer.SetDataSource(dt);
designer.Process();
……
}