Creating Hyperlinks

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

mastering crystal reports 9
Chapter 3 - Formatting Fields and Objects
Mastering Crystal Reports 9
by Cate McCoy and Gord Maric
Sybex 2003

Hyperlink is one of those words that conjures up images of space travel and fancy transport mechanisms…a cool word indeed. In Crystal, hyperlinks move you quickly from one place in your report to an alternate destination. A hyperlink is attached to a Crystal object, so when a user views a report and clicks the object, the user travels to the destination associated with the hyperlink. Hyperlinks in Crystal are often connected to picture objects or text objects, but they can be attached to any Crystal object. To add a hyperlink to an object, select the object, and then choose Format > Hyperlink to display the dialog shown in Figure 3.21. The Hyperlink tab of the Format Editor is where you create and maintain hyperlinks.

click to expand
Figure 3.21. Hyperlink options

There are several types of destinations that you can jump to using a hyperlink, and the idea behind each of them is to allow the report to integrate other types of information so that Crystal is used as a launch point for gathering or reacting to information relevant to the report. The types of hyperlink destinations are described here:

A Website On The Internet Any valid Uniform Resource Locator (URL) can be used as a destination. Crystal supplies the http:// component of the web address, and you type the rest. Although the radio button mentions the Internet specifically, any valid URL will work whether it is on the company’s intranet, an extranet, or the public Internet. The rule of thumb is that if you can get to the destination with a web browser, you can use it as a Crystal hyperlink destination.

Current Website Field Value Database tables that store information about companies, for instance phone numbers and street addresses, often include a field for the company’s website. If you add this field to a report, its value will appear as an active link when the appropriate hyperlink options are enabled. To use this feature, be sure to select the field containing the web address before choosing Format > Hyperlink; otherwise, the radio button option itself is unavailable and cannot be selected.

An E-mail Address Choosing the radio button for an e-mail address lets you type in any e-mail address. No validity checking is done on what you enter, so be sure to type carefully. When the user clicks this type of link in a report, a mail client (such as Outlook Express) opens and a traditional e-mail composition window is displayed, where you can enter text in the Subject line, type the text of your message, and click the Send button.

A File Any file can be a link destination. You can use the Browse button to find it on your hard drive or a network drive. The only caveat in using this option is that the person viewing the report must also have appropriate access to the file for the link to work. Things that might prevent this access are security or the location of the file.

Current E-mail Field Value If the database you’re working with for a report contains an e-mail field, you can place the field in your report and then use its value as a link. This will be useful if the report you’re building will be web-deployed and needs to show an e-mail address for each record in the Details section. In our business scenario, this might be to the e-mail address for the sales staff at each of the member resorts.

Report Part Drilldown A new feature in Crystal Reports 9 is the Report Part Viewer, which is used to display detail data associated with summarized parts of a report. Compared to a traditional report drilldown, which jumps to a page within a report, the part drilldown identifies and displays only a specific object within a report. Using the Hyperlink tab in the Format Editor, you define a report part, which prepares it for use in report part navigation. Basically, you define the destination with a hyperlink and then use the Report Part viewer to navigate between reports and report parts. Report part drilldown is available for only the following summary object types:

  • Group charts

  • Group footer fields

  • Group header fields

  • Group maps

  • Summary fields

To define a report part, select the summary object type and then choose Format > Hyperlink to display the dialog shown in Figure 3.22. The report part is automatically given an object name that represents what the summary operation was in the report; in this case, CountofCountry1 is a grouping established in our CH02.RPT in Group Header #2.

click to expand
Figure 3.22. Defining a report part

Dynamic Hypertext Markup Language (DHTML) is a version of HTML that is installed as part of your web browser. It is not a part of older web browsers such as Internet Explorer 3.0 and Netscape 3.0. If you have a more recent web browser installed on your machine, it likely supports DHTML and the Crystal Report Part Viewer will work correctly.

Warning 

If your browser does not support DHTML, hyperlinks using Report Part Drilldown and Another Report Object will not work.

Another Report Object You can link from one Crystal Report to a specific part of another Crystal Report using the Report Part Viewer by selecting the Another Report Object radio button, as shown in Figure 3.23. To do this, first open the destination report and select the specific object to which you want to jump. Copy the location to the Windows clipboard using Ctrl+C (or any of the other Microsoft paste methods you know). Then return to the report in which you want to create the hyperlink starting point, and with Another Report Object selected, position the mouse in the Select From area and paste the destination location into the dialog (Ctrl+V is the keyboard combination to do this). The Data Context area tells you which field value will be the first one viewed and jumped to in the report part.

click to expand
Figure 3.23. Linking to another report object

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