我想在 Firefox 中打印我的 RDLC 报告,但打印按钮图标未显示在 Firefox 浏览器中,但它在 IE 中运行良好。
谁能指导我如何在 Firefox 浏览器中打印我的报告。
不幸的是,没有办法在 Firefox 中打印 rdlc 报告。
由于 activeX 的要求,Rdlc print 仅适用于 ie。更多信息:配置和使用 ReportViewer 工具栏
msdn 上有一篇关于如何在没有预览的情况下打印本地报表的文章,但它仅适用于 winforms 报表查看器。在 asp.net 中,您无法访问客户端的打印机。 演练:打印不带预览的本地报告
不用在firefox中打印,可以直接导出rdlc。例如:
Warning[] warnings;
string[] streamIds;
string mimeType = string.Empty;
string encoding = string.Empty;
string extension = string.Empty;
string filename = "YourFileName";
// Setup the report viewer object and get the array of bytes
ReportViewer viewer = new ReportViewer();
viewer.ProcessingMode = ProcessingMode.Local;
viewer.LocalReport.ReportPath = "YourReportHere.rdlc";
byte[] bytes = viewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
// Now that you have all the bytes representing the PDF report, buffer it and send it to the client.
Response.Buffer = true;
Response.Clear();
Response.ContentType = mimeType;
Response.AddHeader("content-disposition", "attachment; filename=" + fileName + "." + extension);
Response.BinaryWrite(bytes); // create the file
Response.Flush(); // send it to the client to download