这是我如何从ReportViewer导出PDF格式的报告:
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
byte[] myBytes;
string reportName = hfReportName.Value;
myBytes = rvReport.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
Response.Buffer = true;
Response.Clear();
Response.ContentType = mimeType;
Response.AddHeader("content-disposition", "attachment; filename=" + reportName + "_" + ddlPracGroup.SelectedItem + "." + extension);
Response.BinaryWrite(myBytes);
Response.Flush();
是否有办法只在Black and White
中导出这个报告?
我将把我的解决方案贴出来,以防有人有这个问题。
我在rdlc报告IsPrintType
中添加了一个参数。这是一个布尔参数。在SSRS中,您可以将报告设置为仅黑色和白色。当你点击打印按钮,reload report with this parameter > print report using code above > reload report back with color
如果需要代码样本,请告诉我