ReportViewer.Messages Property
Gets or sets an object that contains custom messages for use by the ReportViewer control.
Namespace: Microsoft.Reporting.WinForms
Assembly: Microsoft.ReportViewer.WinForms (in microsoft.reportviewer.winforms.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)> _
Public Property Messages As IReportViewerMessages
'Usage
Dim instance As ReportViewer
Dim value As IReportViewerMessages
value = instance.Messages
instance.Messages = value
[BrowsableAttribute(false)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
public IReportViewerMessages Messages { get; set; }
[BrowsableAttribute(false)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility::Hidden)]
public:
property IReportViewerMessages^ Messages {
IReportViewerMessages^ get ();
void set (IReportViewerMessages^ value);
}
/** @property */
public IReportViewerMessages get_Messages ()
/** @property */
public void set_Messages (IReportViewerMessages value)
public function get Messages () : IReportViewerMessages
public function set Messages (value : IReportViewerMessages)
Property Value
An object that implements the IReportViewerMessages interface.
Remarks
You can implement the IReportViewerMessages interface to provide custom localization of the ReportViewer control user interface. This implementation can be passed to the ReportViewer control by setting the Messages property of the ReportViewer control.
Note
The IReportViewerMessages interface does not allow customization of local or server report processing error messages.
Returning a null string value for a property will cause the ReportViewer control to display the original user interface string for that item.
Example
The following code sample shows an implementation of IReportViewerMessages being passed to the ReportViewer control.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;
using System.Diagnostics;
namespace MySample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
CCustomMessageClass myMessageClass = new CCustomMessageClass();
reportViewer1.Messages = myMessageClass;
this.reportViewer1.RefreshReport();
}
}
public class CCustomMessageClass : IReportViewerMessages
{
#region IReportViewerMessages Members
public string BackButtonToolTip
{
get { return ("BackButtonToolTip here."); }
}
public string BackMenuItemText
{
get { return("Add your custom text here."); }
}
public string ChangeCredentialsText
{
get { return("Add your custom text here."); }
}
public string CurrentPageTextBoxToolTip
{
get { return("Add your custom text here."); }
}
public string DocumentMapButtonToolTip
{
get { return("Add your custom text here."); }
}
public string DocumentMapMenuItemText
{
get { return("Add your custom text here."); }
}
public string ExportButtonToolTip
{
get { return("Add your custom text here."); }
}
public string ExportMenuItemText
{
get { return("Add your custom text here."); }
}
public string FalseValueText
{
get { return("Add your custom text here."); }
}
public string FindButtonText
{
get { return("Add your custom text here."); }
}
public string FindButtonToolTip
{
get { return("Add your custom text here."); }
}
public string FindNextButtonText
{
get { return("Add your custom text here."); }
}
public string FindNextButtonToolTip
{
get { return("Add your custom text here."); }
}
public string FirstPageButtonToolTip
{
get { return("Custom first page tool tip"); }
}
public string LastPageButtonToolTip
{
get { return(null); }
}
public string NextPageButtonToolTip
{
get { return("Add your custom text here."); }
}
public string NoMoreMatches
{
get { return("Add your custom text here."); }
}
public string NullCheckBoxText
{
get { return("Add your custom text here."); }
}
public string NullCheckBoxToolTip
{
get { return("Add your custom text here."); }
}
public string NullValueText
{
get { return("Add your custom text here."); }
}
public string PageOf
{
get { return("Add your custom text here."); }
}
public string PageSetupButtonToolTip
{
get { return("Add your custom text here."); }
}
public string PageSetupMenuItemText
{
get { return("Add your custom text here."); }
}
public string ParameterAreaButtonToolTip
{
get { return("Add your custom text here."); }
}
public string PasswordPrompt
{
get { return("Add your custom text here."); }
}
public string PreviousPageButtonToolTip
{
get { return("Add your custom text here."); }
}
public string PrintButtonToolTip
{
get { return("Add your custom text here."); }
}
public string PrintLayoutButtonToolTip
{
get { return("Add your custom text here."); }
}
public string PrintLayoutMenuItemText
{
get { return("Add your custom text here."); }
}
public string PrintMenuItemText
{
get { return("Add your custom text here."); }
}
public string ProgressText
{
get { return("Add your custom text here."); }
}
public string RefreshButtonToolTip
{
get { return("Add your custom text here."); }
}
public string RefreshMenuItemText
{
get { return("Add your custom text here."); }
}
public string SearchTextBoxToolTip
{
get { return("Add your custom text here."); }
}
public string SelectAValue
{
get { return("Add your custom text here."); }
}
public string SelectAll
{
get { return("Add your custom text here."); }
}
public string StopButtonToolTip
{
get { return("Add your custom text here."); }
}
public string StopMenuItemText
{
get { return("Add your custom text here."); }
}
public string TextNotFound
{
get { return("Add your custom text here."); }
}
public string TotalPagesToolTip
{
get { return("Add your custom text here."); }
}
public string TrueValueText
{
get { return("Add your custom text here."); }
}
public string UserNamePrompt
{
get { return("Add your custom text here."); }
}
public string ViewReportButtonText
{
get { return("Add your custom text here."); }
}
public string ViewReportButtonToolTip
{
get { return("Add your custom text here."); }
}
public string ZoomControlToolTip
{
get { return("Add your custom text here."); }
}
public string ZoomMenuItemText
{
get { return("Add your custom text here."); }
}
public string ZoomToPageWidth
{
get { return("Add your custom text here."); }
}
public string ZoomToWholePage
{
get { return("Add your custom text here."); }
}
#endregion
}
}
See Also
Reference
ReportViewer Class
ReportViewer Members
Microsoft.Reporting.WinForms Namespace