Download - Crystal report

Transcript
Page 1: Crystal report
Page 2: Crystal report

Crystal Report

Page 3: Crystal report

• What is crystal report?

• How to implement using crystal report

Page 4: Crystal report

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.

Page 5: Crystal report

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.

Page 6: Crystal report

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

Page 7: Crystal report

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."

Page 8: Crystal report

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.

Page 9: Crystal report

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.

Page 10: Crystal report

Steps to create a crystal report

Page 11: Crystal report

• Create a new website and right click on solution explorer > add new Item > Select Crystal ReportIn the dialog box choose blank report.

Page 12: Crystal report

• Now click on CrystalReports Menu in VS and select DataBase Expert

Page 13: Crystal report

• In database expert dialog box expend create new connection > OLEDB(ADO) section

Page 14: Crystal report

• Now select Microsoft OLE DB provider for sql server

Page 15: Crystal report

• Connection information

Page 16: Crystal report

• Selected data base you choose was selected

Page 17: Crystal report

• In next screen Expend your database objects in left pane and add the tables you want to use in right pane

Page 18: Crystal report

• Then after next step view the field explore shown like this

Page 19: Crystal report

• 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.

Page 20: Crystal report

• Report preview look like this

Page 21: Crystal report
Page 22: Crystal report

Create a aspx page• <form id="form1" runat="server"> <div> <CR:CrystalReportViewer ID="CrystalReportViewer1"

runat="server" AutoDataBind="True" Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" />

<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">

<Report FileName="CrystalReport.rpt"> </Report> </CR:CrystalReportSource>

</div> </form>

Page 23: Crystal report

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", "AMIT\

SQLEXPRESS", "TestDB") CrystalReportViewer1.ReportSource = crystalReport End Sub

Page 24: Crystal report

Thank you

Page 25: Crystal report

Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra – Mentoring Partnerbaabtra – Mentoring Partner is the mentoring division of baabte System Technologies Pvt. Ltd

Page 26: Crystal report

Contact Us


Top Related