1

We're designing report with multilingual interface. We have developed web service which return translation of specific words. Is there any way to call the translation of labels used in report through web service or specific URL.

For e.g. something like

http://domain.com/translate?w=WORD-TO-Translate&L=ar
kodvavi
  • 111
  • 2

1 Answers1

0

I was going to recommend creating a custom assembly that would do this, but while it works from Report Builder it doesn't seem to work from my SSRS server. I'm wondering if there is an issue connecting to a web service from a custom assembly (or maybe I'm doing it wrong). Instead, I'll point you to another method for doing translations.

In case you want to pick up the custom assembly approach, here's the code I'm using:

using System;
using System.IO;
using System.Net;

namespace SSRSCustomAssembly
{
    public class Translate
    {
        public static string TranslateString(string input, string locale)
        {
            string url = string.Format("http://domain.com/translate?w={0}&L={1}", input, locale);

            HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
            req.Method = "GET";

            HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
            StreamReader sr = new StreamReader(resp.GetResponseStream());
            return sr.ReadToEnd();
        }
    }
}

In your report, just add a reference to the assembly, the call it by having an expression: =SSRSCustomAssembly.Translate.TranslateString("word", "en")

jklemmack
  • 3,518
  • 3
  • 30
  • 56