Crystal Report CSC 204 2.0 Rapid Application Development Department of Statistics and Computer Science Faculty of Applied Sciences University of Sri Jayewardanepura
How to Start Project Add New Item Crystal Reports Add Using the Report wizard Standard OK Create New Connection OLE DB (ADO) Next Microsoft OLE DB Provider for SQL Server Next Select Sql Server name , Database Name enter userid , password. next Select all fields Finish Kasun@sjp.ac.lk
Design See Reference for more Kasun@sjp.ac.lk
Call the Crystal Reports in VB Call the Crystal Reports in VB.NET through Crystal Reports Viewer control Add CrystalReportViewer Controller Imports CrystalDecisions.CrystalReports.Engine Dim cryRpt As New ReportDocument cryRpt.Load(“Path\CrystalReport1.rpt") CrystalReportViewer1.ReportSource = cryRpt CrystalReportViewer1.Refresh() Kasun@sjp.ac.lk
App.config <?xml version="1.0"?> <configuration > <startup useLegacyV2RuntimeActivationPolicy = "true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration> Kasun@sjp.ac.lk
Dim m_Report As New CrystalReport3 Form1.CrystalReportViewer1.ReportSource = m_Report m_Report.VerifyDatabase() m_Report.SetDataSource(ds.Tables(“csc”)) Kasun@sjp.ac.lk
Multiple Tables Select all table from the table list make relation between these selected tables (drag to the related field of the other table) Kasun@sjp.ac.lk
Reference Mastering VB.NET 2010 eBook www http://vb.net-informations.com/crystal-report/vb.net_crystal_report_sample_database.htm Kasun@sjp.ac.lk