Click here to Skip to main content
15,868,125 members
Articles / Programming Languages / C#

Customizing and Localizing Microsoft ReportViewer .NET - An Exact Solution

Rate me:
Please Sign up or sign in to vote.
4.67/5 (16 votes)
11 Feb 2007CPOL2 min read 129.1K   3.2K   55   12
An article about How to Customizing and Localizing Microsoft ReportViewer Toolbar

ReportViewer Toolbar

Introduction

In my last article, I've mentioned about a workaround that you may use in case you don't want to use Microsoft Reportviewer component's internal toolbar. In this article, I'm telling the way that if you want to use your own toolbar component (like Infragistics, etc.), simply hide internal toolbar and use your own toolbar and implement methods by yourself. You can reach this article here.

After I post this article, some developers sent some comments about what they need to do if they want to use Microsoft's own toolbar but if they want to localize it. So I decided to write a new article about it. And Jan de Groot sent me a great idea and working code about this and wanted me to write this article. I appreciate him for both his help and being so kind...

Localizing Reportviewer Component to Turkish

What you need to do is: Create a new class and derive it from IReportViewerMessages and set messages into your specified custom language.

C#
public class CustomReportViewerMessages:IReportViewerMessages
{
    public CustomReportViewerMessages(IReportViewerMessages 
                                    reportViewerMessages)
    {
        this.InitializeMessages(reportViewerMessages);
        if (reportViewerMessages != null)
        {
            this.backButtonToolTip = reportViewerMessages
                                     .BackButtonToolTip;
            this.backMenuItemText = reportViewerMessages
                                    .BackMenuItemText;
            ...
            ...
        }
    }
}

More Resources about RDL

Background

Create a message class and customize its messages as you wish and use it on reportviewer.

C#
private void customizeMessages()
{
    this.customMessages = new CustomReportViewerMessages(
                              this.reportViewer.Messages);
    this.customMessages.FindButtonText = "Bul";
    this.customMessages.FindButtonToolTip = 
                                    "Girilen metni bul";
    ...
}

Using the Code

You can simply call your customization method after you set report path:

C#
public ReportViewerForm()
{
    InitializeComponent();
    customizeMessages();
}

In the source code project, there are also some extra buttons on the toolstrip. For full implementation, see the source file above.

Conclusion

Microsoft ReportViewer is a powerful component to display your report and RDL is a good way to implement reporting features. I believe that in the near future, many RDL designer tools and RDL viewer tools will be available on the market.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) MikroKom Yazilim A.S.
Turkey Turkey
c# , vb6 , mssql , oracle , mysql , asp , asp.net developer.

Comments and Discussions

 
Questiongreat Pin
altanaltan1234510-Jul-13 1:04
altanaltan1234510-Jul-13 1:04 
GeneralAdding spell check functionality to reportviewer Pin
Member 282711523-Oct-08 20:39
Member 282711523-Oct-08 20:39 
GeneralThanks Pin
rigster2-Jun-08 12:37
rigster2-Jun-08 12:37 
QuestionImplement IReportViewerMessages with vb.net Pin
Miguel Matos20-Apr-07 0:13
Miguel Matos20-Apr-07 0:13 
AnswerRe: Implement IReportViewerMessages with vb.net Pin
yincekara20-Apr-07 3:39
yincekara20-Apr-07 3:39 
AnswerRe: Implement IReportViewerMessages with vb.net Pin
Miguel Matos20-Apr-07 7:25
Miguel Matos20-Apr-07 7:25 
Generalthank you Pin
Maksi21-Feb-07 1:55
Maksi21-Feb-07 1:55 
QuestionIs there any method to hide document map Pin
Member 115743114-Feb-07 12:58
Member 115743114-Feb-07 12:58 
Sorry, this may be out-track question, but I think I will get my answer from here.

My user complained that while they open reports, they shows document map at left side, which is annoying them. Is any way to hide this on report first launch? I don't want to delete it entirely, but want to hide, so user can show it again by clicking its icon.


AnswerRe: Is there any method to hide document map Pin
polymorphism21-Feb-07 2:08
polymorphism21-Feb-07 2:08 
GeneralRe: Is there any method to hide document map Pin
Greg Olmstead9-May-08 5:19
Greg Olmstead9-May-08 5:19 
GeneralLocalization not working Pin
Daniel Nutu13-Feb-07 1:03
Daniel Nutu13-Feb-07 1:03 
GeneralRe: Localization not working Pin
polymorphism13-Feb-07 1:15
polymorphism13-Feb-07 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.