Crystal Reports for Visual Studio
Introduction ► Crystal
Reports for Visual Studio .NET is the standard reporting tool for Visual Studio .NET; it brings the ability to create interactive, presentation-quality content.
► With
Crystal Reports for Visual Studio .NET, you can host reports on Web and Windows platforms and publish Crystal reports as Report Web Services on a Web server.
Brief History ► Crystal
Reports has a long history of integration with Microsoft. ► Microsoft and has shipped with Visual Basic 6(and subsequently Visual Studio) as the default report writer since 1993. ► Visual Studio 2002/2003/2005 versions includes Crystal Reports.
Why use a reporting tool? ► Presentation
of data in well formatted manner in the user interface of application. ► Quickly and easily make changes to your reports without making changes to your code. ► Can import the data to other applications/various formats easily.
Crystal Report Features ► Database
Expert of Crystal Reports can easily interact with a wide variety of database protocols, as well as proxy data in the form of ADO.NET DataSets. ► We can display Crystal reports on forms, in both Web and Windows applications. ► An exporting feature exports data from the Crystal Report to Word, Excel, PDF, and HTML, and Crystal Reports formats.
Crystal Report Features ► Crystal
Report provides the pagebased report printing from any Web or Windows application. ► Multilingual client support allows you to configure the Crystal Report so that other languages can be displayed in the Tool Tips.
► Crystal
Crystal Report Namespaces
Reports for Visual Studio .NET provides the following 7 namespaces:
CrystalDecisions.CrystalReports.Engine CrystalDecisions.ReportSource CrystalDecisions.Shared CrystalDecisions.Web CrystalDecisions.Web.Services CrystalDecisions.Web.Services.Enterprise CrystalDecisions.Windows.Forms
► CrystalDecisions.CrystalReports.Engine
Provides support for the report engine. ► CrystalDecisions.ReportSource
Provides classes that comprise a layer between the Windows Forms Viewer or the Web Forms Viewer, and the Crystal Reports Engine. These classes handle requests from the viewers. The classes then determine how to contact the engine and make the call on the viewer's behalf.
► CrystalDecisions.Shared
Namespace
Provides classes, interfaces, and enumerations that are shared by the Web Forms Viewer, Windows Forms Viewer, and Crystal Report Engine. ► CrystalDecisions.Web
Namespace
Provides support for the Crystal Reports Web Viewer control and its associated classes. ► CrystalDecisions.Web.Services
Provides support classes for exposing Crystal Reports as Web Services.
► CrystalDecisions.Web.Services.Enterprise
Provides support classes for consuming reports from Crystal Enterprise. ► CrystalDecisions.Windows.Forms
Provides support for the Windows Forms Viewer control and associated classes.
Crystal Report Classes Namespace CrystalDecisions.CrystalReports.Engine CrystalDecisions.ReportSource CrystalDecisions.Shared
Classes 64 1 18
CrystalDecisions.Web
8
CrystalDecisions.Web.Services
1
CrystalDecisions.Web.Services.Enterprise
1
CrystalDecisions.Windows.Forms
8
Commonly Used Classes Class
Description
Area
Represents an area in a report. An area is a group of like sections in the report that all share the same characteristics.
AreaFormat
Allows you to retrieve information and set options for a specified area in a report.
GraphicObject
Base class providing generic properties for various kinds of graphic objects.
PictureObject
Represents a picture object on the report. This class allows you to retreive information and set generic format options inherited from the GraphicObject class.
BoxObject
Represents a box that has been drawn on the report. This class allows you to retreive information and set generic format options inherited from the DrawingObject class.
Class
Description
ChartObject
Represents a chart object on the report. This class allows you to retreive information and set generic format options inherited from the ReportObject class.
CommonFieldFormat
Allows you to set format options common to all fields in a report.
ReportDefinition
Allows you to retrieve all Areas, ReportObjects, and Sections in a report.
Database
Provides properties to get information about the database accessed by a report.
ReportDocument
Represents a report and contains properties and methods to define, format, load, export, and print the report.
SpecialVarFieldDefinition Provides properties for retrieving information on a special field found in a report. SummaryInfo
Allows you to get and set summary report information.
Class
Description
DataDefinition
Contains all the information relating to data manipulation based on the data source in a report.
SubreportObject
Allows you to get and set date format options for a date field in a report.
DateTimeGroupOptionsRepresents a subreport placed in a report. A subreport is a freestanding or linked report found within the main report. This class allows you to retreive information and set generic format options inherited from the ReportObject class, as well as allowing you to open the subreport as a ReportDocument. DrawingObject
Base class providing generic properties for various kinds of drawing objects.
Table
Represents a database table accessed by the report. This class provides properties and methods to get information about the table and set logon information for the table.
Adding a Report to a Project ► Crystal
Report is a part of Add New Item templates available in Visual Studio.
► To
add a report to the project, add a new item by Right Clicking on the project in Solution Explorer and selecting Add->Add New Item->Crystal Report as you can see in Figure.
Thank You !