3. • What is crystal report?
• How to implement using crystal report
4. What is crystal report
• Crystal Reports is a business intelligence application used to
design and generate reports from a wide range of data
sources.
• Crystal Reports is the built-in report designing tool in Visual
Studio .NET and it is fully integrated with windows and web
applications.
5. How data transferred
• Imagine we are using ADO .NET to get a subset of data from
SQL Server and store it in a DataSet. Then we conduct the
data from dataset to CrystalReportViewer object to be
displayed.
• SQL Server -> SQLConnection -> SQLDataAdaptor -> DataSet -
> CrystalReportDocument -> CrystalReportViewer -> ASP .NET
web page.
• In .NET application Crystal Report Document reads the data
from dataset, NOT directly from data provider and this is the
key point to Crystal Report integration with .NET.
6. Crystal Report Advantages
• major advantage of using crystal report for
visual studio .NET are
*Rapid report development
*can extend it to complicated reports with
interactive charts
*can programmatically export the reports into
widely used formats like
.pdf,.doc,.xls,.html,and .rtf
7. Publish Content Into Crystal Report
• ***There are 2 ways to publish content into Crystal
1. Pull Method
2. Push Method
* Crystal Reports, like many other applications, connects to a
database by way of a database driver, where each driver is
designed to handle a specific database type or method of data
access. With Crystal Reports, you can use one of two models
of accessing data: "Pull" and "Push."
8. Pull Model
• In this model, the report will connect to the database, using
the parameters given to it a design time, to pull the data as
needed.
• In this mode, all of the work is done by the report:
* connecting to the database and issuing the SQL commands;
*These are all handled without any coding from the developer.
*This is the default model of Crystal Reports.
9. Push Method
• The push model involves code written by a developer that:
* creates and calls a connection on the database,
*executes the SQL commands,
*creates a record set or dataset that matches the fields in the
report, and then assigns the object to the report.
This model also allows the shaping and filtering of data before it
reaches the report.
17. • In next screen Expend your database objects in left pane and
add the tables you want to use in right pane
18. • Then after next step view the field explore shown like this
19. • Now design the report , drag and fields from Database fields
in field explorer and which you want to show in report and
drop them in Section3(Details), and preview the report, it
should look like show below.
23. Code Behind
• Protected Sub Page_Load (ByVal sender As Object, ByVal e As
EventArgs)
Dim crystalReport As New ReportDocument()
crystalReport.Load(Server.MapPath("CrystalReport.rpt"))
crystalReport.SetDatabaseLogon ("amit", "password",
"AMITSQLEXPRESS", "TestDB")
CrystalReportViewer1.ReportSource = crystalReport End Sub
25. Disclaimer: This presentation is prepared by trainees of baabtra as a part of
mentoring program. This is not official document of baabtra – Mentoring Partner
baabtra – Mentoring Partner is the mentoring division of baabte System Technologies Pvt. Ltd