0

これは、レポートを 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このレポートをOnlyでエクスポートする方法はありますか?

4

1 に答える 1

-1

誰かがこの質問をする場合に備えて、私の解決策を投稿します。

rdlc report にもう 1 つのパラメーターを追加しますIsPrintType。これはブール値のパラメーターです。SSRS では、レポートを白黒のみに設定できます。印刷ボタンをクリックすると、reload report with this parameter > print report using code above > reload report back with color

コードサンプルが必要な場合はお知らせください

于 2014-06-10T17:29:13.010 に答える