1
RDLC (VS2010)를 사용하여 웹 페이지 (MVC3)에서 간단한 배송 레이블을 PDF로 렌더링합니다. RDLC (ShipmentId)에 전달해야하는 단일 매개 변수가 있습니다. 해당 매개 변수를 전달하면 전달하는 매개 변수를 표시해야하는 텍스트 상자를 제외하고 보고서가 올바르게 렌더링됩니다.보고서 매개 변수가 표시되어야하는 '#Error'를 표시하는 로컬 RDLC 보고서
RDLC의 텍스트 상자의 값이 'Parameters! ShipmentId.Value'로 설정되어 있습니다.
shipment.ShipmentId = "123TEST";
Warning[] warnings;
string mimeType;
string[] streamids;
string encoding;
string filenameExtension;
LocalReport report = new LocalReport();
report.ReportPath = @"Labels\ShippingLabel.rdlc";
report.Refresh();
report.EnableExternalImages = true;
ReportParameter param = new ReportParameter("ShipmentId", shipment.ShipmentId, true);
report.SetParameters(param);
report.Refresh();
byte[] bytes = report.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);
return new FileContentResult(bytes, mimeType);