我有一个在asp.net Web应用程序中使用RDLC创建的报告。当我单击报告中的链接时,该链接的查询字符串附加了两次
如下所示,由于未显示哪个文件。
../ OpenPdfFileSupplier.aspx?FileName = filename.pdf&FileName = filename.pdf
在我的开发机器上没有找到导致此问题的根本原因。 请协助解决此问题。
urlUAT = "http://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath
+ "/OpenPdfFileSupplier.aspx?FileName=";
ReportParameter[] rptParam;
rptParam = new ReportParameter[5];
rptParam[0] = new ReportParameter("FromDate", Request.QueryString["d1"]);
rptParam[1] = new ReportParameter("ToDate", Request.QueryString["d2"]);
rptParam[2] = new ReportParameter("Url", urlUAT);
string url1 = "http://" + HttpContext.Current.Request.Url.Authority + prtValue +
HttpContext.Current.Request.ApplicationPath + "/VendorPaymentReceipt.aspx?sid=#id&pid=#pid&filename=#filename";
string url2 = "http://" + HttpContext.Current.Request.Url.Authority + prtValue +
HttpContext.Current.Request.ApplicationPath + "/SupplierPaymentDocuments.aspx?sid=#id";
rptParam[3] = new ReportParameter("url1", url1);
rptParam[4] = new ReportParameter("url2", url2);
// rptViewer1.Width = 1000;
rptViewer1.ProcessingMode = ProcessingMode.Local;
rptViewer1.LocalReport.ReportPath = strReportPath;
rptViewer1.LocalReport.EnableHyperlinks = true;
rptViewer1.LocalReport.DataSources.Clear();
ReportDataSource rdf = new ReportDataSource(strDatasource, dt);
this.rptViewer1.LocalReport.DataSources.Clear();
rptViewer1.LocalReport.DataSources.Add(rdf);
rptViewer1.LocalReport.SetParameters(rptParam);
rptViewer1.LocalReport.Refresh();