Crystal report


Published on

Crystal report

  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Crystal report

  1. 1. Crystal Report
  2. 2. • What is crystal report?• How to implement using crystal report
  3. 3. 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.
  4. 4. 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.
  5. 5. 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
  6. 6. 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."
  7. 7. 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.
  8. 8. 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.
  9. 9. Steps to create a crystal report
  10. 10. • Create a new website and right click on solution explorer > add new Item > Select Crystal Report In the dialog box choose blank report.
  11. 11. • Now click on CrystalReports Menu in VS and select DataBase Expert
  12. 12. • In database expert dialog box expend create new connection > OLEDB(ADO) section
  13. 13. • Now select Microsoft OLE DB provider for sql server
  14. 14. • Connection information
  15. 15. • Selected data base you choose was selected
  16. 16. • In next screen Expend your database objects in left pane and add the tables you want to use in right pane
  17. 17. • Then after next step view the field explore shown like this
  18. 18. • 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.
  19. 19. • Report preview look like this
  20. 20. 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>
  21. 21. 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
  22. 22. Thank you
  23. 23. Disclaimer: This presentation is prepared by trainees of baabtra as a part ofmentoring program. This is not official document of baabtra – Mentoring Partnerbaabtra – Mentoring Partner is the mentoring division of baabte System Technologies Pvt. Ltd
  24. 24. Contact Us