|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The report viewer interface. A report viewer is capable of displaying JasperPrint documents and its state changes are observable through a listener mechanism.
Field Summary | |
static int |
ZOOM_MODE_ACTUAL_SIZE
The zoom mode that instructs the viewer to display report pages at their actual size. |
static int |
ZOOM_MODE_FIT_HEIGHT
The zoom mode that instructs the viewer to display report pages so that they fit the available height. |
static int |
ZOOM_MODE_FIT_PAGE
The zoom mode that instructs the viewer to display report pages so that they fit the available width and height. |
static int |
ZOOM_MODE_FIT_WIDTH
The zoom mode that instructs the viewer to display report pages so that they fit the available width. |
static int |
ZOOM_MODE_NONE
The zoom mode constant that stands for "no zoom" |
Method Summary | |
void |
addHyperlinkListener(net.sf.jasperreports.view.JRHyperlinkListener listener)
Registers a hyperlink click listener that will be notified when user clicks a hyperlink. |
void |
addReportViewerListener(IReportViewerListener listener)
Register a report viewer listener that will observe the viewer state changes |
boolean |
canChangeZoom()
Checks the necessary preconditions for zoom changing |
boolean |
canGotoFirstPage()
Checks the preconditions for first page positioning |
boolean |
canGotoLastPage()
Checks the preconditions for last page positioning |
boolean |
canGotoNextPage()
Checks the preconditions for next page positioning |
boolean |
canGotoPreviousPage()
Checks the preconditions for previous page positioning |
boolean |
canReload()
Checks whether the document can be reloaded. |
boolean |
canZoomIn()
Checks the zoom-in operation preconditions |
boolean |
canZoomOut()
Checks the zoom in preconditions |
net.sf.jasperreports.engine.JasperPrint |
getDocument()
Returns the jasper print document |
net.sf.jasperreports.view.JRHyperlinkListener[] |
getHyperlinkListeners()
Returns registered hyperlink listeners |
int |
getPageIndex()
Returns the current page index. |
java.lang.String |
getReason()
Returns the message that explains the reason that the document is missing. |
double |
getZoom()
Returns the current zoom level |
double[] |
getZoomLevels()
Returns an array with available zoom levels |
int |
getZoomMode()
Returns the current zoom mode |
void |
gotoFirstPage()
Positions the viewer on the first page in the document |
void |
gotoLastPage()
Positions the viewer on the last page in the document |
void |
gotoNextPage()
Positions the viewer on the next page in the document |
void |
gotoPreviousPage()
Positions the viewer on the previous page in the document |
boolean |
hasDocument()
Returns true if there is a jasper print document set |
void |
loadDocument(java.lang.String fileName,
boolean xml)
Loads the document from the given file. |
void |
reload()
Reloads the report. |
void |
removeHyperlinkListener(net.sf.jasperreports.view.JRHyperlinkListener listener)
Removes a previously registered hyperlink click listener |
void |
removeReportViewerListener(IReportViewerListener listener)
Removes a previously registered report viewer listener |
void |
setDocument(net.sf.jasperreports.engine.JasperPrint document)
Sets the jasper print document |
void |
setPageIndex(int pageIndex)
Sets the current page index. |
void |
setZoom(double zoom)
Sets the zoom level |
void |
setZoomLevels(double[] zoomLevels)
Sets the available zoom levels |
void |
setZoomMode(int zoomMode)
Sets the zoom mode. |
void |
unsetDocument(java.lang.String reason)
Sets to null the currently set document. |
void |
zoomIn()
Zooms in the viewer |
void |
zoomOut()
Zooms out the viewer |
Field Detail |
public static final int ZOOM_MODE_NONE
public static final int ZOOM_MODE_ACTUAL_SIZE
public static final int ZOOM_MODE_FIT_WIDTH
public static final int ZOOM_MODE_FIT_HEIGHT
public static final int ZOOM_MODE_FIT_PAGE
Method Detail |
public void loadDocument(java.lang.String fileName, boolean xml)
JasperPrint
object or a jrprint
xml document. The format is controlled by the xml
boolean parameter.
fileName
- the file namexml
- flag that indicates the type of file type. If true, the file
contains an xml and a serialized object otherwise.public void setDocument(net.sf.jasperreports.engine.JasperPrint document)
document
- document to set. Must be not null.public net.sf.jasperreports.engine.JasperPrint getDocument()
public boolean hasDocument()
public void unsetDocument(java.lang.String reason)
reason
- the reason for the missing document. Can be null.public java.lang.String getReason()
public void addReportViewerListener(IReportViewerListener listener)
listener
- the listenerpublic void removeReportViewerListener(IReportViewerListener listener)
listener
- the listenerpublic void reload()
loadDocument
method.
loadDocument(String, boolean)
public boolean canReload()
public int getPageIndex()
public void setPageIndex(int pageIndex)
pageIndex
- the page indexpublic void gotoNextPage()
public boolean canGotoNextPage()
public void gotoPreviousPage()
public boolean canGotoPreviousPage()
public void gotoLastPage()
public boolean canGotoLastPage()
public void gotoFirstPage()
public boolean canGotoFirstPage()
public void setZoom(double zoom)
zoom
- zoom levelpublic double getZoom()
public boolean canChangeZoom()
public void setZoomMode(int zoomMode)
ZOOM_MODE
constants must be used.
zoomMode
- the zoom modepublic int getZoomMode()
public double[] getZoomLevels()
public void setZoomLevels(double[] zoomLevels)
zoomLevels
- a non-null and non-empty array of zoom levelspublic void zoomIn()
public boolean canZoomIn()
public void zoomOut()
public boolean canZoomOut()
public void addHyperlinkListener(net.sf.jasperreports.view.JRHyperlinkListener listener)
listener
- the listener to addpublic void removeHyperlinkListener(net.sf.jasperreports.view.JRHyperlinkListener listener)
listener
- the listener to removepublic net.sf.jasperreports.view.JRHyperlinkListener[] getHyperlinkListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |