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

Crystal Smart Viewer for Java

The Crystal Smart Viewer for Java is a standard Java applet that can be placed inside an HTML page and viewed through any browser that supports Java. Netscape Navigator (version 2.0 and later) will display reports using the Crystal Smart Viewer for Java by default.

NOTE: If you drill-down on data inside the Java viewer, and then click the Back button on a Netscape browser 3.x, you may encounter JavaScript errors. To prevent these errors, click the corresponding tab for the view you want retrieved, rather than the Back button.

Adding the Viewer to a Web Page

As a Java applet, the Crystal Smart Viewer can be added to a web page using the standard HTML tag APPLET. The name of the public class exposed by the applet is ReportViewer. Thus, the following code displays the Crystal Smart Viewer for Java:

<APPLET CODE=”ReportViewer.class” CODEBASE=”http://<domain>/viewer/JavaViewer” WIDTH=600 HEIGHT=400>

</APPLET>

When you install Seagate Crystal Reports or the Crystal Web Reports Server, the Java viewer is installed under \Program Files\Seagate Software\Viewers\JavaViewer. Additionally, a virtual directory named /viewer is set up on your web server, which points to the \Program Files\Seagate Software\Viewers directory.

The Crystal Smart Viewer for Java provides several optional parameters to customize the look of the viewer and to control its functionality. Apply values to these parameters using the standard PARAM tag in your HTML code.

Parameters

The Crystal Smart Viewer for Java provides the following parameters:

CanDrillDown

Indicates whether or not the user can drill-down on summary data, graphs, or charts in the report. Use TRUE to allow drill-down, FALSE to prevent drill-down.

HasExportButton

Indicates whether or not an Export button appears on the Smart Viewer. The export button allows users to export reports displayed in the Smart Viewer to Microsoft Word, Microsoft Excel, HTML 3.2, or Seagate Crystal Reports format. Use TRUE to allow exporting, FALSE to prevent it. This setting can be overridden by settings made in the Web Reports Server Configuration utility. See the Export Report Allowed check box, Page 21.

Configuring the Crystal Smart Viewers

55

HasGroupTree

Indicates whether or not the viewer generates a Group Tree for the report. Does not indicate whether or not the Group Tree is displayed. Use TRUE to generate a Group Tree, FALSE to prevent a Group Tree from being generated.

HasPrintButton

Indicates whether or not the viewer includes a print button allowing the viewed report to be printed. Use TRUE to allow printing, FALSE if printing is not allowed. Printing from the Java Smart Viewer requires a web browser or Java Virtual Machine that supports version 1.1 or later of the Java Developer’s Kit (JDK).

HasRefreshButton

Indicates whether or not a Refresh button is available in the viewer to allow the user to refresh report data. Use TRUE to allow users to refresh report data, FALSE to prevent users from refreshing report data.

HasTextSearchControls

Indicates that the viewer includes controls to allow searching for specific values in the report. Use TRUE to allow searching, FALSE to prevent search controls from being displayed.

ReportName

Specifies the report to be displayed inside the viewer. The path must be a URL on the same server as the HTML document and must be placed inside quotation marks.

ShowGroupTree

Indicates whether or not the Group Tree is displayed when the viewer first appears. If the HasGroupTree parameter is set to False, this parameter is ignored. If the Group Tree is hidden, the user can display it by clicking the Toggle Group Tree button in the viewer. Use TRUE to display the Group Tree, FALSE to hide the Group Tree.

Example

The following code demonstrates one means of embedding the Crystal Smart Viewer for Java in a web page. This JavaScript code determines browser version and then installs the appropriate version of the Java Smart Viewer.

<SCRIPT LANGUAGE="JavaScript"><!-- var _ns3 = false;

var _ns4 = false;

//--></SCRIPT>

<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!-- var _info = navigator.userAgent;

var _ns3 = (navigator.appName.indexOf("Netscape") >= 0 && _info.indexOf("Mozilla/3") >= 0);

var _ns4 = (navigator.appName.indexOf("Netscape") >= 0 && _info.indexOf("Mozilla/4") >= 0 );

//--></SCRIPT></COMMENT>

Configuring the Crystal Smart Viewers

56

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