How To: Create a Crystal Report from ADO.NET Dataset using Visual Basic.NET



Similar documents
Crystal Reports. For Visual Studio.NET. Reporting Off ADO.NET Datasets

Creating Reports Using Crystal Reports

CRYSTAL REPORTS IN VISUAL STUDIO.NET 2003

Crystal Reports for Visual Studio.NET

Although most agree that it got off to a slower-than-anticipated start, Microsoft s

Crystal Reports. For Visual Studio.NET. Designing and Viewing a Report in a Windows Application

Chapter 4 Accessing Data

1. Create SQL Database in Visual Studio

Using Crystal Reports with VFP

Crystal Reports for Eclipse

Hands-On Lab. Building a Data-Driven Master/Detail Business Form using Visual Studio Lab version: Last updated: 12/10/2010.

Developing Own Crystal Reports

CRM Setup Factory Installer V 3.0 Developers Guide

How To Create A Powerpoint Intelligence Report In A Pivot Table In A Powerpoints.Com

Introduction to Visual Basic and Visual C++ Database Foundation. Types of Databases. Data Access Application Models. Introduction to Database System

Crystal Reports.NET Programming

Producing Listings and Reports Using SAS and Crystal Reports Krishna (Balakrishna) Dandamudi, PharmaNet - SPS, Kennett Square, PA

Sophos Reporting Interface Creating Reports using Crystal Reports 2008

Release 2.1 of SAS Add-In for Microsoft Office Bringing Microsoft PowerPoint into the Mix ABSTRACT INTRODUCTION Data Access

Introduction to Computer and Information Science CIS 110, Fall 2015

Creating and Consuming XML Web Services

Whitepaper. HR Dashboard STRATEGIC VALUE CREATION USING MICROSOFT REPORTING SERVICES YOUR SUCCESS IS OUR FOCUS

Crystal Reports.NET Overview

How To Create A Report In Excel

VB.NET - DATABASE ACCESS

Excel will open with the report displayed. You can format and/or save the report as desired.

Crystal Reports Installation Guide

Walkthrough: Creating and Using an ASP.NET Web Service in Visual Web Developer

Working with SQL Server Integration Services

Creating XML Report Web Services

Installing OneStop Reporting Products

SQL Server 2005: Report Builder

DEPLOYING A VISUAL BASIC.NET APPLICATION

HTTP communication between Symantec Enterprise Vault and Clearwell E- Discovery

BID2WIN Workshop. Advanced Report Writing

DigitalPersona Pro Server for Active Directory v4.x Quick Start Installation Guide

Mastering Visual Basic.NET Database Programming Evangelos Petroutsos; Asli Bilgin

5 Airport. Chapter 5: Airport 49. Right-click on Data Connections, then select Add Connection.

Trial version of GADD Dashboards Builder

Microsoft' Excel & Access Integration

Tool Tip. SyAM Management Utilities and Non-Admin Domain Users

Pastel Evolution BIC. Getting Started Guide

Visual Basic. murach's TRAINING & REFERENCE

Tracing and Debugging in ASP.NET

Windows Firewall Configuration with Group Policy for SyAM System Client Installation

Getting Started Guide

MS WORD 2007 (PC) Macros and Track Changes Please note the latest Macintosh version of MS Word does not have Macros.

Visual Studio.NET Database Projects

GOOGLE DOCS APPLICATION WORK WITH GOOGLE DOCUMENTS

MICROSOFT EXCEL 2011 MANAGE WORKBOOKS

Crystal Converter User Guide

Hands-On Lab. Client Workflow. Lab version: Last updated: 2/23/2011

ASP.NET Programming with C# and SQL Server

Getting Started Guide SAGE ACCPAC INTELLIGENCE

Creating Reports with Microsoft Dynamics AX SQL Reporting Services

Instructions. Introduction

Outlook Quick Steps & Rules

Batch Scanning. 70 Royal Little Drive. Providence, RI Copyright Ingenix. All rights reserved.

Richmond SupportDesk Web Reports Module For Richmond SupportDesk v6.72. User Guide

WHAT S NEW IN OBIEE

Using SQL Reporting Services with Amicus

Manage messages by using rules

Chapter 4 Displaying and Describing Categorical Data

This document details the following four steps in setting up a Web Server (aka Internet Information Services -IIS) on Windows XP:

for Sage 100 ERP Business Insights Overview Document

Have you ever done something the long way and then

ADOBE READER AND ACROBAT

How to Create Your Own Crystal Report

Working with Data in ASP.NET 2.0 :: Creating Stored Procedures and User Defined Functions with Managed Code Introduction

Moving BidMagic to a new system (Backup / Restore Utility)

Outlook . User Guide IS TRAINING CENTER. 833 Chestnut St, Suite 600. Philadelphia, PA

MicroStrategy Desktop

OUTLOOK 2007 USER GUIDE

Creating a New Database and a Table Owner in SQL Server 2005 for exchange@pam

Learn how to create web enabled (browser) forms in InfoPath 2013 and publish them in SharePoint InfoPath 2013 Web Enabled (Browser) forms

Magaya Software Installation Guide

1. CONFIGURING REMOTE ACCESS TO SQL SERVER EXPRESS

Sage Intelligence Report Designer Add-In

INGESTING NWIS DATA USING VB.NET AND VISUAL STUDIO 2008

A Tutorial on SQL Server CMPT 354 Fall 2007

Developing Web and Mobile Dashboards with Oracle ADF

Junk Settings. Options

TROUBLESHOOTING INCORRECT REPORTING OF THE WHO CHANGED PARAMETER

BusinessObjects Enterprise XI Release 2

Ambientes de Desenvolvimento Avançados

Reporting for Contact Center Setup and Operations Guide. BCM Contact Center

BRIO QUERY FUNCTIONALITY IN COMPARISION TO CRYSTAL REPORTS

Differences between Computer and User Templates

A SharePoint Developer Introduction. Hands-On Lab. Lab Manual SPCHOL306 Using Silverlight with the Client Object Model VB

SmartConnect Users Guide

Teamcenter s manufacturing process management 8.3. Report Generator Guide. Publication Number PLM00064 E

Set up My Sites (SharePoint Server

MicrosoftDynam ics GP TenantServices Installation and Adm inistration Guide

DEVELOPING CONTRACT - DRIVEN WEB SERVICES USING JDEVELOPER. The purpose of this tutorial is to develop a java web service using a top-down approach.

ContractInsight. Desktop Edition. Contract Management Tracking Software. User Guide

Toad for Data Analysts, Tips n Tricks

ORACLE BUSINESS INTELLIGENCE WORKSHOP

CTERA Agent Sync Edition for Windows

How to Work with Crystal Reports in SAP Business One

etoken Enterprise For: SSL SSL with etoken

Transcription:

How To: Create a Crystal Report from ADO.NET Dataset using Visual Basic.NET See also: http://support.businessobjects.com/communitycs/technicalpapers/rtm_reporting offadonetdatasets.pdf http://www.businessobjects.com/products/dev_zone/net_walkthroughs.asp http://www.tek-tips.com/gfaqs.cfm/pid/796/fid/3940 Introduction: Crystal Report of Visual Studio.NET is the standard reporting tool for Visual Studio.NET. You can host reports on web and windows platform and can publish reports as Report Web services on the web server. It is based on framework of Crystal Report 8.0 and uses open and flexible architecture, with standards like XML, to allow porting reports over the web. Using crystal report expert you can choose report layouts, display charts, calculate summaries, subtotals as grouped data as well as conditionally format text and rotate text objects. Although Crystal Reports for Visual Studio.NET supports variety of data source like ADO recordset, CDO recordset, DAO recordset, MS Excel workbook, this walkthrough endeavor to explain How to report off ADO.NET DataSet using Visual Basic.NET. As you all know DataSet is the core component of distributed application and is explicitly designed for data access independent of any data source. Dataset can be created from variety of sources. Whatever the source is, before reporting off ADO.NET DataSet you must perform the following task: Generate an object for the DataSet. Connect report to DataSet Object. Push data into DataSet Object. Bind report to Windows Forms Viewer to display report with actual data at runtime. Requirements: Visual Studio.NET 2002.NET Framework 1.0 SQL Server 2000 with Northwind database Generating an Object for the DataSet Object for ADO.NET is a collection of dataset classes created in memory. To create a dataset object from Northwind database in SQL Server, using ADO.NET DataSet Designer.

1. In the Solution Explorer, right-click the project name, point to Add, and click Add New Item. 2. In the Categories area of the Add New Item dialog box, expand the folder and select Data. 3. In the Templates area, select Dataset. 4. Accept the default name Dataset1.xsd. This creates a new schema file that will be used to generate a strongly typed dataset. The schema file will be displayed in ADO.NET Dataset designer. 5. In the Solutions Explorer, click on Dataset1.xsd file, if now already the active view. 6. From the Server Explore, on the right connect to SQL Server and drill down to Northwind Database. 7. Highlight the Table Customers (or stored procedure if desired) and drag and drop it on the Interface of Dataset1.xsd. Dataset1.xsd should now be displayed in the Dataset tab as under

This creates a dataset object and contains only a description of the database based on the schema in Dataset1.xsd. It does not contain the actual data. Connecting Report to an ADO.NET Dataset Object From ADO.NET Dataset Object you can add tables to Crystal Report using Database Expert in Crystal Report Designer. To create a new report and connect it to Dataset object which contains description for Customers table in Northwind database 1. In the Visual Studio.NET Solution Explorer, right-click your project to display the shortcut menu. 2. Point to Add and click Add New Item. 3. In the Add New Item dialog box, select Crystal Report from the Templates area. Click Open.

4. Crystal Report Gallery will be displayed, as shown below

5. You can choose from any of the options provided in Crystal Report Gallery. But for the purpose of this walkthrough choose As a Blank Report and click OK.

6. On File menu, click Save to save the report. 7. Right click in the Report Designer, point to Database, and click Add/Remove Database. 8. You ll be presented with Database Expert wizard. 9. In the Database Expert wizard, expand the Project Data folder, expand the ADO.NET Datasets folder and select the dataset object as shown below

10. If you now drill down Database Fields node, in the Field Explorer, you can view Customers table and all its fields 11. Drag and drop the fields onto the report and format them as required. Pushing data into DataSet object and binding report to Windows Forms Viewer In order to display actual data in the report, you should fill the dataset object with the data before you bind the report to Windows Forms Viewer. You should do this in the corresponding source file for Windows Form. 1. Drag and drop CrystalReportViewer control on Form1 and set the DisplayGroupTree property to False, as shown below

2. Accept the default name as CrystalReportViewer1. 3. Open Form1 code editor and add the following code on Load event of Form1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim rpt As New CrystalReport1() 'The report you created. Dim myconnection As SqlConnection Dim MyCommand As New SqlCommand() Dim myda As New SqlDataAdapter() Dim myds As New Dataset1() 'The DataSet you created. Try & _ myconnection = New SqlConnection("Data Source=localhost;Integrated Security=SSPI;" "Initial Catalog=northwind;") MyCommand.Connection = myconnection MyCommand.CommandText = "SELECT * FROM Customers" MyCommand.CommandType = CommandType.Text myda.selectcommand = MyCommand myda.fill(myds, "Customers") rpt.setdatasource(myds) CrystalReportViewer1.ReportSource = rpt Catch Excep As Exception

MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub Troubleshooting Add reference to SqlClient namespace. Imports System.Data.SqlClient Check connection to your server. References http://msdn.microsoft.com/library/default.asp?url=/library/enus/crystlmn/html/crconincorporatingreportsintoapplications.asp