如题,谢谢

解决方案 »

  1.   

    参考:www.codeproject.com/csharp/PrintDataGridView.asp
      

  2.   

    cocosoft() 
    研究了不少控件源码啊。
      

  3.   

    to:lnwuyaowei(风可以追我)最近稍有点时间.
      

  4.   

    导到EXCEL打印
    添加控件office web Components
    using Microsoft.Office.Interop.Owc11;
               FileInfo f;
                SpreadsheetClass ex1 = new SpreadsheetClass();
                Worksheet ws = ex1.ActiveSheet;            foreach(DataRow row in gridDataSet.Tables[0])
                {
                
                    ws.Cells[i, 1] = row[0];
                    ws.Cells[i, 2] = row [1];        
       ..................
                             
                }
                try
                {                ex1.Export(@"C:\ExportSize.xls", SheetExportActionEnum.ssExportActionOpenInExcel, SheetExportFormat.ssExportXMLSpreadsheet);
                }