Chapter 1 Getting Started with VB.NET and Crystal Reports Debbie St. George Wonder Ranch Publishing DBA/Programmer Covington Visual Studio.Net User Group.

Slides:



Advertisements
Similar presentations
Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
Advertisements

Presentation Heading – font Arial
Crystal Reports In Depth Session XII. Crystal Reports - In Depth Reports outside of halFILE Selecting an ODBC Datasource Selecting a second table and.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
.NET C RYSTAL R EPORTS …Vishal Kumar.. I NTRODUCTION T O C RYSTAL REPORT :- For creating interactive reports that can be integrated into a wide range.
1 Web-Enabled Decision Support Systems Crystal Reports Prof. Name Position (123) University Name.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
The ADO Data Control. Universal Data Access Open Database Connectivity (ODBC) –standard for accessing data in databases OLE-DB –allows access to data.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
Using ADO.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Crystal Reports Programming In Visual Basic.NET. © 2001 by The McGraw-Hill Companies, Inc. All rights reserved Crystal Reports Gallery contains.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
SQL Reporting Services Overview SSRS includes all the development and management pieces necessary to publish end user reports in  HTML  PDF 
Microsoft SQL Server 2000 Reporting Services ( 주 ) 아이티즌 서정만 선임연구원
.Net Crystal Reports Name: Justin John Date:
Virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
Some Basic Database Terminology
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
SQL Server Reporting Services London Database Developer Forum Anoop Patel.
Crystal Hoyer Program Manager IIS Team Preview of features that will be announced at MIX09 Please do not blog, take pictures or video of session.
Copyright © 2005, 2006 Beta V Corporation All rights reserved Hitchhiker’s Guide to Visual Studio and SQL Server – Innovations in Reporting William R.
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
Tutorial 10 Adding Spry Elements and Database Functionality Dreamweaver CS3 Tutorial 101.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Using Visual Basic 6.0 to Create Web-Based Database Applications
IT 211 Project Integration and Deployment Lab #11.
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Introducing Reporting Services for SQL Server 2005.
Developing Reporting Solutions with SQL Server
1/36 Database Programming with Visual Basic.Net and MS Access IKE Lab. Yunho Song Database Management and Analysis.
2. Introduction to the Visual Studio.NET IDE. Chapter Outline Overview of the Visual Studio.NET IDE Overview of the Visual Studio.NET IDE Menu Bar and.
1 Databound Controls. 2 Objectives You will be able to use design time data binding to display and update SQL Server database data without writing any.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
1 Web-Enabled Decision Support Systems Database Connectivity in Web Applications Don McLaughlin IE 423 (304) West.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
Introduction to the Visual Studio.NET IDE (LAB 1 )
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
- Shourie. 3 Basic Questions What How Why Crystal Reports is a business intelligence application for designing and generating reports from a wide range.
1 Chapter 12 – Web Applications 12.1 Programming for the Web, Part I 12.2 Programming for the Web, Part II 12.3 Using Databases in Web Programs.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Crystal Reports Training
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
1 Database Programming with ADO.NET Kashef Mughal.
Module 1: Introduction to Microsoft SQL Server Reporting Services
VB.NET and Databases. ADO.NET VB.Net allows you many ways to connect to a database. The technology used to interact with a database or data source is.
CIS 338: VB.NET Printing Dr. Ralph D. Westfall May, 2011.
Web based Documentation Distribution Tools: MSAccess database (DSN) DreamWeaver Ultradev Microsoft Image Composer Clicking on the document will open an.
Introduction to SQL Server 2000 Reporting Services Jeff Dumas Technical Specialist Microsoft Corporation
Chapter 9 Working with Databases. Copyright © 2011 Pearson Addison-Wesley Introduction In this chapter you will learn: – Basic database concepts – How.
Entity Framework Database Connection with ASP Notes from started/getting-started-with-ef-using-mvc/creating-an-
ASP.net Course From Intermediate to Advance level By Arsalan Ahmed 3 Months Course Cell :
1 Adding a Model. We have created an MVC web app project Added a controller class. Added a view class. Next we will add some classes for managing movies.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Crystal Report CSC Rapid Application Development
Using JDeveloper.
Accessing Databases with ADO.NET, Handling Exceptions, and Printing
These slides are for reference only. They are not "lecture notes"
Presentation transcript:

Chapter 1 Getting Started with VB.NET and Crystal Reports Debbie St. George Wonder Ranch Publishing DBA/Programmer Covington Visual Studio.Net User Group

Slide 2 Objectives Create a simple Crystal Report in Visual Studio.NET Display a Crystal Report in a Windows Forms Application Display a crystal Report in a Web Forms Application Publish a Crystal Report as an XML Report Web Service Deploy Crystal Reports to the Web

Slide 3 Crystal Report Advantages Some of the major advantages of using Crystal Report for Visual Studio.NET are : - Rapid report development - Can extend it to complicated reports with interactive charts - Exposes a report object model using which it can interact with other controls on the web form - Can programmatically export the reports into widely used formats like.pdf,.doc,.xls,.html and.rtf

Slide 4 Information Delivery Infrastructure is the Key

Slide 5 Based on Standards Supports Existing Data Sources Accessible by All Users Delivered the Way User’s Want to Use Data Architecture in Detail…

Slide 6 Crystal Reports Walkthrough - using the Pull Model Add a New Project to the Solution. Project… Add Item… Crystal Decisions Window App

Slide 7 Add a Crystal Report: Go to Project.. Add New Item..Web Project Items..Crystal Report Keep the CrystalReport1.rpt as the default name for this report. Click Open and you will get the Crystal Report Gallery Dialog.

Slide 8 Select standard report

Slide 9 Select OLE DB (ADO) Microsoft Jet 4.0 OLE DB Provider

Slide 10 Adding data and fields

Slide 11 Group and Total

Slide 12 Top N and Chart Data

Slide 13 Standard Report Design

Slide 14 Crystal Report

Slide 15 Add Crystal Report Viewer to Form1.vb

Slide 16 Right-click on Form1 and View code. type Text in yellow areas.

Slide 17 Build and then run the report

Slide 18 Add Project.. new project…ASP.net web application

Slide 19 Right-click and set form as startup form. Project as startup project.

Slide 20 From an existing report

Slide 21 Add previously created CrystalReport1

Slide 22 Add code behind webform Build..Build Solution Debug.. Start without debugging

Slide 23 Run from the web.

Slide 24 As an Asp.Net Web Service

Slide 25 Add crystalreport1

Slide 26 Testing CrystalReport1Service

Slide 27 Right-click on Crystal Report and set as Startup

Slide 28 Right-Click on Form1.vb and Select View Code

Slide 29 Change ReportSource to our Web Service.asmx

Slide 30 Web Form hosted in Windows Environment

Slide 31 Add CR Deployment Project Crystal Reports Deployment Steps: * Create a Web Setup Package * Defining required runtime components

Slide 32 Web Setup Project (Note: Setup is the same for a Win Project)

Slide 33 From WebSetup (add Merge Modules)

Slide 34 Report files (.RPT) need to be distributed when a.NET application is deployed. Merge Modules CR for VS.NET provides merge modules in setup projects to make deployment a simple task. The merge modules are installed to the following folder, by default: C:\Program Files\Common Files\Merge Modules\ There are four merge modules that need to be included in a setup project to deploy reports.  Managed.MSM  Database_Access.MSM  Database_Access_enu.MSM  REGWIZ.MSM Deploy Crystal Reports

Slide 35 RegWiz.msm Needs Lic Key

Slide 36 Registering Crystal Report Product

Slide 37 Resources Crystal Decisions Website Free ASP.NET Web Matrix The XML for ASP.NET Developers Website Video Tutorials

Slide 38 Passing a Stored Procedure to a Report NOTE: This sample Windows application uses the Windows Forms viewer. The sample has one form (Form1) that contains the viewer. The report code is run from the form's constructor (Public Sub New( )). ==================== Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class Form1 Inherits System.Windows.Forms.Form 'Crystal Reports Variables Dim oRpt As New CRStoredParam() Dim crTables As Tables Dim crTable As Table Dim crTableLogOnInfo As TableLogOnInfo Dim crConnectionInfo As New ConnectionInfo() Dim crParameterValues As ParameterValues Dim crParameterDiscreteValue As ParameterDiscreteValue Dim crParameterFieldDefinitions As ParameterFieldDefinitions Dim crParameterFieldDefinition As ParameterFieldDefinition

Slide 39 #Region " Windows Form Designer generated code “ Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call ' Set the Connection parameters ' Using an OLEDB connection to a SQL Sever DB (Database: Pubs) With crConnectionInfo.DatabaseName = "DBName“.ServerName = "ServerNameOrODBCName“.UserID = "UserID“.Password = "Password“ End With crTables = oRpt.Database.Tables 'Set the logon information for each table. For Each crTable In crTables crTableLogOnInfo = crTable.LogOnInfo crTableLogOnInfo.ConnectionInfo = crConnectionInfo crTable.ApplyLogOnInfo(crTableLogOnInfo) Next Passing a Stored Procedure to a Report (cont)

Slide 40 ' Pass the Stored Procedure parameter to the report 'Get the collection of parameters from the report crParameterFieldDefinitions = oRpt.DataDefinition.ParameterFields 'Access the specified parameter from the collection crParameterFieldDefinition = 'Get the current values from the parameter field. At this point 'there are zero values set. crParameterValues = crParameterFieldDefinition.CurrentValues 'Set the current values for the numeric parameter field crParameterDiscreteValue = New ParameterDiscreteValue() crParameterDiscreteValue.Value = "50" 'Add the current value for the parameter field crParameterValues.Add(crParameterDiscreteValue) 'The current parameter values must be applied for the parameter field. crParameterFieldDefinition.ApplyCurrentValues(crParameterValues) CrystalReportViewer1.ReportSource = oRpt End Sub #End Region End Class Passing a Stored Procedure to a Report (cont)

Slide 41 CRYSTAL REPORTS WALKTHROUGH – USING THE PUSH MODEL (Objectives) 1. Create a Dataset during design time. 2. Create the.rpt file (from scratch) and make it point to the Dataset that we created in the previous step. 3. Place a CrystalReportViewer control on the.aspx page and set its properties to point to the.rpt file that we created in the previous step. 4. In your code behind page, write the subroutine to make the connections to the database and populate the dataset that we created previously in step one. 5. Call the Databind method from your code behind page.

Slide 42 Creating a Dataset during Design Time to Define the Fields of the Reports 1. Right click on "Solution Explorer", select "Add" --> select "Add New Item--> Select "DataSet"

Slide 43 2) Drag and drop the "Stores" table (within the PUBS database) from the "SQL Server" Item under "Server Explorer".

Slide 44 3) This should create a definition of the "Stores" table within the Dataset Note:The.xsd file created this way contains only the field definitions without any data in it. It is up to the developer to create the connection to the database, populate the dataset and feed it to the Crystal Report.

Slide 45 Creating the.rpt File : 4) Create the report file using the steps mentioned previously. The only difference here is that instead of connecting to the Database thru Crystal Report to get to the Table, we would be using our DataSet that we just created. 5)After creating the.rpt file, right click on the "Details" section of the Report file, select "Add/Remove Database" 6) In the "Database Expert" window, expand "Project Data" (instead of "OLE DB" that was selected in the case of the PULL Model), expand "ADO.NET DataSet", "DataSet1", and select the "Stores" table.

Slide 46 7) Include the "Stores" table into the "Selected Tables" section by clicking on ">" and then Click "ok"

Slide 47 8) Follow the remaining steps to create the report layout as mentioned previously in the PULL Model to complete the.rpt Report file creation Creating a CrystalReportViewer Control 9) Follow the steps mentioned previously in the PULL Model to create a Crystal Report Viewer control and set its properties.

Slide 48 48Code Behind Page Modifications : 10) Call this subroutine in your page load - Sub BindReport() Dim myConnection As New SqlClient.SqlConnection() myConnection.ConnectionString= "server= (local)\NetSDK;database=pubs;Trusted_Connection=yes" Dim MyCommand As New SqlClient.SqlCommand() MyCommand.Connection = myConnection MyCommand.CommandText = "Select * from Stores" MyCommand.CommandType = CommandType.Text Dim MyDA As New SqlClient.SqlDataAdapter() MyDA.SelectCommand = MyCommand Dim myDS As New Dataset1() 'This is our DataSet created at Design Time MyDA.Fill(myDS, "Stores") 'You have to use the same name as that of your Dataset that you created during design time Dim oRpt As New CrystalReport1() ' This is the Crystal Report file created at Design Time oRpt.SetDataSource(myDS) ' Set the SetDataSource property of the Report to the Dataset CrystalReportViewer1.ReportSource = oRpt ' Set the Crystal Report Viewer's property to the oRpt Report object that we created End Sub

Slide 49 Session Summary Thanks for Attending Wonder Ranch Publishing