# Using Crystal Reports for BEA WebLogic Workshop

This section shows you how to add report viewing functionality to your BEA WebLogic Workshop projects. It shows you how to add new or existing reports to your projects. In addition, it shows you how to edit reports using the Crystal Reports for BEA WebLogic Workshop Designer. A migration section is included for reports created with Crystal Reports version 8.5 or earlier.

Click the appropriate link to jump to that section:

- Adding a report to your project
- Adding a viewer to your project
- Editing reports
- Migrating reports

## Adding a report to your project

Crystal Reports for BEA WebLogic Workshop allows you to add report files to your web projects. Adding report files to your BEA WebLogic Workshop project enables them to be managed as part of your project, and deployed with your web applications. Both existing reports and new reports can be added.

Click the appropriate link to jump to that section:

- Adding a new report
- Adding an existing report

### Adding a new report

BEA WebLogic Workshop integrates the process of creating a new report in your web projects. If you are working on a Windows-based system, you can launch the Crystal Reports for BEA WebLogic Workshop Designer so you can begin editing your report immediately.

###### To add a new report

1. Ensure that a web project is open.
2. On the File menu, select New > Crystal report.

   The New File dialog box is displayed.

3. In the left pane of the New File dialog box, select Web User Interface.
4. In the right pane, select Crystal report.
5. Specify the name and location of the new report in the File name field.

   Note: By default, the report is created in your BEA WebLogic Workshop project's root directory. Use the Browse button to designate another location.

6. Click Create.

   The designer is now launched. While the designer is running, a message in the main window informs you that the report is being edited.

### Adding an existing report

You can add your existing reports to your BEA WebLogic Workshop projects and use them without further modification.

If your report was created with Crystal Reports version 8.5 or earlier, it must be updated using the report migration tool. The report migration tool updates the report format to ensure it is compatible with the additional features provided in Crystal Reports 9 and above. Use the report migration tool to ensure that your existing reports display correctly. For more information about updating existing reports, see Migrating reports.

###### To add an existing report

1. On the File menu, select Import Files.
2. Browse for the .rpt file you want to add.
3. Click Import.

   The report is added to your project.

## Adding a viewer to your project

The Java viewer allows reports to be displayed in a standard web browser. The Crystal Reports Viewer Wizard is the most efficient way to add a report viewer to your JSP page. The wizard uses the Viewer Tag Library to automatically insert and set all necessary tags. It also ensures that all dependencies are added correctly.

While you can use the wizard to simplify the process, you can also insert and set viewer tags manually.

Note that the tags encapsulate commonly used functions of the Viewer Java SDK. Using the Viewer Java SDK allows you to access the actual classes and methods that drive the report viewing process, giving you the greatest amount of flexibility and configurability.

Click the appropriate link to jump to that section:

- Installing the Viewer for Your Web Project
- Viewer Tag Library
- Crystal Reports Viewer Wizard
- Viewer Java SDK

### Installing the Viewer for Your Web Project

The viewer is not installed by default for each web project. To use the Crystal Reports Viewer Wizard or Viewer Tag Library, you must first install the viewer for your particular project.

###### To install the viewer

- On the Application tab, right-click the web project folder and select Install > Crystal Reports.

### Viewer Tag Library

The Viewer Tag Library allows you to access the report viewer through modular and reusable tags. Using tags allows you to reduce the amount of embedded Java code in a JSP page by moving the functional implementation into the tag and its implementing class. Doing so effectively abstracts the details of the code from the presentation of the actual page, allowing web page authors to concentrate on developing JSP pages. Using the Viewer Tag Library allows you to access the functionality of the Crystal report viewers without writing Java code. For more information on how to use the Viewer Tag Library, consult the Crystal Reports for BEA WebLogic Workshop Developer's Guide.

### Crystal Reports Viewer Wizard

The Crystal Reports Viewer Wizard allows you to add a viewer to your JSP page. The wizard guides you through adding report functionality, and automatically inserts the viewer tag code.

Tag properties and values displayed in the wizard are the default values; if you do not explicitly set a value, the attribute is not set in the inserted code.

###### To insert a viewer using the wizard

1. Open the JSP page where you want to add the viewer.
2. On the Palette tab, drag the Viewer tag into the page where you want your report to be displayed.

   This starts the Crystal Reports Viewer Wizard.

3. Click the Browse (...) button next to the Existing Report field.
4. Browse for the .rpt file you want to display.
5. Click Open.
6. Type a name into the Viewer Name field.

   The name uniquely identifies this particular instance of the viewer. If you have multiple viewers on the same page, ensure that their names are unique.

7. Click Next.

   You can customize the appearance and behavior of the viewer. Use the tabs to navigate between categories, and set values.

8. When you are finished customizing the viewer, click Finish.

   The viewer code required to display the report you specified is inserted.

### Viewer Java SDK

The Viewer Tag Library only encapsulates commonly used functions of the Viewer Java SDK. The Crystal Reports functionality provided by Crystal Reports for BEA WebLogic Workshop can also be accessed directly through the Viewer Java SDK. The SDK provides access to classes and methods that customize the report viewing functionality provided by the viewer. These classes and methods allow you to enable and disable viewer functionality, set default parameter values, specify database logons, and configure a wide range of different report viewing options. For more information on how to use the Viewer Java SDK, consult the Crystal Reports for BEA WebLogic Workshop Developer's Guide.

## Editing reports

Crystal Reports for BEA WebLogic Workshop also allows you to edit reports you have added to your projects. Although report editing cannot be done directly in the BEA WebLogic Workshop environment, on Windows systems the reports can be edited through the Crystal Reports for BEA WebLogic Workshop Designer.

###### To edit a report

- Double-click the report file.

The Crystal Reports for BEA WebLogic Workshop Designer launches. While the designer is running, a message in the main window informs you that the report is being edited.

## Migrating reports

Reports created in Crystal Reports version 8.5 or earlier require the report migration tool. The migration tool converts the reports to a format that is compatible with all versions of Crystal Reports 9 and above. You can convert the report to either version 9 or 10. Make sure to convert all pre-9 reports before deploying them with your web applications to ensure that they will be displayed correctly.

You can download Crystal Reports for BEA WebLogic Workshop Designer and sample reports when you register your copy of Crystal Reports for BEA WebLogic Workshop. For more information on registering your product, see Product registration.

###### To convert your reports

1. Run the Report Converter Wizard.
2. Select whether to convert a single report or multiple reports, then click Next.

   You are then prompted to specify the location of the reports you wish to convert.

3. Select the report(s) you wish to convert. Click Next.

   If you chose to convert multiple reports, you can add multiple directories containing reports that you wish to convert. Selecting Include Subdirectories before clicking Add Directory causes the Report Converter Wizard to recursively search through subdirectories for reports.

4. Specify the output location for the converted report(s). Click Next to begin the conversion process.

   You can choose to overwrite the existing reports or output the converted reports to a new location.

   For multiple reports, prefixing or suffixing the report names with v9 allows them to be written to the same directory without overwriting the old reports.

5. Click Finish to close the Report Converter Wizard.

   If there were any errors during the conversion process, click View Log to see them.

Crystal Decisions http://www.crystaldecisions.com/ Support services http://support.crystaldecisions.com/