找回密码
 立即注册

QQ登录

只需一步,快速开始

pleaglefly
金牌服务用户   /  发表于:2024-7-5 15:55  /   查看:951  /  回复:1
1金币
客户电脑里有多个打印机,要做个设置,每次用指定的打印机来打印,要怎么设置,或代码操作?


最佳答案

查看完整内容

问题描述: 报表指定打印机打印 问题回答: 您好,我们的后端打印可以指定打印机驱动进行打印: PrinterName 就是指定打印机名称打印,[/backcolor]ShowPrintDialog[/backcolor] 为是否显示打印窗口,不显示就是静默打印[/backcolor]

1 个回复

倒序浏览
最佳答案
最佳答案
Felix.LiWyn认证
超级版主   /  发表于:2024-7-5 15:55:34
来自 2#
问题描述:

报表指定打印机打印

问题回答:
您好,我们的后端打印可以指定打印机驱动进行打印:
  1. GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport();
  2.             GrapeCity.ActiveReports.PrinterSettings printerSettings = new GrapeCity.ActiveReports.PrinterSettings();
  3.             printerSettings.ShowPrintDialog = true;
  4.             printerSettings.Printer.PrinterName = @"Microsoft Print to PDF";
  5.             pageReport.Load(new System.IO.FileInfo(@"Reports\Untitled.rdlx"));
  6.             GrapeCity.ActiveReports.Document.PageDocument pageDocument = new GrapeCity.ActiveReports.Document.PageDocument(pageReport);

  7.             pageDocument.Print(printerSettings);
复制代码
PrinterName 就是指定打印机名称打印,ShowPrintDialog 为是否显示打印窗口,不显示就是静默打印
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部