Microsoft KB Archive/919153

= The report does not reflect the locale setting of the client computer when you render a report in the SQL Server 2005 Reporting Services Web service or in the SQL Server 2000 Reporting Services Web service =

Article ID: 919153

Article Last Modified on 6/6/2006

-

APPLIES TO


 * Microsoft SQL Server 2005 Reporting Services
 * Microsoft SQL Server 2000 Reporting Services

-





SYMPTOMS
In the Microsoft SQL Server 2005 Reporting Services Web service or in the Microsoft SQL Server 2000 Reporting Services Web service, you render a report by using the Render method. When you do this, the report does not reflect the locale setting of the client computer.

For example, if you use the User!Language expression in a report, the value of the expression is not set to the locale setting of the client computer.

Note For backward compatibility, the Web service that is provided in SQL Server 2000 Reporting Services is still provided in SQL Server 2005 Reporting Services. You can access this Web service by using the following URL:

http:// /reportserver/reportservice.asmx?wsdl

In this URL,  is a placeholder for the name of the server that is running the report server.



CAUSE
This problem occurs because the Accept-Language HTTP response header is not transmitted when the Web service sends the SOAP requests to the Reporting Services Web server.



RESOLUTION
To resolve this problem, specify the Accept-Language HTTP response header by overriding the GetWebRequest function. To do this, follow these steps:  Locate the folder of the Microsoft Visual Studio project that you created to render the report. In a text editor, open the Reference.cs file or the Reference.vb file.

Note These files are in the \Web References\  folder.  In the Reporting Services Web service proxy class that is defined in the Reference.cs file or in the Reference.vb file, add the following code.

Microsoft Visual C#

protected override WebRequest GetWebRequest(Uri uri) { HttpWebRequest wr = base.GetWebRequest(uri) as HttpWebRequest; wr.Headers.Add(&quot;Accept-Language:&quot; + System.Globalization.CultureInfo.CurrentCulture.Name); return wr; }

Microsoft Visual Basic

Protected Overrides Function GetWebRequest(ByVal uri As Uri) As WebRequest Dim wr As HttpWebRequest = TryCast(MyBase.GetWebRequest(uri),HttpWebRequest) wr.Headers.Add((&quot;Accept-Language:&quot; & System.Globalization.CultureInfo.CurrentCulture.Name)) Return wr End Function  At the start of the Reference.cs file or of the Reference.vb file, add a reference to the System.Net namespace. Save the project, and then rebuild the project.

Note If you create the Web service proxy by using the Web Services Description Language tool (Wsdl.exe), you must add the override function to the file that is generated by the tool.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbsql2005rs kbexpertiseadvanced kbtshoot kbprb KB919153

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.