注:要添加COM组件 Microsoft Excel 11.0 Object Library 引用. 具体代码如下: using System; using System.Collections.Generic; using System.Text; using System.Data.SqlClient; using Excel; using System.Reflection; using System.Data; using System.Data.OleDb; namespace Re
procedure CreatRepSheet(SheetName:String;PageSize,PageLay:Integer); {新建Excel工作簿.进行页面设置} begin {新建Excel工作簿} then begin ExlBook := ExlApp.Workbooks.Add; //ExlBook:=ExlApp.WorkBooks[].WorkSheets[]; ExlApp.ActiveSheet.Name:=SheetName; end; {if} {进行页面设置}