This is a migrated thread and some comments may be shown as answers.

Change Language of ReportViewer Buttons

6 Answers 797 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Benedikt asked on 10 Sep 2019, 08:52 AM

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

6 Answers, 1 is accepted

Sort by
0
Accepted
Eric R | Senior Technical Support Engineer
Telerik team
answered on 12 Sep 2019, 06:26 PM

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
0
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
answered on 13 Sep 2019, 05:58 AM

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

0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 13 Sep 2019, 09:46 PM

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
0
Heiko
Top achievements
Rank 1
Iron
Veteran
answered on 26 Nov 2020, 09:03 AM

Hi Eric,

according to this article it is also possible to use a .resx file. This worked well in my old .NET Framework solution but it is not working anymore in the WPF project using .NET Core 3.1. Does it mean I have to convert all my resource strings to this kind of CustomTextResources file? If so, a brief note in the help text would be appropriate! (see attached screenshots; "Keine" means "none" and "Kopieren, wenn neuer" means "copy if newer", I did everything just like the help article suggests)

Regards
Heiko

0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 30 Nov 2020, 02:05 PM

Hi Heiko,

Thank you for the resources. After reviewing them and testing this out locally, it appears that this is related to the Report Viewer in .NET Core. As a result, I have reached out to the development team to investigate further. 

Once we have more information we will reply to this ticket. 

In the meantime, please let me know if you need any additional information. Thank you.

Regards,


Eric R | Senior Technical Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 16 Dec 2020, 05:44 PM

 Hi Heiko,

Thank you for your patience with this and my apologies for the delay. After further investigation, we found that the existing ResXResourceManager used in the .NET Framework to load and retrieve resources no longer works in the same way for .NET Core. As a result, let me provide a potential workaround below. 

Potential Workaround

In .NET Core, the recommended approach for localizing apps is to use the IStringLocalizer. See the Microsoft localization article more details. To read from the resx files, refer to the StackOverflow ASP.NET Core ResX thread.

Additionally, in .NET Core the .resx files need to have their Build Action set to EmbeddedResource rather than None, as documentation suggests. This allows to fall back to the default embedded resources in WPF viewer's assembly. The effect is that the tooltips show the default values and the NullReferenceException is not thrown anymore.

Wrapping Up

We will create a new issue in our public portal and update the localization docs as soon as possible. At this time, we cannot confirm when localization will be implemented in .NET Core as it may not be ready for R1 2021.

Please let me know if you need any additional information. Thank you again for your patience in this matter and for being a valued Telerik Reporting developer.

Regards,


Eric R | Senior Technical Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Eric R | Senior Technical Support Engineer
Telerik team
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Heiko
Top achievements
Rank 1
Iron
Veteran
Share this question
or