Crystal Report PrintToPrinter-没有安装打印机错误

时间:2018-12-07 17:04:43

标签: c# asp.net printing iis-7 crystal-reports-xi

ReportDocument report = new ReportDocument();
ConnectionInfo conInfo = new ConnectionInfo();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
Tables CrTables;
conInfo.ServerName = serverName; 
conInfo.DatabaseName = DBName;
conInfo.UserID = User;
conInfo.Password = Password;

report.Load(reportPath);
CrTables = report.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
    crtableLogoninfo = CrTable.LogOnInfo;
    crtableLogoninfo.ConnectionInfo = conInfo;
    CrTable.ApplyLogOnInfo(crtableLogoninfo)
}
CrTables.Dispose();
report.PrintOptions.PrinterName = @"\\dest\Kyocera TASKalfa420i - Mail Room";
report.PrintToPrinter(2, false, 0, 0);`

这是通过IIS7的Web应用程序。尝试使用PrintToPrinter时,出现错误消息“未安装打印机”。服务器上已安装打印机...已使用

进行了验证
System.Drawing.Printing.PrinterSettings.InstalledPrinters

正在使用的AppPool是具有LocalSystem标识的ASPNET 4.0。

当我知道服务器(Windows 2008)上已安装打印机时,为什么说没有安装打印机?

0 个答案:

没有答案