Exporting Your Report to Different Formats

book list add book to my bookshelf create a bookmark purchase this book online

mastering crystal reports 9
Chapter 16 - Deploying Your Report
Mastering Crystal Reports 9
by Cate McCoy and Gord Maric
Sybex 2003

Pros

Cons

Crystal Reports is not required for end user.

User cannot refresh report data.

End user can use office tools such as Excel, Word, or generic applications to view reports. Refer to export list below.

User can change exported data.

Original report can’t be modified.

Original report can’t be modified.

Report can be exported to HTML and viewed through a web browser.

 

To export a report, select File > Export (see Figure 16.8). Crystal supports all the export formats in the following list and the destinations shown in Table 16.2:


Figure 16.8. Export options

Table 16.2: Export Formats

Export Format

Comments

Acrobat PDF

Very accurate rendition of the original report. User will require Adobe Acrobat Reader to view reports. You can download the reader at www.adobe.com.

Crystal Report

Exports the report in version 9 format, but does not save it in a previous version. This is the same as saving the report.

HTML 3.2

Some formatting is lost; this HTML format is compatible with most browsers.

HTML 4.0

Retains more report formatting but will not support all browsers. User will require at minimum a version 4 compatible browser to view report.

MS Excel 97–2000

Graphics and report data are exported; the Excel file will closely resemble your report.

MS Excel 97–2000 Data Only

Exports data only. This format is good if you want to do further Excel calculations on the data.

MS Word

Exports report data and graphics. The Word document will closely resemble the report.

ODBC

Enters the data of your report to a specified table in an ODBC data source. The tables must be configured so column names and field names in the report match.

Record Style (Columns, no Spaces)

Your report data is export-to-text format, with no spaces between fields.

Record Style (Columns with Spaces)

Same as Record Style (Columns, no Spaces), except a single space is included between fields.

Report Definition

Creates a report of the formulas, formatting, and settings of a Crystal Report. The exported text file is intended to be read by the developer of the report for an overview of the report setup. This is similar to a source code listing of a computer program.

Rich Text Format (RTF)

Saves data and graphics of a Report. Similar to Word, except other word processors can read an RTF file.

Separated Values (CSV)

Similar to Record Style, except fields are separated by commas.

Tab-Separated Text

Similar to Separated values (CSV), except values are separated by tabs.

Text

Converted to straight text with no formatting.

XML

Converted to an XML file structure.

Some of the export formats, such as PDF, Word, or Excel, will be very close to the Crystal Report formatting. Other export formats will lose some formatting. Limitations you may encounter include the following:

  • Graphics may not export.

  • The group tree may not export.

  • Sub-reports may not export as expected.

  • Hyperlinks in the report many not work.

Make sure you verify your exported report. If you plan to deploy your report by exporting it, it is a good idea to know the limitations of the export format and design your report with those limitations in mind. Table 16.3 shows the format and the export destination.

Table 16.3: Supported Destinations

Format

Export Destination

Application

Crystal will open the application and the application will contain the exported report in the application’s native data format. For example, if you choose MS Word, the report will be exported to Word format and Word will open automatically.

Disk File

File on the hard drive.

Exchange Folder

Microsoft Exchange folder.

Lotus Domino

Notes Database.

Lotus Domino Mail

Notes Mail.

MAPI (Messaging Application Program Interface)

Exports the report to a mail message as an attachment. Your e-mail program will open and a message will contain the attached exported file.

Some of the reporting export formats are not meant for human consumption, such as ODBC, Tab Separated, XML, and Record Style and Separated Values. These formats are designed so another computer program can read your Crystal Report as input for its data processing. In this case, you are using Crystal Report as data-conversion utility.

Exporting to HTML

Exporting the report to HTML format provides a very simple way to deploy the report to your end users. All the end users require is a web browser, such as Internet Explorer or Netscape Navigator, installed on their computer. It also provides an easy way to publish your reports to the Internet or an intranet.

Crystal Reports supports two HTML formats, HTML 3.2 and HTML 4. HTML 3.2 is best used when your users have older browsers, such as Netscape 3 or Internet Explorer 3, installed. It is also advantageous when you have a large user community and you are not sure which version of the browser they have. Using HTML version 3.2 guarantees that your report will be viewable with most browsers. The downside to using version HTML 3.2 is that some report formatting is lost in the export. HTML version 4.0 does a better job of maintaining the original report format, but older browsers do not recognize HTML 4. See Figure 16.9 and Figure 16.10, which compare the same report exported to HTML 3.2 and HTML 4.

click to expand
Figure 16.9. Export HTML version 3.2

click to expand
Figure 16.10. Export HTML version 4

Tip 

Most computers now have version 5 or 6 of Netscape or Internet Explorer installed. We tend to think that in most cases you should be fine with HTML 4.

Choose HTML 4 or HTML 3.2 in the Export dialog, shown previously in Figure 16.8, and click OK. The Select Export File dialog is displayed (see Figure 16.11). In this dialog, you can configure the HTML export files as described below.

click to expand
Figure 16.11. Export HTML Version 4

Directory Name The export converts your report to multiple HTML files. Choose a name for the directory, and select the drive and directory where you want this directory to be created.

Base File Name Select the name of the HTML file to export to. If you check the Separate HTML Pages option, Crystal will append a page number to the end of each filename, such as Resorts1.html, Resorts2.html, etc.

Page Navigator This option creates a link at the bottom of each report page so users can navigate forward and backward through the pages. This option is applicable only if you choose Separate HTML Pages.

Separate HTML Pages If this option is selected, Crystal will create a separate HTML file for each report page. If the report is small, one HTML file is fine; otherwise, choose separate pages. If the report is large and you choose one HTML file, then the browser must download the entire report.

Page Range Your choice determines whether to export the whole report or just a page range.

Viewing the Report from a Networked Drive

To view your HTML report, start your web browser, either Internet Explorer or Netscape Navigator, and in the Address line type the path and report name selected in the Select Export File dialog box. Note that if you choose to separate HTML pages, you must add “1” to the report name. Your report will be displayed in the browser window (see the address bar in Figure 16.10, shown previously).

Using this technique you can copy the HTML files to a shared network drive to easily deploy your report. Instead of entering the C: drive on the Address line, you would replace it with the drive letter assigned to your shared network drive, such as P:.

Publishing to a Web Server

A web server is a file server that publishes HTML files. You can think of a web server as a globally accessible shared networked drive.

Note 

A web server can do more than publish web pages. However, its basic functionality is to serve up HTML files.

A web server consists of two directory types:

Virtual Directory A virtual directory is a directory that is accessible by users through a web browser. To access this directory, users type a web address such as HTTP://ServerName/Directory/ HTMLFileName.html. The web address is broken down as follows:

  • HTTP:// is the protocol used to communicate to the web server. HTTP is a standard protocol to request web pages.

  • ServerName is the name of the web server. On the Internet this usually starts with www. It can also be a private web server in your company; then it is called an intranet web server.

  • Directory is the name of the directory that contains the file you are requesting.

  • HTMLFileName.html is the name of the report (HTML file) you are requesting.

    Physical Directory The physical directory is the actual directory on the computer where the web server is running, where the web server can find the requested HTML file. When a request is made to a web server, such as HTTP://ServerName/Directory/HTMLFileName.html, the web server translates this directory to a physical directory.

    In the case of Internet Information Server (IIS), Microsoft’s web server, the default physical directory is C:\inetpub\wwwroot. Any directories or files off C:\inetpub\wwwroot would be accessible by a web browser.

    In our example, the requested file HTTP://ServerName/Directory/HTMLFileName.html would be located at C:\inetpub\wwwroot\Directory\HtmlFileName.HTML.

    To publish our report to Microsoft’s IIS web server, we created a directory named VistaReports off the web server’s main directory, C:\inetpub\wwwroot\VistaReports. Then we copied all the exported files to the new directory. You can now access the report via a web server, as shown in Figure 16.12. Notice the address line in the browser.

click to expand
Figure 16.12. Accessing a report on a web server

Note 

We covered one way to publish your report to a web server, using Microsoft’s IIS. However, HTML files can be published to various web servers. Each web server is slightly different, but the principles discussed here are the same. See your network or web administrator to learn which web server your company is using and what procedure to use to publish the reports (HTML files).

You might be wondering when you would publish a report using the hard drive technique versus using the web server. Use the hard drive if all your users are internal to your company and all of them have access to the same

shared network drive. If they cannot access the same network drive, then you will need to publish to a web server. Publishing your report to a shared hard drive also removes you from the complexity of web servers.

Use of content on this site is expressly subject to the restrictions set forth in the Membership Agreement
 
Conello © 2000-2003     Feedback


Mastering Crystal Reports 9
Mastering Crystal Reports 9
ISBN: 0782141730
EAN: 2147483647
Year: 2005
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net