Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
2.11 Mб

4Finally, examine the code for the Resize event of the form:

CRViewer1.Top = 0 CRViewer1.Left = 0 CRViewer1.Height = ScaleHeight CRViewer1.Width = ScaleWidth

These four lines make sure that the Smart Viewer takes up the entire area of the Form, and that the Smart Viewer is resized whenever the Form is resized, so it continues to fill the entire form. Note that this code is optional, but such techniques are often good practice to provide a complete user interface.

Report Packages

A report package is a convenient way to group reports from different sources for viewing or printing. Relevant information can be combined in one place, rather than having to output separate reports.

Report packages can be created at design-time in Visual Basic. The package can contain reports created by the RDC, for example, CrystalReport1, and reports created outside the application using the designer in Seagate Crystal Reports or Seagate Info with an .rpt extension. The latter method uses CRAXDRT: Crystal Reports ActiveX Designer Run Time Library. The following code demonstrates how to create a report package at design time in VB:

'report created with RDC

Dim Report As New CrystalReport1

'report created outside the VB application Dim MyApp As New CRAXDRT.Application

'Object to hold reports in a package for CRViewer Dim RptPk As New ReportSourceRouter

'Add reports to the package RptPk.AddReport Report

RptPk.AddReport MyApp.OpenReport("MyDrive:\MyFolder\MyReport.rpt")

'View reports in the package CRViewer1.ReportSource = RptPk CRViewer1.ViewReport

Working with data

The Seagate Crystal Report Designer Component supports a wide range of data sources. As a standalone ActiveX designer for Visual Basic and Visual InterDev, it easily connects to any DAO, RDO, or ADO Recordset or Resultset. If you are working with Visual Basic 6.0, you can connect to a VB Data Environment. Additionally, through the use of Data Definition Files, you can build a report without having to declare the

The Report Designer Component


Соседние файлы в папке crystal