Bryuk Bryuk - 1 year ago 229
ASP.NET (C#) Question

Render LocalReport from Reportviewer in Black and White PDF

This is how I export my report from ReportViewer in 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.ContentType = mimeType;
Response.AddHeader("content-disposition", "attachment; filename=" + reportName + "_" + ddlPracGroup.SelectedItem + "." + extension);

Is it any way to export this report in
Black and White

Answer Source

I will post my solution in case if somebody will have this questions.

I add one more parameter in rdlc report IsPrintType. This is boolean parameter. In SSRS you can set report to be black and white only. When you click your print button, reload report with this parameter > print report using code above > reload report back with color

If need code sample, just let me know

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download