Change Language of ReportViewer Buttons

4 posts, 1 answers
  1. Benedikt
    Benedikt avatar
    18 posts
    Member since:
    Feb 2018

    Posted 10 Sep Link to this post

    Hey guys,

    I want to change the Tooltip-Labels (and any other labels) of the ReportViewer in my C# WPF Application.

    I don't want to localize anything in my report. ust these default buttons.

    Is there any way I can do this? I tried to set the Language property to de-DE but it not affected anything.

     

    I would be glad about any help.

     

    Greetings

    Benedikt

  2. Answer
    Eric R | Technical Support Engineer
    Admin
    Eric R | Technical Support Engineer avatar
    168 posts

    Posted 12 Sep Link to this post

    Hi Benedikt,

    Unfortunately, there isn't a simple way to directly set the Tool Tip Text of the Report Viewer buttons and will require some localization. The simplest way is to apply Localization using the ITextResources interface. This would look like the below code snippet. Note that this will require updating all of the Tool Tip Text return values. Although, if it is not in use it can return an empty string.

    As an aside, please forgive any poorly translated strings in the below.

    public MainWindow()
    {
        InitializeComponent();
        ReportViewer1.TextResources = new CustomTextResources();
    }
    
    class CustomTextResources : ITextResources
    {
        public string AllFiles => "";
    
        public string BackToolTip => "Navigieren zurück in die Geschichte";
    
        public string CancelButtonText => "Abbrechen";
    
        public string CurrentPageToolTip => "Aktuelle Seite";
    
        public string DocumentMapToolTip => "";
    
        public string ExportError => "";
    
        public string ExportingMessage => "";
    
        public string ExportToolTip => "Exportieren";
    
        public string FirstPageToolTip => "";
    
        public string ForwardToolTip => "Navigieren fofrward in der Geschichte";
    
        public string LabelOf => "";
    
        public string LastPageToolTip => "";
    
        public string LoadingPageMessage => "";
    
        public string NextPageToolTip => "";
    
        public string NoPageToDisplay => "";
    
        public string NoReportError => "";
    
        public string PageNumberGreaterThanRangeError => "";
    
        public string PageNumberLessThanRangeError => "";
    
        public string PageSetupToolTip => "Seiteneinrichtung...";
    
        public string ParametersToolTip => "";
    
        public string PreviewButtonText => "Wechseln zur Druckvorschau";
    
        public string PreviousPageToolTip => "";
    
        public string PrintPreviewToolTip => "";
    
        public string PrintToolTip => "Druck";
    
        public string ProcessingReportMessage => "";
    
        public string RefreshToolTip => "Erfrischen";
    
        public string StopToolTip => "Anhalten";
    
        public string ReportParametersAreaValidationError => "";
    
        public string ReportParametersNullText => "";
    
        public string ReportParametersSelectAllText => "";
    
        public string ReportParametersValidationError => "";
    
        public string InvalidValueForParameter => "";
    
        public string TotalPagesToolTip => "";
    
        public string UpdatingParametersMessage => "";
    
        public string ZoomToolTip => "";
    
        public string ZoomToPageWidth => "";
    
        public string ZoomToWholePage => "";
    
        public string SessionExpired => "";
    
        public string AccessibilityReportContentsArea => "";
    
        public string AccessibilityDocumentMapArea => "";
    
        public string AccessibilityParametersArea => "";
    
        public string AccessibilityParameter => "";
    
        public string AccessibilityParameterText => "";
    
        public string AccessibilityParameterBoolean => "";
    
        public string AccessibilityParameterDateTime => "";
    
        public string AccessibilityParameterNumerical => "";
    
        public string AccessibilityParameterMultiSelect => "";
    
        public string AccessibilityParameterMultiValue => "";
    
        public string AccessibilityParameterErrorMessage => "";
    
        public string AccessibilityPageNumberEditor => "";
    
        public string AccessibilityPageNumberSelector => "";
    
        public string AccessibilityReportViewerToolbar => "";
    
        public string AccessibilityStatus => "";
    
        public string AccessibilityStatusEnabled => "";
    
        public string AccessibilityStatusDisabled => "";
    
        public string AccessibilityToolbarButtonToggleParameters => "";
    
        public string AccessibilityToolbarButtonToggleDocumentMap => "";
    
        public string AccessibilityStateChecked => "";
    
        public string AccessibilityStateUnchecked => "";
    
        public string SearchCaptionLabel => "";
    
        public string SearchToolTip => "";
    
        public string SearchStopToolTip => "";
    
        public string SearchMatchCaseToolTip => "";
    
        public string SearchMatchWholeWordToolTip => "";
    
        public string SearchUseRegexToolTip => "";
    
        public string SearchNoMetadata => "";
    
        public string SearchNoResults => "";
    
        public string SearchResultsFormatString => "";
    }

     

    See the Localization Using the ITextResources Interface documentation for more details.

    I hope this helps. Please let me know if you need any additional information. Thank you.

    Regards,


    Eric R | Technical Support Engineer
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Benedikt
    Benedikt avatar
    18 posts
    Member since:
    Feb 2018

    Posted 13 Sep in reply to Eric R | Technical Support Engineer Link to this post

    Hi Eric,

    I'm fully ok with that solution and it works very well. Thank you for the help.

    I have found one thing you should change in the documentation: PrintPreviewToolTip -> Specifies the tooltip for the Print Preview.

    Here are two values seperated by |. One is the tooltip for the print preview and one for the interactive preview.

     

    Greetings Benedikt

  4. Eric R | Technical Support Engineer
    Admin
    Eric R | Technical Support Engineer avatar
    168 posts

    Posted 13 Sep Link to this post

    Hi Benedikt,

    I am glad that this solution works for you. Additionally, thank you for providing the feedback on our documentation. I will personally make note of this and see that it is updated. 

    Please let me know if you need any additional information. Thank you for using Telerik Reporting.

    Regards,


    Eric R | Technical Support Engineer
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top