在我的asp.net mvc3(Razor)
应用程序中,我rdlc
用于报告。出于打印目的,我只是need to convert the rdlc into image
. 我刚刚尝试了以下代码
public ActionResult FilePrint()
{
LocalReport localReport = new LocalReport();
localReport.ReportPath = @"Reports/OP/Rdlc/ClinicInvoiceReceipt.rdlc";
iClinicInvoiceReceipt = new RmtOPInvoice.ClinicInvoiceReceipt();
DataTable dt = iClinicInvoiceReceipt.SelectReceiptDtlForPrint(2);
ReportDataSource reportDataSource = new ReportDataSource();
reportDataSource.Value = dt;
reportDataSource.Name = "DataSet1";
localReport.DataSources.Add(reportDataSource);
string reportType = "Image";
string mimeType;
string encoding;
string fileNameExtension;
Warning[] warnings;
string[] streams;
byte[] renderedBytes;
//Render the report
renderedBytes = localReport.Render(
reportType,
null,
out mimeType,
out encoding,
out fileNameExtension,
out streams,
out warnings);
return File(renderedBytes, "Image");
}
并且在视野中
<img src="@Url.Action("FilePrint","ClinicInvoiceReceipt")" />
但它不起作用。我怎样才能做到这一点?如果有人知道请分享..