共用方式為


CrystalReportViewer 類別

提供屬性、方法及事件,用來修改或擷取有關 CrystalReportViewer 控制項出現及作用方式的資訊。

命名空間 CrystalDecisions.Web 組件 CrystalDecisions.Web (CrystalDecisions.Web.dll)

語法

Public Class CrystalReportViewer
    Inherits CrystalReportViewerBase
    Implements IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IPostBackEventHandler, INamingContainer, ICallbackEventHandler
public class CrystalReportViewer : CrystalReportViewerBase, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IPostBackEventHandler, INamingContainer, ICallbackEventHandler

範例

這個範例顯示如何為將透過 OnDrill 方法委派事件給 CrystalReportViewer2CrystalReportViewer 建立新的 DrillEventHandler。這個範例會設定 CrystalReportViewer 控制項的報表來源,然後再建立事件處理常式。

      Private Sub Page_Load _
         (ByVal sender As System.Object, ByVal e As System.EventArgs) _
         Handles MyBase.Load
      
         Me.CrystalReportViewer.ReportSource = _ 
            Me.MapPath("DecemberSales.rpt")
         Me.CrystalReportViewer2.ReportSource =  _
            Me.MapPath("JanuarySales.rpt")
         AddHandler CrystalReportViewer.Drill, _
            AddressOf(CrystalReportViewer2.OnDrill)
      
      End Sub
      private void Page_Load(object sender, System.EventArgs e)
      {
         CrystalReportViewer.ReportSource = 
            this.MapPath("DecemberSales.rpt");
         CrystalReportViewer2.ReportSource = 
            this.MapPath("JanuarySales.rpt");
         this.CrystalReportViewer.Drill += new 
            CrystalDecisions.Web.DrillEventHandler
            (CrystalReportViewer2.OnDrill);
      }

繼承階層

BaseDataBoundControl
   DataBoundControl
      Object
         Control
            WebControl
               CrystalReportViewerBase
                  CrystalReportViewer

版本資訊

Crystal Reports Basic for Visual Studio 2008

自從 Crystal Reports for Visual Studio .NET 2002 開始支援

請參閱

參考

CrystalReportViewer 成員
CrystalDecisions.Web 命名空間