共用方式為


IReportViewerMessages 介面

可讓應用程式提供自訂的使用者介面訊息。

命名空間:  Microsoft.Reporting.WinForms
組件:  Microsoft.ReportViewer.WinForms (在 Microsoft.ReportViewer.WinForms.dll 中)

語法

'宣告
Public Interface IReportViewerMessages
public interface IReportViewerMessages
public interface class IReportViewerMessages
type IReportViewerMessages =  interface end
public interface IReportViewerMessages

IReportViewerMessages 類型會公開下列成員。

屬性

  名稱 描述
公用屬性 BackButtonToolTip 提供 [上一步] 按鈕的工具提示文字。
公用屬性 BackMenuItemText 提供 [上一步] 功能表項目的文字。
公用屬性 ChangeCredentialsText 提供 [變更認證] 按鈕的文字。
公用屬性 CurrentPageTextBoxToolTip 提供 [目前的頁面] 文字方塊的工具提示文字。
公用屬性 DocumentMapButtonToolTip 提供 [文件引導模式] 按鈕的工具提示文字。
公用屬性 DocumentMapMenuItemText 提供 [文件引導模式] 功能表項目的文字。
公用屬性 ExportButtonToolTip 提供 [匯出] 按鈕的工具提示文字。
公用屬性 ExportMenuItemText 提供 [匯出] 功能表項目的文字。
公用屬性 FalseValueText 提供 false 值的文字。
公用屬性 FindButtonText 提供 [尋找] 按鈕的文字。
公用屬性 FindButtonToolTip 提供 [尋找] 按鈕的工具提示文字。
公用屬性 FindNextButtonText 提供 [尋找下一個] 按鈕的文字。
公用屬性 FindNextButtonToolTip 提供 [尋找下一個] 按鈕的工具提示文字。
公用屬性 FirstPageButtonToolTip 提供 [第一頁] 按鈕的工具提示文字。
公用屬性 LastPageButtonToolTip 提供 [最後一頁] 按鈕的工具提示文字。
公用屬性 NextPageButtonToolTip 提供 [下一頁] 按鈕的工具提示文字。
公用屬性 NoMoreMatches 提供無其他相符項目之訊息的文字。
公用屬性 NullCheckBoxText 提供 [Null] 核取方塊的文字。
公用屬性 NullCheckBoxToolTip 提供 [Null] 核取方塊的工具提示文字。
公用屬性 NullValueText 提供 Null 值的文字。
公用屬性 PageOf 提供分頁訊息的文字。
公用屬性 PageSetupButtonToolTip 提供 [頁面設定] 按鈕的工具提示文字。
公用屬性 PageSetupMenuItemText 提供 [頁面設定] 功能表項目的文字。
公用屬性 ParameterAreaButtonToolTip 提供 [參數區域] 按鈕的工具提示文字。
公用屬性 PasswordPrompt 提供密碼提示的文字。
公用屬性 PreviousPageButtonToolTip 提供 [上一頁] 按鈕的工具提示文字。
公用屬性 PrintButtonToolTip 提供 [列印] 按鈕的文字。
公用屬性 PrintLayoutButtonToolTip 提供 [列印配置] 按鈕的工具提示文字。
公用屬性 PrintLayoutMenuItemText 提供 [列印配置] 功能表項目的文字。
公用屬性 PrintMenuItemText 提供 [列印] 功能表項目的文字。
公用屬性 ProgressText 提供處理報表時所顯示之進度訊息的文字。
公用屬性 RefreshButtonToolTip 提供 [重新整理] 按鈕的工具提示文字。
公用屬性 RefreshMenuItemText 提供 [重新整理] 功能表項目的文字。
公用屬性 SearchTextBoxToolTip 提供 [搜尋] 文字方塊的工具提示文字。
公用屬性 SelectAll 提供多重值下拉式清單方塊中之 [全選] 項目的文字。
公用屬性 SelectAValue 提供 [選取值] 提示的文字。
公用屬性 StopButtonToolTip 提供 [停止] 按鈕的工具提示文字。
公用屬性 StopMenuItemText 提供 [停止] 功能表項目的文字。
公用屬性 TextNotFound 提供 [找不到文字] 訊息的文字。
公用屬性 TotalPagesToolTip 提供 [總頁數] 項目的工具提示文字。
公用屬性 TrueValueText 提供 true 值的文字。
公用屬性 UserNamePrompt 提供使用者名稱提示的文字。
公用屬性 ViewReportButtonText 提供 [檢視報表] 按鈕的文字。
公用屬性 ViewReportButtonToolTip 提供 [檢視報表] 按鈕的工具提示文字。
公用屬性 ZoomControlToolTip 提供 [縮放] 控制項的工具提示文字。
公用屬性 ZoomMenuItemText 提供 [縮放] 功能表項目的文字。
公用屬性 ZoomToPageWidth 提供 [縮放至頁寬] 選項的文字。
公用屬性 ZoomToWholePage 提供 [縮放至全頁] 項目的文字。

回頁首

備註

您可以實作 IReportViewerMessages 介面,以提供 ReportViewer 控制項使用者介面的自訂當地語系化。可以藉由設定 ReportViewer 控制項的 Messages 屬性,將這個實作傳遞給 ReportViewer 控制項。

注意事項注意事項

IReportViewerMessages 介面不允許自訂本機或伺服器報表處理錯誤訊息。

針對屬性傳回 nullnull 參考 (即 Visual Basic 中的 Nothing) 字串值時,將會造成 ReportViewer 控制項顯示該項目的原始使用者介面字串。

範例

下列程式碼範例會示範傳遞給 ReportViewer 控制項的 IReportViewerMessages 實作。

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
    }
}

請參閱

參考

Microsoft.Reporting.WinForms 命名空間