2011-05-06 14 views
1
i am using rdlc reporting to display report, in rdlc report i was 
set hyperlink for another report like 

    ="http://localhost:8080/ReportForms/RECRptAdvertisement.aspx? 
    reqid="&Fields!RequirementID.Value 

    from above url my hyperlink working fine in localhost but if i change it to like 

    ="~/RECRptAdvertisement.aspx?reqid="&Fields!RequirementID.Value 

    it is not working so how do i set my hyperlink url to be workable in 
localhost as well as in server. 
can any body help me or guide me in appropriate way? 

回答

0

您是否嘗試過手動將值傳遞給URL以查看它是否在本地主機URL和命名實例上行爲相同?那麼通過IP進行嘗試呢?

像...

 
="~/RECRptAdvertisement.aspx?reqid=20001298" 
1

您需要將服務器URL傳遞給報表作爲參數,那麼你的文本框表達式應該引用本地報表參數。

添加新的參數,以您的報告,將其設置爲=Parameters!ReportParameterUrl.Value

當加載的ReportViewer,設置正確的網址:

 baseUrl = Request.Url.Scheme + @"://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + '/'; 
     ReportParameter rp = new ReportParameter("ReportParameterUrl", baseUrl); 
     this.rvMyReport.LocalReport.SetParameters(new ReportParameter[] { rp }); 

最後,你的文本框表達式應該是

=Parameters!ReportParameterUrl.Value + "RECRptAdvertisement.aspx?reqid="&Fields!RequirementID.Value 
相關問題