Adding resource files

3 posts, 0 answers
  1. Paul Kater
    Paul Kater avatar
    7 posts
    Member since:
    May 2010

    Posted 01 Jun 2010 Link to this post

    Hello,

    I want to use resource files in my reports. I found the way that has to be done w.r.t. the culture-identification, and that is quite simple.
    My problem however is that I don't know where to put the files. I found some C# code that will allow me to access a resource file but that does not work as I don't know where I have to tell it where the resourcefiles are. That code is:

    public static string ReadResourceValue(string file, string key)
            {
                //value for our return value
                string resourceValue = string.Empty;
                try
                {
                    // specify your resource file name
                    string resourceFile = file;
                    // get the path of your file
                   // string filePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString();
                    string filePath = "";
                    // create a resource manager for reading from
                    //the resx file
                    ResourceManager resourceManager = ResourceManager.CreateFileBasedResourceManager(resourceFile, filePath, null);
                    // retrieve the value of the specified key
                    resourceValue = resourceManager.GetString(key);
                }
                catch (Exception ex)
                {
                    resourceValue = string.Empty;
                }
                return resourceValue;
            }

    Is there a simple (simpler) way to do this?

    Thank you
  2. Paul Kater
    Paul Kater avatar
    7 posts
    Member since:
    May 2010

    Posted 02 Jun 2010 Link to this post

    Found and fixed:

    http://www.telerik.com/help/reporting/advanced-localizing-reports.html had the answer for me:

    To localize a report:

    1. In the designer set the Report Localizable property to true.
    2. Select a Language property value from the drop down list in the properties window.
    3. Translate the static text into the desired language indicated by the Language property.

  3. deepak
    deepak avatar
    1 posts
    Member since:
    May 2018

    Posted 17 May 2018 Link to this post

    Hello,

    Can we add two Resource file in .cs for two different language, by default one is creating  ,other i want to add like Spanish , so that based on  Culture,it may fetch the value

     

Back to Top