Share via


CrystalReportViewer Class

Provides properties, methods, and events that modify or retrieve information about how the CrystalReportViewer control appears and functions.

Namespace CrystalDecisions.Web Assembly CrystalDecisions.Web (CrystalDecisions.Web.dll)

Syntax

'Declaration
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

Example

This example shows how to create the new DrillEventHandler for CrystalReportViewer that will delegate the event to CrystalReportViewer2 through the OnDrill method. The example sets the report source for the CrystalReportViewer control and then creates the event handler.

'Declaration

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

Inheritance Hierarchy

BaseDataBoundControl
   DataBoundControl
      Object
         Control
            WebControl
               CrystalReportViewerBase
                  CrystalReportViewer

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

CrystalReportViewer Members
CrystalDecisions.Web Namespace