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);