using DevExpress.XtraPrinting; // 创建一个打印系统组件. DevExpress.XtraPrinting.PrintingSystem ps = new DevExpress.XtraPrinting.PrintingSystem(); //创建一个将要打印的链接. DevExpress.XtraPrinting.PrintableComponentLink link = new PrintableComponentLink(ps); // 指定被打印的控件. link.Component = gridControl1; // 创建报表. link.CreateDocument(); // 输出报表到指定的PDF文件. string filePath = @"c:\gridcontrol.pdf"; link.PrintingSystem.ExportToPdf(filePath); //如果你想自动创建文件请使用下面的代码 // 文件创建完毕后将自动打开. System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = filePath; process.Start();
DevExpress 输出文件的例子
最新推荐文章于 2019-10-08 11:55:54 发布