Crystal report

Download Crystal report

Post on 04-Dec-2014




0 download

Embed Size (px)


Crystal report


<ul><li> 1. Crystal Report</li></ul> <p> 2. What is crystal report? How to implement using crystal report 3. What is crystal report Crystal Reports is a business intelligence application used todesign and generate reports from a wide range of datasources. Crystal Reports is the built-in report designing tool in VisualStudio .NET and it is fully integrated with windows and webapplications. 4. How data transferred Imagine we are using ADO .NET to get a subset of data fromSQL Server and store it in a DataSet. Then we conduct thedata from dataset to CrystalReportViewer object to bedisplayed. SQL Server -&gt; SQLConnection -&gt; SQLDataAdaptor -&gt; DataSet -&gt; CrystalReportDocument -&gt; CrystalReportViewer -&gt; ASP .NETweb page. In .NET application Crystal Report Document reads the datafrom dataset, NOT directly from data provider and this is thekey point to Crystal Report integration with .NET. 5. Crystal Report Advantages major advantage of using crystal report forvisual studio .NET are*Rapid report development*can extend it to complicated reports withinteractive charts*can programmatically export the reports intowidely used formats like.pdf,.doc,.xls,.html,and .rtf 6. Publish Content Into Crystal Report ***There are 2 ways to publish content into Crystal1. Pull Method2. Push Method* Crystal Reports, like many other applications, connects to adatabase by way of a database driver, where each driver isdesigned to handle a specific database type or method of dataaccess. With Crystal Reports, you can use one of two modelsof accessing data: "Pull" and "Push." 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. 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 thereport, and then assigns the object to the report.This model also allows the shaping and filtering of data before itreaches the report. 9. Steps to create a crystal report 10. Create a new website and right click on solution explorer &gt;add new Item &gt; Select Crystal ReportIn the dialog box choose blank report. 11. Now click on CrystalReports Menu in VS and select DataBaseExpert 12. In database expert dialog box expend create new connection&gt; OLEDB(ADO) section 13. Now select Microsoft OLE DB provider for sql server 14. Connection information 15. Selected data base you choose was selected 16. In next screen Expend your database objects in left pane andadd the tables you want to use in right pane 17. Then after next step view the field explore shown like this 18. Now design the report , drag and fields from Database fieldsin field explorer and which you want to show in report anddrop them in Section3(Details), and preview the report, itshould look like show below. 19. Report preview look like this 20. Create a aspx page </p> <p> 21. Code Behind Protected Sub Page_Load (ByVal sender As Object, ByVal e AsEventArgs)Dim crystalReport As New ReportDocument()crystalReport.Load(Server.MapPath("CrystalReport.rpt"))crystalReport.SetDatabaseLogon ("amit", "password","AMITSQLEXPRESS", "TestDB")CrystalReportViewer1.ReportSource = crystalReport End Sub 22. Thank you 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. Contact Us </p>