Pre-Assessment Questions: Creating Crystal Reports
Pre-Assessment Questions: Creating Crystal Reports
Pre-Assessment Questions
1. Consider the following statements:
• Statement A: A dataset can maintain four versions of a DataRow object.
• Statement B: The four versions are Original, Current, Proposed, and
Default.
Which of the following is correct with respect to the above statements?
a. Both, Statement A and Statement B, are False.
b. Both, Statement A and Statement B, are True.
c. Statement A is True and Statement B is False.
d. Statement A is False and Statement B is True.
Solutions to Pre-Assessment
Questions
1. b. Both, Statement A and Statement B, are True.
2. c. Statement A is True and Statement B is False.
3. c. Statement A is True and Statement B is False.
4. a. Both, Statement A and Statement B, are False.
5. b. Both, Statement A and Statement B, are True.
Objectives
In this lesson, you will learn to:
• Access data through crystal reports
• Create a crystal report manually
• Use the Standard Report Expert
• Create a report from an existing report
• Enhance the crystal report
• Host a crystal report in the windows application
• View the crystal report
• Access filtered data through crystal reports
• Access related data through crystal reports
• Crystal Reports need database drivers to connect to the data source for
accessing data.
• Crystal Reports in Visual Basic .NET support two methods to access data from
a data source:
• The Pull Model
• The Push Model
DATA
Demo
Accessing Filtered Data through
Crystal Reports
Problem Statement
• The Sales Manager of Diaz Telecommunications needs to view a summarized
report containing the order details for the products with sale price greater
than $3000 to identify the potential market for the products in the coming
period. In addition, the Sales Manager also needs to view the percentage of
the sale price paid as advance for each order.
Solution
• To create the required application, perform following tasks:
1. Retrieve the filtered data from the database.
2. Create a crystal report manually and group the data.
3. Create the formula for calculating percentage.
4. Host the Crystal Report.
5. Write the code to connect to the database at run time.
6. View the Crystal report.
Demo
Accessing Related Data Through
Crystal Reports
Problem Statement
• The Sales Manager of Diaz Telecommunications needs to view a summarized
product-wise order details report. The product name for each product also
needs to be displayed in the report.
Solution
• To create the required application, perform following tasks:
1. Create a Crystal Report
2. Host the Crystal Report.
3. View the Crystal report.
Summary
In this lesson, you learned that:
• A Crystal Report is a standard reporting tool for Visual Studio .NET used to
display data of presentation quality.
• Crystal Reports use database drivers to connect with the data source for
accessing data.
• Crystal Reports in Visual Basic .NET supports two methods to access data
from a data source:
• The Pull model
• The Push model
• The presentation quality of a Crystal Report can be enhanced by adding the
following components to the Crystal Report:
• Chart
• Cross-tab
Summary (Contd.)
• A Crystal Report can be hosted in a Windows Form by using the Windows
Forms Viewer.
• Apart from allowing an easy viewing of the Crystal Report in a Windows
application, the Windows Forms Viewer also dynamically updates the
Crystal Report that is hosted.
• The Windows Forms Viewer can be inserted into a Windows application by
dragging the CrystalReportViewer control from the Toolbox into the form.
• The Windows Forms Viewer contains the following components:
• Toolbar
• Group Tree
• Main Report Window
• An interaction can be created between the Windows Forms Viewer and
other controls on the Windows Form by handling the events of the Windows
Form controls and the Windows Forms Viewer.
Summary (Contd.)
• An interaction can be created between the Windows Forms Viewer and
other controls on the Windows Form by handling the events of the Windows
Form controls and the Windows Forms Viewer.
• To display a Crystal Report, it has to be bound to a CrystalReportViewer
control.
• A Crystal Report can be bound to a CrystalReportViewer control by setting
the ReportSource property of the CrystalReportViewer control to the
path of the Crystal Report file.