我還沒有通過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