SSRS用Javascript打开新报表其参数变乱码
向大家提一个有关于SSRS方面的问题,有一个主报表(想通过参数钻取一个新报表),点击某个栏位,用Javascript弹出一个新页并传入参数(子报表文件夹及名称,其他参数)至URL,并在新页程序中得到参数并在页面中的Reportviewer进行展示,日期参数(数字型)可以顺利传达到,可是如果传递的是中文参数则程序得到的是乱码,不知道应该怎么样修改?
报表脚本
="javascript:void window.open('./JumpToReport.aspx?ReportFolder=SSRSForCRMExpenseIncome&ReportName=SalesrepExpenseIncomeView&DimDateTimeByCRMYearName=" + Trim(Parameters!DimDateTimeByCRMYearName.Label) + "&DimTerritoryByCRMTerritoryName=" + trim(Fields!办事处.Value) +"','','height=500,width=500, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes')"-------其中办事处是中文的,传入到程序中却会出现错误
程序编码
For i = 0 To l_strRptParameter.Length - 1
If l_strRptParameter(i) = "DimDateTimeByCRMYearName" Then
l_strRptValue(i) = "[DimDateTimeByCRM].[Year Name].&[" & l_strRptValue(i) & "]"
ElseIf l_strRptParameter(i) = "DimTerritoryByCRMTerritoryName" Then
Dim strCode As Encoding = Encoding.Default
l_strRptValue(i) = "[DimTerritoryByCRM].[Territory Name].&[" & HttpUtility.UrlDecode(l_strRptValue(i).ToString(), strCode) & "]"
End If
Next
[解决办法]
try link below
http://hi.baidu.com/wpdforever/blog/item/ea3ed0435642f1149313c6d9.html