是的。在我尝试同样的问题之前。但之后,我得到了解决方案。最主要的是,我们无法直接从客户机打印报告。我发现了两种在客户机中打印报告的方法。一个是通过ActiveX控件。客户端不知道,如何在他们的机器上安装ActiveX控件,主要是他们不想要那些令人讨厌的东西。所以我发现了我们可以通过PDF文件打印的另一种方式。现在所有人都在他们的机器上安装了Adobe PDF阅读器。所以我浏览过,如何直接打印pdf而不用保存在客户端机器上。最后我得到了解决方案。步骤如下:
用C#编写的示例代码。 i)。)))))))))))))(
i)。转换报告到内存流:
string reportType = "PDF";
string mimeType;
string encoding;
string fileNameExtension;
//The DeviceInfo settings should be changed based on the reportType
////http://msdn2.microsoft.com/en-us/library/ms155397.aspx
string deviceInfo = "<DeviceInfo>" + " <OutputFormat>PDF</OutputFormat>" + " <PageWidth>8.27in</PageWidth>" + " <PageHeight>11.69in</PageHeight>" + " <MarginTop>0in</MarginTop>" + " <MarginLeft>0in</MarginLeft>" + " <MarginRight>0in</MarginRight>" + " <MarginBottom>0in</MarginBottom>" + "</DeviceInfo>";
Warning[] warnings;
string[] streams;
byte[] renderedBytes;
//Render the report
renderedBytes = _rptViewer.LocalReport.Render(reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);
Stream mystream = new MemoryStream(renderedBytes);
谢谢您的回复。实际上,无论我做什么,我都可以得到相同的结果,安装,不要安装,甚至只是在显示对话框时暂停一会儿......它们都会使浏览器中的选项卡崩溃,并且网站消失,然后浏览器“恢复”一个空白标签。这是在IE中必须是我使用的浏览器(每个客户端) – rogdawg 2010-10-08 13:48:53
试试这个: 转到Program Files \ Microsoft SQL Server \ MSSQL.x \ Reporting Services \ ReportServer \ bin,并将这些文件复制到Windows \ Downloaded程序文件(使用命令行窗口,CMD): - RSClientPrint.dll - rsclientprint.inf - RsClientPrint_1028.rll - RsClientPrint_1031.rll - RsClientPrint_1033.rll - RsClientPrint_1036.rll - RsClientPrint_1040.rll - RsClientPrint_1041.rll - RsClientPrint_1042.rll - RsClientPrint_2052.rll - RsClientPrint_3082.rll 然后,注册RSClientPrint.dll(regsvr32 [路径] RSClientPrint.dll)。如果您在那里找不到这些文件,请解压缩rsclientprint.cab。 – 2010-10-08 14:45:53
感谢您关注此事。我仍然得到一个错误...这次,我选择安装ActiveX的东西。它遇到了一个问题,问我是否想要调试问题(使用调试器),我选择了否,并且它以与之前相同的方式崩溃了浏览器(选项卡)。我想我应该停止在报告上打印。我的客户可能无法下载ActiveX控件来打印。感谢您的帮助。我会告诉他们先导出为excel(或PDF),然后打印。非常感谢您的指导。 – rogdawg 2010-10-08 20:23:08