|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectReportViewer
com.crystaldecisions.ReportViewer.ReportViewerBean
public class ReportViewerBean
A Java Bean and extension of javax.swing.JApplet
for viewing Crystal reports.
Being an applet, it is important that the report viewer's init
and
start
methods are called soon after it is created (or de-serialized).
When the report viewer is no longer needed, calling the stop
and
destroy
methods will free up resources.
Almost all of the bean properties are bound.
In other words, a PropertyChangeListener
can be registered with the bean
and it will be notified of all changes to the values of all properties.
Some of the bean properties are also constrained.
A VetoableChangeListener
can be registered that can veto attempts to change
those property values.
In addition to these property notifications, there are two bean events.
A ViewChangeEvent
is fired whenever a view in the report viewer is opened,
activated, or closed.
A HyperlinkEvent
is fired when the user clicks on a hyperlink in the report.
Many of the bean methods start 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 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.
Field Summary | |
---|---|
static int |
toCrystalReport
Specifies exporting to Crystal Reports format. |
static int |
toCSV
Specifies exporting to Comma-Separated Values format. |
static int |
toMSExcel
Deprecated. Replaced by toMSExcelFormattedData . |
static int |
toMSExcelDataOnly
Specifies exporting data columns to Microsoft Excel format. |
static int |
toMSExcelFormattedData
Specifies exporting to Microsoft Excel format. |
static int |
toMSWord
Specifies exporting to Microsoft Word format. |
static int |
toMSWordEditable
Specifies exporting to Microsoft Word format. |
static int |
toPDF
Specifies exporting to Portable Document Format. |
static int |
toRTF
Specifies exporting to Rich Text Format. |
static int |
zoomToPageWidth
Specifies showing the entire width of the report page (but not necessarily the length) within the view. |
static int |
zoomToWholePage
Specifies showing the entire report page within the view. |
Constructor Summary | |
---|---|
ReportViewerBean()
Constructs a ReportViewerBean object. |
Method Summary | |
---|---|
void |
addHyperlinkListener(HyperlinkListener listener)
Adds a listener for hyperlink clicks. |
void |
addServerRequestListener(ServerRequestListener listener)
For internal use only. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener for the viewer's constrained properties. |
void |
addViewChangeListener(ViewChangeListener listener)
Adds a listener for view changes. |
void |
busyChanged(boolean busy_)
For internal use only. |
void |
canCloseCurrentViewChanged(boolean canCloseCurrentView_)
For internal use only. |
void |
closeCurrentView()
If the canCloseCurrentView property is true, closes the current view. |
void |
currentPageNumberChanged(int curPageN_)
For internal use only. |
void |
currentViewNameChanged(java.lang.String currentViewName_)
For internal use only. |
void |
destroy()
|
void |
exportView(int exportFormat,
java.io.File destinationFile)
If the exportingPossible property is true, writes the report
to the local disk in the indicated format. |
void |
exportView(int exportFormat,
int startPageN,
int endPageN,
java.io.File destinationFile)
If the exportingPossible property is true, writes a range of pages
from the report to the local disk in the indicated format. |
boolean |
getBusy()
Returns whether the report viewer is performing a command or is idle. |
boolean |
getCanCloseCurrentView()
Returns whether the current report view can be closed. |
boolean |
getCanDrillDown()
Returns whether the user is allowed to open drill-down views on groups and subreports. |
java.lang.String |
getCurrentMessage()
Returns the most recent message displayed by the viewer. |
int |
getCurrentPageNumber()
Returns the page number from page panel of the current view. |
java.lang.String |
getCurrentTip()
Returns the most recent tooltip displayed by the viewer. |
java.lang.String |
getCurrentViewName()
Returns the name of the current report view. |
java.applet.AppletContext |
getDefaultAppletContext()
For internal use only. |
java.net.URL |
getDefaultCodeBase()
For internal use only. |
java.net.URL |
getDefaultDocumentBase()
For internal use only. |
boolean |
getEnableHyperlink()
Returns whether the cursor changes shape over hyperlinks in the report. |
boolean |
getEnableInteractiveSort()
Returns whether interactive sort controls are allowed in the report. |
boolean |
getExportingPossible()
Returns whether the report viewer has permission from the Security Manager to write to the local disk. |
boolean |
getHasBusyIndicator()
Returns whether the report viewer's toolbar has a busy indicator. |
boolean |
getHasExportButton()
Returns whether the report viewer's toolbar has an Export button. |
boolean |
getHasGroupTree()
Returns whether views on the current report have a group tree pane. |
boolean |
getHasPrintButton()
Returns whether the report viewer's toolbar has a Print button. |
boolean |
getHasRefreshButton()
Returns whether the report viewer's toolbar has a Refresh button. |
boolean |
getHasStatusBar()
Deprecated. The viewer no longer has a status bar. |
boolean |
getHasStopButton()
Returns whether the report viewer's toolbar has a Stop button. |
boolean |
getHasTextSearchControls()
Returns whether the report viewer's toolbar has a Find button. |
boolean |
getHasToolBar()
Returns whether the report viewer's toolbar is visible. |
boolean |
getHasZoomControl()
Returns whether the report viewer's toolbar has a zoom (magnification) control. |
boolean |
getInteractive()
Returns whether the report viewer will display interactive dialogs. |
java.lang.String |
getLanguage()
Deprecated. Replaced by getLocale . |
int |
getLastPageNumber()
Returns the highest-known page number from page panel of the current view. |
boolean |
getLastPageNumberKnown()
Returns whether the last page number from the page panel of the current view is known. |
boolean |
getPrintingPossible()
Returns whether the report viewer has permission from the Security Manager to print. |
boolean |
getPromptOnRefresh()
For internal use only. |
java.lang.String |
getReportName()
For internal use only. |
java.lang.String |
getReportParameter()
For internal use only. |
java.lang.Object |
getReportSource()
Returns the current IReportSource used by the report viewer. |
java.lang.String |
getReportTitle()
For internal use only. |
java.lang.String |
getSearchText()
Returns the most recent search text. |
java.lang.String |
getSelectionFormula()
For internal use only. |
boolean |
getShowControlTooltips()
Returns whether the report viewer's toolbar shows tooltips when the mouse hovers over controls. |
boolean |
getShowCrystalLogo()
Deprecated. Replaced by getShowLogo . |
boolean |
getShowGroupTree()
Returns whether the current view's group tree pane is expanded or collapsed. |
boolean |
getShowLogo()
Returns whether the Business Objects logo is shown in the report viewer's toolbar. |
boolean |
getShowReportTooltips()
Returns whether the report viewer shows tooltips when the mouse hovers over report objects in the page pane. |
void |
groupWidthChanged(boolean showGroupTree_)
For internal use only. |
void |
hyperlinkClicked(java.net.URL url)
For internal use only. |
boolean |
isBusy()
Returns whether the report viewer is performing a command or is idle. |
boolean |
isExportingPossible()
Returns whether the report viewer has permission from the Security Manager to write to the local disk. |
boolean |
isInteractive()
Returns whether the report viewer will display interactive dialogs. |
boolean |
isLastPageNumberKnown()
Returns whether the last page number from the page panel of the current view is known. |
boolean |
isPrintingPossible()
Returns whether the report viewer has permission from the Security Manager to print. |
void |
lastPageNumberChanged(int lastPageN_)
For internal use only. |
void |
lastPageNumberKnownChanged(boolean lastPageNKnown_)
For internal use only. |
void |
printView()
If the printingPossible property is true, prints all pages
in the current view. |
void |
readExternal(java.io.ObjectInput input)
Reads the state of the report viewer from the given input object. |
void |
refreshReport()
Closes all views except the initial one (the "Main Report" view), discards all information cached for the report, refreshes data, and re-requests the current page of the report. |
void |
refreshReport(boolean refreshData)
Closes all views except the initial one (the "Main Report" view), discards all cached pages, and re-requests the current page of the report. |
void |
removeHyperlinkListener(HyperlinkListener listener)
Removes a listener for hyperlink clicks. |
void |
removeServerRequestListener(ServerRequestListener listener)
For internal use only. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a listener for the viewer's constrained properties. |
void |
removeViewChangeListener(ViewChangeListener listener)
Removes a listener for view changes. |
void |
requestEnded(int requestID,
java.net.URL serverURL,
java.lang.String parameters,
boolean cancelled,
java.lang.Exception exception,
java.lang.String errorMessage)
For internal use only. |
void |
requestStarted(int requestID,
java.net.URL serverURL,
java.lang.String parameters)
For internal use only. |
void |
searchForText(java.lang.String searchString)
Displays the next occurrence of the given text in the report output. |
void |
searchForText(java.lang.String searchString,
boolean forwardSearch,
boolean caseSensitive)
Deprecated. |
void |
searchTextChanged(java.lang.String searchText_)
For internal use only. |
void |
setCanDrillDown(boolean canDrillDown_)
Sets whether the user is allowed to open drill-down views on groups and subreports. |
void |
setEnableHyperlink(boolean enableHyperlink_)
Sets whether the cursor should change shape over hyperlinks in the report. |
void |
setEnableInteractiveSort(boolean enableInteractiveSort_)
Sets whether interactive sort controls are allowed in the report. |
void |
setHasBusyIndicator(boolean hasBusyIndicator_)
Adds or removes the busy indicator on the report viewer's toolbar. |
void |
setHasExportButton(boolean hasExportButton_)
Adds or removes an Export button on the report viewer's toolbar. |
void |
setHasGroupTree(boolean hasGroupTree_)
Adds or removes group tree panes in views on the current report. |
void |
setHasPrintButton(boolean hasPrintButton_)
Adds or removes a Print button on the report viewer's toolbar. |
void |
setHasRefreshButton(boolean hasRefreshButton_)
Adds or removes a Refresh button on the report viewer's toolbar. |
void |
setHasStatusBar(boolean hasStatusBar_)
Deprecated. The viewer no longer has a status bar. |
void |
setHasStopButton(boolean hasStopButton_)
Adds or removes a Stop button on the report viewer's toolbar. |
void |
setHasTextSearchControls(boolean hasTextSearchControls_)
Adds or removes a Find button on the report viewer's toolbar. |
void |
setHasToolBar(boolean hasToolBar_)
Shows or hides the report viewer's toolbar. |
void |
setHasZoomControl(boolean hasZoomControl_)
Adds or removes a zoom (magnification) control on the report viewer's toolbar. |
void |
setInteractive(boolean interactive_)
Enables or disables the display of dialogs. |
void |
setLanguage(java.lang.String localeString_)
Deprecated. Replaced by setLocale . |
void |
setPromptOnRefresh(boolean promptOnRefresh_)
For internal use only. |
void |
setReportName(java.lang.String reportName_)
For internal use only. |
void |
setReportParameter(java.lang.String reportParameter_)
For internal use only. |
void |
setReportSource(java.lang.Object reportSource_)
Sets the IReportSource to be used by the report viewer. |
void |
setReportTitle(java.lang.String reportTitle_)
For internal use only. |
void |
setSelectionFormula(java.lang.String selectionFormula_)
For internal use only. |
void |
setShowControlTooltips(boolean showControlTooltips_)
Enables or disables the display of tooltips when the mouse hovers over controls in the report viewer's toolbar. |
void |
setShowCrystalLogo(boolean showLogo_)
Deprecated. Replaced by setShowLogo . |
void |
setShowGroupTree(boolean showGroupTree_)
Expands or collapses the group tree pane in the current view. |
void |
setShowLogo(boolean showLogo_)
Hides or shows the Business Objects logo in the report viewer's toolbar. |
void |
setShowReportTooltips(boolean showReportTooltips_)
Enables or disables the display of tooltips when the mouse hovers over report objects in the page pane. |
void |
setZoomFactor(int zoomFactor_)
Sets the zoom (magnification) factor for the page pane in the current view. |
void |
showLastPage()
Shows the last page of the report. |
void |
showPage(int pageN)
Shows the indicated page. |
void |
showTip(java.lang.String currentTip_)
For internal use only. |
void |
stopAllCommands()
Cancels all unfinished commands. |
void |
viewActivated(java.lang.String viewName)
For internal use only. |
void |
viewClosed(java.lang.String viewName)
For internal use only. |
void |
viewOpened(java.lang.String viewName)
For internal use only. |
void |
writeExternal(java.io.ObjectOutput output)
Writes the state of the report viewer to the given output object. |
void |
zoomFactorChanged(int zoomFactor_)
For internal use only. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int zoomToWholePage
public static final int zoomToPageWidth
public static final int toCrystalReport
public static final int toMSWord
public static final int toMSExcelFormattedData
public static final int toRTF
public static final int toPDF
public static final int toMSExcelDataOnly
public static final int toMSWordEditable
public static final int toCSV
public static final int toMSExcel
toMSExcelFormattedData
.toMSExcelFormattedData
Constructor Detail |
---|
public ReportViewerBean()
ReportViewerBean
object.
Method Detail |
---|
public java.net.URL getDefaultCodeBase()
public java.net.URL getDefaultDocumentBase()
public java.applet.AppletContext getDefaultAppletContext()
public void destroy()
public void writeExternal(java.io.ObjectOutput output) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
output
- The stream to write the viewer state to.
java.io.IOException
public void readExternal(java.io.ObjectInput input) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
input
- The stream to read the viewer state from.
java.io.IOException
- If an I/O error occurs.
java.lang.ClassNotFoundException
- If the class for an object being restored cannot be found.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- public boolean isInteractive()
public boolean getInteractive()
This method is a synonym for isInteractive
.
public void setInteractive(boolean interactive_)
interactive_
- True if the report viewer can display interactive dialogs.public java.lang.Object getReportSource()
IReportSource
used by the report viewer.
IReportSource
or null.public void setReportSource(java.lang.Object reportSource_)
IReportSource
to be used by the report viewer.
reportSource_
- An IReportSource
or null.public java.lang.String getReportName()
public void setReportName(java.lang.String reportName_)
reportName_
- public java.lang.String getReportTitle()
public void setReportTitle(java.lang.String reportTitle_)
reportTitle_
- public java.lang.String getReportParameter()
public void setReportParameter(java.lang.String reportParameter_)
reportParameter_
- public java.lang.String getLanguage()
getLocale
.
public void setLanguage(java.lang.String localeString_)
setLocale
.
localeString_
- public boolean getHasToolBar()
public void setHasToolBar(boolean hasToolBar_)
hasToolBar_
- True if the toolbar is to be made visible.public boolean isPrintingPossible()
public boolean getPrintingPossible()
This method is a synonym for isPrintingPossible
.
public boolean getHasPrintButton()
public void setHasPrintButton(boolean hasPrintButton_) throws java.beans.PropertyVetoException
printingPossible
property is true; otherwise, an attempt to add a Print button will be vetoed.
hasPrintButton_
- True if the toolbar should have a Print button.
java.beans.PropertyVetoException
public boolean isExportingPossible()
public boolean getExportingPossible()
This method is a synonym for isExportingPossible
.
public boolean getHasExportButton()
public void setHasExportButton(boolean hasExportButton_) throws java.beans.PropertyVetoException
exportingPossible
property is true; otherwise, an attempt to add an Export button will be vetoed.
hasExportButton_
- True if the toolbar should have an Export button.
java.beans.PropertyVetoException
public boolean getHasStopButton()
public void setHasStopButton(boolean hasStopButton_)
hasStopButton_
- True if the toolbar should have a Stop button.public boolean getHasRefreshButton()
public void setHasRefreshButton(boolean hasRefreshButton_)
hasRefreshButton_
- True if the toolbar should have a Refresh button.public boolean getHasGroupTree()
public void setHasGroupTree(boolean hasGroupTree_) throws java.beans.PropertyVetoException
hasGroupTree_
- True if views should have a group tree pane.
java.beans.PropertyVetoException
public boolean getShowGroupTree()
public void setShowGroupTree(boolean showGroupTree_) throws java.beans.PropertyVetoException
showGroupTree_
- True if the group tree pane should be expanded.
java.beans.PropertyVetoException
public void groupWidthChanged(boolean showGroupTree_)
showGroupTree_
- public boolean getHasZoomControl()
public void setHasZoomControl(boolean hasZoomControl_)
hasZoomControl_
- True if the toolbar should have a zoom control.public void setZoomFactor(int zoomFactor_) throws java.beans.PropertyVetoException
zoomToWholePage
or zoomToPageWidth
.
zoomFactor_
- A value between 25 and 400, or zoomToWholePage
or zoomToPageWidth
.
java.beans.PropertyVetoException
public void zoomFactorChanged(int zoomFactor_)
zoomFactor_
- public boolean getHasTextSearchControls()
public void setHasTextSearchControls(boolean hasTextSearchControls_)
hasTextSearchControls_
- True if the toolbar should have a Find button.public boolean getHasBusyIndicator()
public void setHasBusyIndicator(boolean hasBusyIndicator_)
hasBusyIndicator_
- True if the toolbar should have a busy indicator.public boolean getCanDrillDown()
public void setCanDrillDown(boolean canDrillDown_)
canDrillDown_
- True if drill-down views are to be allowed.public int getCurrentPageNumber()
public void currentPageNumberChanged(int curPageN_)
curPageN_
- public int getLastPageNumber()
isLastPageNumberKnown()
public void lastPageNumberChanged(int lastPageN_)
lastPageN_
- public boolean isLastPageNumberKnown()
public boolean getLastPageNumberKnown()
This method is a synonym for isLastPageNumberKnown
.
public void lastPageNumberKnownChanged(boolean lastPageNKnown_)
lastPageNKnown_
- public java.lang.String getCurrentViewName()
ViewChangeListener
public void currentViewNameChanged(java.lang.String currentViewName_)
currentViewName_
- public boolean getCanCloseCurrentView()
closeCurrentView()
public void canCloseCurrentViewChanged(boolean canCloseCurrentView_)
canCloseCurrentView_
- public boolean isBusy()
public boolean getBusy()
This method is a synonym for isBusy
.
public void busyChanged(boolean busy_)
busy_
- public java.lang.String getSearchText()
searchForText(String)
public void searchTextChanged(java.lang.String searchText_)
searchText_
- public java.lang.String getSelectionFormula()
public void setSelectionFormula(java.lang.String selectionFormula_)
selectionFormula_
- public boolean getPromptOnRefresh()
public void setPromptOnRefresh(boolean promptOnRefresh_)
promptOnRefresh_
- public boolean getHasStatusBar()
public void setHasStatusBar(boolean hasStatusBar_)
hasStatusBar_
- True if there should be a status bar at the bottom edge of the viewer.public java.lang.String getCurrentMessage()
public java.lang.String getCurrentTip()
getShowControlTooltips()
,
getShowReportTooltips()
public void showTip(java.lang.String currentTip_)
currentTip_
- public boolean getEnableHyperlink()
public void setEnableHyperlink(boolean enableHyperlink_)
HyperlinkEvent
s.
enableHyperlink_
- True if the cursor should show that hyperlinks are active.HyperlinkListener
public boolean getEnableInteractiveSort()
public void setEnableInteractiveSort(boolean enableInteractiveSort_)
enableInteractiveSort_
- True if interactive sort controls are allowed.public boolean getShowControlTooltips()
public void setShowControlTooltips(boolean showControlTooltips_)
showControlTooltips_
- True if tooltips are to be enabled.public boolean getShowReportTooltips()
public void setShowReportTooltips(boolean showReportTooltips_)
showReportTooltips_
- True if tooltips are to be enabled.public boolean getShowLogo()
public void setShowLogo(boolean showLogo_)
showLogo_
- True if the logo is to be made visible.public boolean getShowCrystalLogo()
getShowLogo
.
getShowLogo()
public void setShowCrystalLogo(boolean showLogo_)
setShowLogo
.
showLogo_
- setShowLogo(boolean)
public void addViewChangeListener(ViewChangeListener listener)
listener
- ViewChangeEvent
,
ViewChangeListener
,
ViewChangeAdapter
public void removeViewChangeListener(ViewChangeListener listener)
listener
- public void viewOpened(java.lang.String viewName)
viewName
- public void viewActivated(java.lang.String viewName)
viewName
- public void viewClosed(java.lang.String viewName)
viewName
- public void addServerRequestListener(ServerRequestListener listener)
listener
- public void removeServerRequestListener(ServerRequestListener listener)
listener
- public void requestStarted(int requestID, java.net.URL serverURL, java.lang.String parameters)
requestID
- serverURL
- parameters
- public void requestEnded(int requestID, java.net.URL serverURL, java.lang.String parameters, boolean cancelled, java.lang.Exception exception, java.lang.String errorMessage)
requestID
- serverURL
- parameters
- cancelled
- exception
- errorMessage
- public void addHyperlinkListener(HyperlinkListener listener)
listener
- setEnableHyperlink(boolean)
,
HyperlinkEvent
,
HyperlinkListener
public void removeHyperlinkListener(HyperlinkListener listener)
listener
- public void hyperlinkClicked(java.net.URL url)
url
- public void closeCurrentView()
canCloseCurrentView
property is true, closes the current view.
Equivalent to the close button on the view's tab.
A viewClosed
and a viewActivated
event are fired.
The currentViewName
property is changed.
getCanCloseCurrentView()
public void showPage(int pageN)
currentPageNumber
property is changed.
pageN
- Which page to show.getCurrentPageNumber()
,
getLastPageNumber()
,
isLastPageNumberKnown()
public void showLastPage()
lastPageNumber
and lastPageNumberKnown
properties
may be changed.
getCurrentPageNumber()
,
getLastPageNumber()
,
isLastPageNumberKnown()
public void stopAllCommands()
public void printView()
printingPossible
property is true, prints all pages
in the current view.
Equivalent to the Print button in the toolbar.
isPrintingPossible()
public void exportView(int exportFormat, java.io.File destinationFile)
exportingPossible
property is true, writes the report
to the local disk in the indicated format.
Similar to the Export button in the toolbar.
exportFormat
- Which format to export into.destinationFile
- Where to write the exported report.isExportingPossible()
public void exportView(int exportFormat, int startPageN, int endPageN, java.io.File destinationFile)
exportingPossible
property is true, writes a range of pages
from the report to the local disk in the indicated format.
Similar to the Export button in the toolbar.
exportFormat
- Which format to export into.startPageN
- The first page to export.endPageN
- The last page to export, or 0 to export to the end of the report.destinationFile
- Where to write the exported report.isExportingPossible()
public void refreshReport()
public void refreshReport(boolean refreshData)
refreshData
- Whether to also refresh the data.public void searchForText(java.lang.String searchString)
searchText
property is changed.
searchString
- The text to find.getSearchText()
public void searchForText(java.lang.String searchString, boolean forwardSearch, boolean caseSensitive)
searchText
property is changed.
searchString
- The text to find.forwardSearch
- Ignored.caseSensitive
- Ignored.searchForText(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |