我还没有通过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
注意:这似乎大部分工作。但是,每月发布中的“天数”字段应与格式化的区域设置有关(请参阅:https://stackoverflow.com/questions/16011008/ssrs-monthlyrecurrence-formatting-for-different-languages)
P.S:谨慎格式化。显然,每月发布的“天数”必须用“en-US”的逗号和“de-DE”的分号格式化。 – urbanhusky 2013-04-15 08:15:52
感谢您的回复。我刚刚尝试过你的方法,但它没有奏效。对于新订阅,订阅表中的区域设置值仍然设置为'en'-US'。您是使用此代码进行订阅还是仅用于呈现报告?由于我们在第一部分只有问题,因此我们只需通过在主管报告的asp.net页面中指定UserLocale就能够以我们想要的任何语言呈现报表。 – tomsky 2013-04-17 08:14:09
@tomsky我使用相同的样式呈现报表以及创建订阅。 PS我扩展了代码示例以显示更多相关的代码。 Locale值然后相应地设置。 – urbanhusky 2013-04-17 10:34:50