SQL Server Performance

Multi Language Reports

Discussion in 'SQL Server 2005 Reporting Services' started by rajesh_malhotra2004, Jan 16, 2007.

  1. rajesh_malhotra2004 New Member

    Hello Everyone,

    I have a requirement where i need to display the labels of my report in different languages. The main page of my Reports gives an option of Selecting the language. Once the user selects the desired language any report that he opens should come in that language. I have Data for French, German and English Language. I can display the data depending upon the language the user selects but how to display the Labels in that same language. I am using Sql Server 2005 Reporting Services.

    Please help...........

    Thanks
  2. Babin New Member

    Hi Rajesh,

    You can very well do that. Simple method is to write a function in the report code, where the passing parameters will be language_id and the word_in_english. The function will return the hardcoded value according to the language_id.

    For Ex:-
    Function in Report Code:-

    Public Function Labelname (language_id Stirng, word_in_english String) as String
    Select Case language_id
    Case “fr-ca” (// For French)
    Select Case word_in_english
    Case “ABC”
    Return “(French of ABC)”
    Case Else “”
    End Select
    Case “de” (//For german)
    Select Case word_in_english
    Case “ABC”
    Return “(French of ABC)”
    Case Else “”
    End Select
    End Select

    You can call the function from the label with the parameters as follows
    = code. Labelname(User!Language, “ABC”)

    Things to keep in mind:-
    "User!Language" will be the language id of the internet explorer and not of the system locale. So if you need to change the language of the report header, see to it that you need to change the language of the browser. There is nothing that you need to update thru main page.

    Drawback of this method is that, if you need to add a new language you will have to edit the rdl file.

    To overcome this drawback, you can think about making this function a dll, which can be referred in the report and in the funtion fetching the necessary details from a database. Intern you will have to update the database with the necessary details.

    Try this; hope this will help you out.

Share This Page