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

The Crystal Smart Viewer/Java Bean Methods

Each of the methods in the Report Viewer Bean starts what may be a lengthy operation, and they return to the caller before that operation is complete. If it is important to know when the command begun by one of these methods is finished, the calling code should watch for the associated events or property change notifications.

Generally there will be a time delay between the method call returning and the associated event being fired or the property changing. In fact, there may be a delay in beginning the command if the report viewer is busy processing a previous command. Commands are begun strictly one at a time in the order they are generated although, once begun, they may be processed in parallel in different threads.

The events and property change notifications will be given to the calling code on a different thread from the one that made the method call.

closeCurrentView

If the canCloseCurrentView property is true, closes the current view. Equivalent to the Close button in the toolbar. A viewClosed and a viewActivated event are fired. The currentViewName property is changed.

Syntax

void closeCurrentView ()

exportView

If the exportingPossible property is true, requests the report from the server in the indicated format and writes it to the local disk. Similar to the Export button in the toolbar.

Syntax

void exportView (int exportFormat, File destinationFile)

Parameters

exportFormat

Specifies the format in which the requested report should appear.

 

 

Constant Value

toHTML 0

toCrystalReport 1

toMSWord 2

toMSExcel 3

destinationFile

Complete pathname of the destination file.

 

 

Smart Viewer Object Models

168

printView

If the printingPossible property is true, prints all pages in the current view, requesting them from the server if necessary. Equivalent to the Print button in the toolbar.

Syntax

void printView ()

refreshReport

Closes all views except the initial one (the "Preview" view), discards all information cached for the report, and re-requests the current page of the report.

Syntax

void refreshReport ()

searchForText

Displays the next occurrence of the indicated text in the report output. Equivalent to the text search field in the toolbar. Currently, the second and third parameters are ignored; the search is always forward and caseinsensitive. The searchText property is changed.

Syntax

void searchForText (String searchString, boolean forwardSearch,boolean caseSensitive)

Parameters

searchString

The string for which you want to search.

 

 

forwardSearch

This parameter is ignored.

caseSensitive

This parameter is ignored.

showLastPage

Shows the last page of the report, requesting it from the server if necessary. Equivalent to the Last Page button in the toolbar. The lastPageNumber and lastPageNumberKnown properties may be changed.

Syntax

void showLastPage ()

Smart Viewer Object Models

169

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