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

Report Distribution Considerations

When you create reports in the Report Designer Component, your application retains the report inside the executable file. However, you can, if needed, save reports as external RPT files.

The following topics are discussed in this section:

Distributing reports as part of the application, Page 190

Saving reports as external files, Page 190

Saving data with reports, Page 191

Distributing reports as part of the application

When you create a report using the Report Designer Component in Visual Basic, it is bound inside the final executable application. When you distribute the application, you do not need to worry about distributing separate report files. Your end users, however, will not be able to modify the reports from within standalone versions of Seagate Crystal Reports.

During development, Report Designer reports are saved in .DSR files. These are standard ActiveX designer files that are added to your project whenever you add an ActiveX designer. For example, the default report created by the Create Report Expert is CrystalReport1.dsr. This file contains both the Report Designer Component and the report you design. It is part of your Visual Basic project and appears in the Project window under the Designers folder.

Saving reports as external files

You can also save reports as external Crystal Reports files (.RPT). Your Visual Basic application still uses the report bound inside of the .DSR file, but the report becomes available for edits if you have a standalone version of Seagate Crystal Reports 6.0 or later. Additionally, you may choose to use the OpenReport method of the Application object to create a new Report object at runtime using the external report file. For information on using this method, see the section on using the Application object.

To save a Report Designer Component report as an external file:

1Create your report using the standard tools and features of the Report Designer Component. See the tutorial Using the Seagate Crystal Report Designer Component Index for complete instructions on creating a report.

2With the Report Designer window active inside Visual Basic, click the Save to Crystal Reports File button in the Report Designer’s toolbar. This button appears to the far right of the toolbar, and you may need to expand the Report Designer window before you see it. When you click this button, a Save As dialog box appears.

3Use the dialog box to select a location and file name for the report.

4Click Save, and return to your Visual Basic project.

The Report Designer Component

190

NOTE: If you create a report in the Report Designer Component and use Visual Basic code to create calculated fields and conditional formatting, you will lose that code (and thus the calculations and formatting) when you store the reports as an external file. The .RPT file format does not inherently support Visual Basic code. If you must retain calculated fields and conditional formatting, use only the Seagate Crystal Reports formula language to create your report formulas or do not save the report external to your application.

Saving data with reports

When working with the Report Designer Component, keep in mind that data is not stored with the report. The report maintains a connection to the data through the ActiveX data source connection used (e.g DAO or ADO). When the application is distributed, you must make sure that your users will still be able to access the data. If this is not possible, you may want to consider using external report files.

External report files created and/or edited in a standalone version of Seagate Crystal Reports can have data stored with the report file. This increases the size of the report file, but eliminates a dependency on a connection to the original data source.

By using the Report Designer Component as an automation server, and obtaining a Report object through the Application object’s OpenReport method, you can provide reports to your users without providing a data connection at runtime. Remember, though, you will have to distribute the report files with your application.

The Report Designer Component

191

Volume 1

7

Seagate Crystal Visual

 

Component Library

What you will find in this chapter...

VCL Component Overview, Page 194

Installation, Page 194

Programming Overview, Page 199

Programming Tips, Page 209

TCrpeString, Page 212

Using Variables with Formulas, Page 215

About Section Names, Page 221

C++ Builder 3, Page 224

Known Problems, Page 226

Technical Support, Page 227

Seagate Crystal Visual Component Library

193

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