Crystal Report Designer Component



Similar documents
CHAPTER 6: SEARCHING AN ONLINE DATABASE

Crystal Reports for Visual Studio.NET

Using Crystal Reports with VFP

Introduction to Microsoft Access 2003

GOOGLE DOCS APPLICATION WORK WITH GOOGLE DOCUMENTS

Developing Own Crystal Reports

Aspect WordPress Theme

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

2. Unzip the file using a program that supports long filenames, such as WinZip. Do not use DOS.

Section 1: Ribbon Customization

TAMUS Terminal Server Setup BPP SQL/Alva

Google Sites: Creating, editing, and sharing a site

Sophos Reporting Interface Creating Reports using Crystal Reports 2008

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

Publishing KML Services Tutorial

Introduction to Word 2007

NDSU Technology Learning & Media Center. Introduction to Google Sites

Table of Contents. 1. Content Approval...1 EVALUATION COPY

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

Building and Using Web Services With JDeveloper 11g

for Sage 100 ERP Business Insights Overview Document

Microsoft Access 2010 Part 1: Introduction to Access

Appendix A How to create a data-sharing lab

Getting Started The Windows SharePoint Services Window

Crystal Reports Payroll Exercise

Editor Manual for SharePoint Version December 2005

1. Create SQL Database in Visual Studio

What is OneDrive for Business at University of Greenwich? Accessing OneDrive from Office 365

UOFL SHAREPOINT ADMINISTRATORS GUIDE

Salesforce Classic Guide for iphone

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

Step 1: How to Create Links / Hyperlinks

Crystal Reports Installation Guide

Previewing & Publishing

History Explorer. View and Export Logged Print Job Information WHITE PAPER

Use the ADO Control in your Visual Basic 6 projects

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

Umbraco Content Management System (CMS) User Guide

Form Management Admin Guide

Access 2010: The Navigation Pane

Subscribe to RSS in Outlook Find RSS Feeds. Exchange Outlook 2007 How To s / RSS Feeds 1of 7

Introduction to Microsoft Access XP

Creating Digital Signatures

Chapter 11 Managing Core Database Downloads

Microsoft Excel 2013: Macro to apply Custom Margins, Titles, Gridlines, Autofit Width & Add Macro to Quick Access Toolbar & How to Delete a Macro.

Information Exchange Network (IEN) System Operator Training Day 3

1. Click the Site Actions dropdown arrow and select Show Page Editing Toolbar. 2. Click Edit Page to begin changing the page layout

The Reporting Console

Tutorial JavaScript: Switching panels using a radio button

Knowledgebase Article

Attach receipt options:

REDUCING YOUR MICROSOFT OUTLOOK MAILBOX SIZE

Manual English KOI Desktop App 2.0.x

Handout: Word 2010 Tips and Shortcuts

Excel for Data Cleaning and Management

Internet Explorer 7 for Windows XP: Obtaining MIT Certificates

Google Sites. How to create a site using Google Sites

To Begin Customize Office

Automated Dispatch System Query Tool

Create a Google Site in DonsApp

TriCore Secure Web Gateway User Guide 1

Evaluator s Guide. PC-Duo Enterprise HelpDesk v5.0. Copyright 2006 Vector Networks Ltd and MetaQuest Software Inc. All rights reserved.

How To Create A Report In Excel

Getting started with 2c8 plugin for Microsoft Sharepoint Server 2010

About SharePoint Server 2007 My Sites

Dreamweaver Tutorials Creating a Web Contact Form

2. Building Cross-Tabs in Your Reports Create a Cross-Tab Create a Specified Group Order Filter Cross-Tab by Group Keep Groups Together

Microsoft PowerPoint 2008

KEYBOARD SHORTCUTS. Note: Keyboard shortcuts may be different for the same icon depending upon the SAP screen you are in.

ORACLE BUSINESS INTELLIGENCE WORKSHOP

Remote Viewer Recording Backup

BCSD WebMail Documentation

Generating Open For Business Reports with the BIRT RCP Designer

MICROSOFT ACCESS 2003 TUTORIAL

Adobe Reader Settings

InSite Prepress Portal

There are several ways you can reduce the size of your mailbox, they include:

Affiliation Security

SellerDeck 2013 Reviewer's Guide

PC Agent Quick Start. Open the Agent. Autonomy Connected Backup. Version 8.8. Revision 0

Table of Contents. Welcome Login Password Assistance Self Registration Secure Mail Compose Drafts...

EMC Smarts Network Configuration Manager

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

Google Docs A Tutorial

Contents Release Notes System Requirements Using Jive for Office

TaskCentre v4.5 Run Crystal Report Tool White Paper

Novell ZENworks Asset Management 7.5

How-To Guide. Crystal Report Demo. Copyright Topaz Systems Inc. All rights reserved.

UF Health SharePoint 2010 Document Libraries

FRONTPAGE FORMS

Quick Start Guide. Installation and Setup

NetCDF Tutorial. Copyright Esri All rights reserved.

Using the SAS Enterprise Guide (Version 4.2)

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

IBM BPM V8.5 Standard Consistent Document Managment

Transcription:

Crystal Report Designer Component Overview Contents is created using the Report Source Router a class found in the CRVIEWERLib automation server. The AddReport method of the ReportSourceRouter object is used to add reports to the report collection. supports Seagate Info reports, Web reports, Seagate Crystal Reports and Crystal ActiveX reports. Report Collections can be created from any type of report source object. In order for Seagate Info and Web reports to be displayed in the Viewer, other components are required to be installed. For Seagate Crystal Reports version 7, all report types, except for Seagate Info reports, are supported since the Web component is installed on the machine by Seagate Crystal Reports. WHAT IS THE REPORTSOURCEROUTER...2 HOW TO DECLARE THE REPORTSOURCEROUTER...3 Early Binding... 3 Late Binding... 3 HOW TO CREATE REPORT COLLECTION PACKAGE USING THE DIFFERENT REPORT SOURCES...4 Using ActiveX Designer Reports... 4 Using Crystal Reports (.rpt)... 5 Using Web Reports... 5 KNOWN ISSUES WITH THE REPORT COLLECTION...7 How is the Report name determined for each report in the collection...7 Last report in the Collection is hidden...7 Errors in reports when previewing...7 TUTORIAL...7 CONTACTING CRYSTAL DECISIONS FOR TECHNICAL SUPPORT...9 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 1

What is the ReportSourceRouter The Web release Viewer control (version 1 that is included in the Report Designer Component) was able to view one report at a time. Users wishing to view another report could either view the other report in another view window or overwrite the existing view with the next report. [Figure A] below shows the viewer control which is displaying a single report. Notice that the group tree view in the left margin provides the ability for the user to drilldown on the report which brings up a subview in a separate tab window. Figure A is a method of adding reports to one single view. This means that users no longer need to open up additional views in order to preview reports, instead they can view all of the reports in one single view window. The group tree view on the left margin displays report icons representing the reports in the view control. You can use the group tree view to navigate the individual reports in the viewer control. Figure B below shows what the Smart Viewer control would look like with multiple reports. This Smart Viewer control in this example contains three reports. Notice the report icons in the group tree view which can expand or collapse for drillable areas on the report. Figure B Unlike a single report which uses page on demand technology when previewed, multiple reports require the whole report to be generated before being viewed. Because reports need to be generated in there entirety before being previewed the veiwer can become very resource intensive, especially for large reports. It is suggested that developers take this into consideration when determining which reports to add to the collection object. How to declare the ReportSourceRouter Early Binding The ReportSourceRouter is a hidden object in the CRVIEWERLib automation server. Checking the option "Show Hidden Members" in the Visual Basic Object browser will have this object appear in the Object browser and intellisense. Dim Rptpk As ReportSourceRouter Set Rptpk = New ReportSourceRouter Late Binding Declare the variable as a object and using the Visual Basic CreateObject function to return a class reference to the ReportSourceRouter class. Dim Rptpk As object Set Rptpk = CreateObject("ReportSourceRouter.ReportSourceRouter") 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 2

How to create report collection package using the different report sources The ReportSourceRouter class, which is part of the CRVIEWERLib library, is the Report Collection object. This class contains one member, the AddReport method, which adds reports to the collection. Once all the reports have been added to the collection, set the Smart Viewer control's ReportSource property to the Report Collection object. The Report collections can be created from any type of report source objects. The following examples show you how to create reports from an ActiveX Designer report source, a Crystal Report source opened directly from the object model and a web report. Though the samples are specific for each type of report source, the report collection can be a mixture of these different report sources. Using ActiveX Designer Reports The following example shows how to create a report collection package using 3 Crystal Report Designers and then assigns the package to the Viewers ReportSource property. Dim Report1 As CrystalReport1 Dim Report2 As CrystalReport2 Dim Report3 As CrystalReport3 Private Sub Form_Load() Dim Rptpk As ReportSourceRouter 'Report Collection object Set Rptpk = New ReportSourceRouter 'Instantiate the object 'ActiveX Designer reports are instantiated Set Report1 = New CrystalReport1 Set Report2 = New CrystalReport2 Set Report3 = New CrystalReport3 'ActiveX Designer reports are added to the collection Rptpk.AddReport Report1 Rptpk.AddReport Report2 Rptpk.AddReport Report3 'Set the Viewer to the Report Collection and view the report CRViewer1.ReportSource = Rptpk CRViewer1.ViewReport 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 3

Set Rptpk = Nothing Using Crystal Reports (.rpt) The following example shows how to create a report collection package using 3 Crystal Reports, which are accessed directly through the Object Model and then assign the package to the Viewers ReportSource property. Dim Application As CRAXDRT.application Dim Report As CRAXDRT.Report Private Sub Form_Load() Dim Rptpk As ReportSourceRouter 'Report Collection object Set Rptpk = New ReportSourceRouter 'Instantiate the object Set Application = New CRAXDRT.application 'ActiveX Designer reports are instantiated and 'added to the collection Set Report = application.openreport("c:\report1.rpt") Rptpk.AddReport Report Set Report = application.openreport("c:\report2.rpt") Rptpk.AddReport Report Set Report = application.openreport("c:\report3.rpt") Rptpk.AddReport Report 'Set the Viewer to the Report Collection and view the report CRViewer1.ReportSource = Rptpk CRViewer1.ViewReport Set Rptpk = Nothing Using Web Reports The following example shows how to create a report collection package using 2 web reports and then assign the package to the Viewers ReportSource property. The Web report broker takes care of communicating with the Web Server. When the Web report source components are created, the Web report broker is assigned to them. Once the report broker has been assigned, the URL is then 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 4

specified for the report source. Whenever a Web report source needs to retrieve report information, the URL is given to the Web report broker and the report request is made. This example uses early binding. To early bind the objects, in your project, a reference will need to be made to the Seagate Crystal Reports Web Report Broker (SWEBRS.DLL automation server). To use late binding for the webbroker reference "WebReportBroker.WebReportBroker" and for the websource reference "WebReportSource.WebReportSource". Note the use in the following code of the Title property on the Web report source components. Report collection packages are displayed in the Viewer accordingly with a report title. In the Web case, a title is assigned to the Web report component since it doesn't otherwise have access to any report title information. Dim webbroker As WebReportBroker Dim websource1 As WebReportSource Dim websource2 As WebReportSource Private Sub Form_Load() Dim Rptpk As ReportSourceRouter 'create broker for report sources Set webbroker = New WebReportBroker 'create a report source per report Set websource1 = New WebReportSource Set websource2 = New WebReportSource 'hook report broker to report sources websource1.reportsource = webbroker websource2.reportsource = webbroker websource1.url = "http://chow/crweb/craze/hr.rpt" websource2.url = "http://chow/crweb/craze/wwsales.rpt" 'Set report source titles websource1.title = "Employee Profiles" websource2.title = "World Wide Sales" Rptpk.AddReport websource1 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 5

Rptpk.AddReport websource2 CRViewer1.ReportSource = Rptpk CRViewer1.ViewReport Set Rptpk = Nothing Known issues with the Report Collection Tutorial How is the Report name determined for each report in the collection The report's Summary title is used for the report name. If the report does not have a report title specified then a report icon appears in the grouptree view but there is no title to identify the report. A report's title can be specified at runtime using the Report.ReportTitle property. Last report in the Collection is hidden. In the current release version of the Report Collection object, the last report added to the collection does not appear in the group tree view of the viewer in the initial preview. Though the report does not appear in the list it still can be navigated to using the page navigation buttons from the Smart Viewer toolbar. Eventually the last report icon does appear. This behavior does not occur on all machines and the issue is currently being tracked. Errors in reports when previewing If a report in the collection errors on preview the user is notified of the error by a message box. The report with the error is not loaded and a Report icon, with no title, is put in its place. All remaining reports are loaded into the viewer. 1. Open the Visual Basic 5.0 or 6.0 application, if it is not already running. 2. Create a new Standard EXE project by either selecting one from the Visual Basic start up dialog or navigating to New Project under the File menu. 3. Add the Report Designer by navigating to the Projects menu, selecting Add ActiveX Designer and Crystal Report 6.0 or 7.0. The Report Gallery window will appear. 4. To select a generic report format, click on the Standard button. The Create Report Expert window will appear with a series of tabs. This window allows you to select from either Project or Custom data sources. Typically, you would use a project based data source 5. You will be connecting to an existing Access ODBC data source so click on the Project button. The Select Data Source window will appear with ODBC 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 6

radio button on by default. Select "Xtreme sample data" from the list of data sources. 6. For this example, you'll connect to the ODBC data source using ADO. To see which options are available, in the Select Data Source window, click Advanced. The Advanced Options dialog will appear. Click OK to accept the default of connecting using ADO. 7. Now that you've specified the data source and connection method, you'll need to specify the tables to use. Click Next > on the Select Data Source window, the Select Recordset window will appear. You'll be selecting a database table object of customer sales information from the available list of database objects. Select the "Customer" object from the object pull down list and click on the Finish button. You'll return to the Create Report Expert window. Now that you've selected the database and the table for your report, you'll need to specify the fields you want to include in the report. 8. Click on the Fields tab and select the "Customer Name" database field in the Database Fields text box. Click and drag the field into the Report Fields text box. Do the same for the "Last Year's Sales", "City" and "Region" fields. 9. Click on the Sort tab and drag the "Region" and "City" fields into the Sort Fields text box. Select in ascending order if not already visible in the Order drop-down box. 10. Click on the Total tab. Because The "Last Years Sales" field is the only numeric field in the report, the expert automatically selected it for totaling 11. Click on the TopN tab. The Expert automatically selects sum of "Last Year's Sales" and Top 5. In the where N is : text box, change the "5" to a "10". 12. Click on the Graph tab and click on the Pie button in the Graph Gallery. Click on the Data tab. The Report Expert automatically creates a graph based on the sum of "Last Year's Sales". 13. Click on the Style tab and make the report a little prettier by selecting the Executive, Trailing Break style. Click Finish. The Report Expert will then present you with the option of adding a form with the Crystal Report Viewer control and setting this as the startup object. Click OK to accept the defaults. The Expert will finish formatting the report which will be displayed in the design window. 14. From the Visual Basic toolbar select Project References and check the Crystal Report Smart Viewer reference. This reference will allow us to early bind the ReportSourceRouter object. 15. From the Project Explorer window select Form2 and click the Code View icon. 16. Remove all existing code in the code view window and add the following: 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 7

Dim ActiveX_Report As New CrystalReport1 Dim External_Report As CRAXDRT.Report Dim Appl As New CRAXDRT.Application Dim Rptpk As New CRVIEWERLibctl.ReportSourceRouter Private Sub Form_Load() 'Adds a title to the report ActiveX_Report.ReportTitle = "ActiveX Report" 'reference and external rpt through object model Set External_Report = Appl.OpenReport("c:\program files\" + _ "seagate crystal reports\rt01.rpt") 'adds reports to the collection Rptpk.AddReport ActiveX_Report Rptpk.AddReport External_Report 'set the collection to the viewer CRViewer1.ReportSource = Rptpk CRViewer1.ViewReport Private Sub Form_Resize() CRViewer1.Top = 0 CRViewer1.Left = 0 CRViewer1.Height = ScaleHeight CRViewer1.Width = ScaleWidth Click on the Start button on the Visual Basic toolbar or press F5 to run your project. After a few seconds, you will see a form displaying the finished report in the Crystal Report Viewer. The report should look similar to the one shown below. Contacting Crystal Decisions for Technical Support We recommend that you refer to the product documentation and that you visit our Technical Support web site for more resources. 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 8

Self-serve Support: http://support.crystaldecisions.com/ Email Support: http://support.crystaldecisions.com/support/answers.asp Telephone Support: http://www.crystaldecisions.com/contact/support.asp 6/24/2002 3:37 PM Copyright 2001 Crystal Decisions, Inc. All Rights Reserved. Page 9