我还没有通过 SOAP API 尝试过,但不应该可以设置 Accept-Language 标头吗?我在以不同语言呈现报告时这样做。每个报告的语言设置为=User!Language
。使用 WCF 访问报表服务时,可以这样做(例如 VB.NET)
Using oReportingService As New ReportingService2010SoapClient
oReportingService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation
Using oScope As OperationContextScope = New OperationContextScope(oReportingService.InnerChannel)
If i_oSubscription.Language IsNot Nothing Then
' Accept-Language
Dim oHttpRequestProperty As New HttpRequestMessageProperty
oHttpRequestProperty.Headers.Add(HttpRequestHeader.AcceptLanguage, i_oSubscription.Language)
OperationContext.Current.OutgoingMessageProperties(HttpRequestMessageProperty.Name) = oHttpRequestProperty
End If
oReportingService.CreateSubscription(New ReportingService2010.TrustedUserHeader(), i_oSubscription.Path, oExtensionSettings, i_oSubscription.Description, "TimedSubscription", sMatchData, lstParameters.ToArray(), sSubscriptionId)
Return sSubscriptionId
End Using
End Using
编辑:这是我自己做的方式,它似乎工作:)
i_oSubscription
只是一个简单的容器,其属性如下Description
注意:这似乎在大多数情况下都有效。但是,MonthlyRecurrence 中的“天”字段的格式取决于区域设置(请参阅:https ://stackoverflow.com/questions/16011008/ssrs-monthlyrecurrence-formatting-for-different-languages )