public interface ReportView extends ViewerComponent
ReportViewer.addNewReportView(RenderData)
and SwingReportViewer.createReportView(RenderData)
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CURRENT_PAGE
Current page property - to be used for PropertyChangeEvents.
|
static int |
EXPORT_CSV
Export Format CSV (Comma separated values)
|
static int |
EXPORT_DATA
Export Format DATA (Comma separated values)
|
static int |
EXPORT_HTML
Export Format HTML
|
static int |
EXPORT_PDF
Export Format PDF
|
static int |
EXPORT_PS
Export Format PS (PostScript Level 1)
|
static int |
EXPORT_PS2
Export Format PS2 (PostScript Level 2)
|
static int |
EXPORT_PS3
Export Format PS3 (PostScript Level 3)
|
static int |
EXPORT_RTF
Export Format RTF
|
static int |
EXPORT_SVG
Export Format SVG (Scalable Vector Graphics)
|
static int |
EXPORT_TXT
Export Format TXT (Plain Text Format)
|
static int |
EXPORT_XLS
Export Format XLS (Microsoft Excel format)
|
static int |
EXPORT_XML
Export Format XML
|
static float |
MAX_ZOOM_FACTOR
The maximum zoom factor
|
static float |
MIN_ZOOM_FACTOR
The minimum zoom factor
|
static int |
MODE_HAND
For scrolling around by click & drag
|
static int |
MODE_SNAPSHOT
For copying an image snapshot by click & drag
|
static int |
MODE_TEXT
For selecting text by click & drag
|
static java.lang.String |
PROP_LOADING_STATUS
Property name for the current loading status of the report view.
|
static java.lang.String |
PROP_TIMESTAMP
Property name for the timestamp of the
latest version received of the report,
Property value will be a Long.
|
static int |
STATUS_CANCELED
Constant for
getLoadingStatus() , means the loading has been canceled by the user |
static int |
STATUS_FINISHED
Constant for
getLoadingStatus() , means the report has been successfully loaded |
static int |
STATUS_INITIALIZED
Constant for
getLoadingStatus() , means the report view is loading for the first time, no pages have been loaded yet. |
static int |
STATUS_LOADING
Constant for
getLoadingStatus() , means at least one page has been loaded and the report view is currently fetching
the other pages of the report if there are any |
static java.lang.String |
TOTAL_PAGE_COUNT
Total Page Count property - to be used for PropertyChangeEvents.
|
static int |
TOTAL_PAGE_COUNT_UNKNOWN
The total number of pages is as of yet unknown
|
static int |
VIEW_DOUBLE_CONTINUOUS
The report can be scrolled through in its entirety, however showing the pages two by two.
|
static int |
VIEW_DOUBLE_PAGE
Only two pages are shown at a time, one next to the other.
|
static java.lang.String |
VIEW_IS_AT_END_OF_REPORT
Whether or not the scroll view is at the end of the report (property is a boolean)
|
static java.lang.String |
VIEW_MODE
View Mode property - to be used for PropertyChangeEvents.
|
static int |
VIEW_SINGLE_CONTINUOUS
The report can be scrolled through in its entirety, with each page being shown above the next.
|
static int |
VIEW_SINGLE_PAGE
Only one page is shown at a time.
|
static java.lang.String |
ZOOM_FACTOR
Zoom factor property - to be used for PropertyChangeEvents.
|
static int |
ZOOM_MANUAL
No automatic zoom
|
static int |
ZOOM_TO_FULLPAGE
Automatically zoom in or out so that the full page is visible, no more, no less.
|
static int |
ZOOM_TO_PAGEHEIGHT
Automatically zoom in or out so that the full height of the page is visible, no more, no less.
|
static int |
ZOOM_TO_PAGEWIDTH
Automatically zoom in or out so that the full width of the page is visible, no more, no less.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
This cancels the loading of the current report in case it is still loading.
|
ExportProgress |
export()
Exports the report connected to this report view.
|
Progress |
export(int format,
java.lang.String file)
Exports the report connected to this report view into the given file.
|
Progress |
export(java.util.Properties exportProperties)
Exports the report connected to this report view into the given file.
|
NavigationView |
extractNavigationView()
Removes the navigation view GUI component from the ReportView and returns it.
|
StatusBar |
extractStatusBar()
Removes the status bar GUI component from the ReportView and returns it.
|
int |
getAutomaticZoomType()
Returns which type of automatic zoom is used in the report view whenever the ReportView
is displayed anew, for example after resizing the display.
|
int |
getCurrentPage()
Returns the number of the "current page" being displayed in this ReportView.
|
javax.print.attribute.HashPrintRequestAttributeSet |
getDefaultAttributeSet(int fromPage,
int toPage)
Creates and returns a HashPrintRequestAttributeSet for the given page(s) with the default
printing attributes.
|
int |
getLoadingStatus()
Fetches the current "loading status" of this report view.
|
int |
getMouseActionMode()
Returns the currently selected mode for mouse actions such as clicking and dragging in this
ReportView.
|
NavigationView |
getNavigationView()
Returns this ReportView's NavigationView, that is, the element containing this ReportView's SearchView, GroupView and/or IndexView.
|
RenderData |
getReportData()
Returns the RenderData object belonging to this ReportView.
|
java.lang.String |
getReportTitle()
Returns the title of this report if it is known.
|
ReportViewer |
getReportViewer()
Returns the parent ReportViewer for this component.
|
StatusBar |
getStatusBar()
Returns this ReportView's StatusBar, the element which can display messages or progress bars.
|
int |
getTotalPages()
Returns the total number of pages this report has.
|
int |
getViewMode()
Returns which type of layout view this ReportView is to take.
|
float |
getZoomFactor()
Returns the currently set zoom factor of this ReportView - this is not a percentage value,
that is, 1.0 is 1x, 2.0 is 2x view, 0.25 is 1/4 view, etc.
|
void |
goToLastPage()
Navigates directly to the last page in the report - if the current page is
already the last page of the report, or if the total page count is not known
as of yet (that is, the report is still being rendered), this method does nothing.
|
void |
goToPage(int pageNum)
Causes the page indicated by the parameter pageNum to be displayed in this ReportView.
|
boolean |
hasGroupTree()
Returns whether or not this report view is set to show a group tree.
|
boolean |
isDrilldownEnabled()
Returns whether this report view should allow drill downs on its groups if it has any.
|
boolean |
isExportEnabled()
Returns if at least one export format is enabled for this ReportView.
|
boolean |
isPageLimitExceeded()
Returns whether this report view has more pages than the server page limit for a report allows for (causing the later pages to be truncated
from the report).
|
boolean |
isReportSuppressed()
Returns whether this report was suppressed because it has no rows.
|
void |
nextPage()
Navigates one step forward in the report - if this is not possible (e.g. the current page is
already the last page of the report), this method does nothing.
|
void |
prevPage()
Navigates one step back in the report - if this is not possible (e.g. the current page is
already the first page of the report), this method does nothing.
|
Progress |
print(int fromPage,
int toPage,
boolean showPrintDialog)
Prints the current report in the page range with or without any dialogs.
|
Progress |
print(int fromPage,
int toPage,
java.awt.print.PrinterJob pjob)
Prints the current report to a PrinterJob without any dialogs.
|
Progress |
print(java.awt.print.PrinterJob printerJob,
javax.print.attribute.PrintRequestAttributeSet attributeSet)
Creates a new PrinterJobProgress with the given attributes and start it.
|
void |
refresh()
Causes this ReportView to refresh its pages by re-fetching the report data - this causes a
re-rendering of the report data.
|
void |
reload()
Causes this ReportView to reload its pages and show them again, using the already fetched
data if possible - if not, this causes a fetching of the report data.
|
void |
replaceNavigationView(java.awt.Component component)
Inserts the given component at the position of the navigation view.
|
void |
replaceStatusBar(java.awt.Component component)
Inserts the given component at the position of the status bar.
|
void |
setAutoRefresh(int millis)
Sets the auto-refresh time for this report view.
|
void |
setAutomaticZoomType(int type)
Sets the type of zoom to use in the report view when the ReportView is displayed anew (for
example after resizing the display).
|
void |
setDrilldownEnabled(boolean enabled)
Sets whether this report view should allow drill downs on its groups if it has any.
|
void |
setHasGroupTree(boolean hasGroupTree)
Sets this report view to whether or not it is to show a group tree.
|
void |
setMouseActionMode(int mode)
Sets the mode this ReportView is to be in for mouse actions such as clicking and dragging.
|
void |
setViewMode(int i)
Sets the type of view this ReportView is to take and causes this view to be displayed
immediately.
|
void |
setZoomFactor(float factor)
Sets the zoom factor to this value.
|
void |
showError(java.lang.Throwable th)
Displays an error box showing the Throwable's error message.
|
getComponent
static final int ZOOM_MANUAL
static final int ZOOM_TO_PAGEWIDTH
static final int ZOOM_TO_PAGEHEIGHT
static final int ZOOM_TO_FULLPAGE
static final int MODE_HAND
static final int MODE_TEXT
static final int MODE_SNAPSHOT
static final int VIEW_SINGLE_PAGE
static final int VIEW_SINGLE_CONTINUOUS
static final int VIEW_DOUBLE_PAGE
static final int VIEW_DOUBLE_CONTINUOUS
static final int TOTAL_PAGE_COUNT_UNKNOWN
static final int EXPORT_PDF
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_HTML
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_XLS
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_CSV
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_DATA
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_PS
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_PS2
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_PS3
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_TXT
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_SVG
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_XML
export(int, String)
,
Constant Field Valuesstatic final int EXPORT_RTF
export(int, String)
,
Constant Field Valuesstatic final float MIN_ZOOM_FACTOR
static final float MAX_ZOOM_FACTOR
static final int STATUS_INITIALIZED
getLoadingStatus()
, means the report view is loading for the first time, no pages have been loaded yet.static final int STATUS_LOADING
getLoadingStatus()
, means at least one page has been loaded and the report view is currently fetching
the other pages of the report if there are anystatic final int STATUS_FINISHED
getLoadingStatus()
, means the report has been successfully loadedstatic final int STATUS_CANCELED
getLoadingStatus()
, means the loading has been canceled by the userstatic final java.lang.String PROP_TIMESTAMP
static final java.lang.String PROP_LOADING_STATUS
getLoadingStatus()
,
STATUS_CANCELED
,
STATUS_FINISHED
,
STATUS_LOADING
,
STATUS_INITIALIZED
,
Constant Field Valuesstatic final java.lang.String VIEW_IS_AT_END_OF_REPORT
static final java.lang.String VIEW_MODE
static final java.lang.String TOTAL_PAGE_COUNT
static final java.lang.String CURRENT_PAGE
static final java.lang.String ZOOM_FACTOR
javax.print.attribute.HashPrintRequestAttributeSet getDefaultAttributeSet(int fromPage, int toPage)
fromPage
- Number of the first page for which to create the HashPrintRequestAttributeSet. The first page of a report has the value 1.toPage
- Number of the last page for which to create the HashPrintRequestAttributeSet. A value of -1 means to create the AttributeSet for all pages starting at startPage.HashPrintRequestAttributeSet
Progress print(int fromPage, int toPage, boolean showPrintDialog)
fromPage
- the index of the start page to be printed, the first page is 1.toPage
- the index of the last page to be printed. A value of -1 means all pages.showPrintDialog
- if true
, a print dialog is showing.print(int, int, PrinterJob)
,
PrinterJobProgress
Progress print(int fromPage, int toPage, java.awt.print.PrinterJob pjob)
fromPage
- the index of the start page to be printed, the first page is 1.toPage
- the index of the last page to be printed. A value of -1 means all pages.pjob
- A java.awt.print.PrinterJob object.print(int,int,boolean)
,
PrinterJobProgress
Progress print(java.awt.print.PrinterJob printerJob, javax.print.attribute.PrintRequestAttributeSet attributeSet)
printerJob
- The PrinterJob with the target PrintService.attributeSet
- attributeSet A list of attributes that can override values in the report design,
for example paper format, paper orientation and page margins.getDefaultAttributeSet(int, int)
,
PrinterJobProgress
ExportProgress export()
ViewerException
- If exporting has been disabled for this report or no export format has been enabled for this reportExportProgress
Progress export(int format, java.lang.String file)
format
- The export format in that the report will be exported.file
- Name of the file in that the report will be exported.ViewerException
- If exporting has been disabled for this report or the requested export format is not available for this reportExportProgress
,
EXPORT_CSV
,
EXPORT_DATA
,
EXPORT_HTML
,
EXPORT_PDF
,
EXPORT_PS
,
EXPORT_PS2
,
EXPORT_PS3
,
EXPORT_RTF
,
EXPORT_SVG
,
EXPORT_TXT
,
EXPORT_XLS
,
EXPORT_XML
Progress export(java.util.Properties exportProperties)
exportProperties
- Properties for the export, including format, file and other properties if they are available for the selected format.ViewerException
- If exporting has been disabled for this report or the requested export format is not available for this reportExportProgress
boolean isExportEnabled()
void showError(java.lang.Throwable th)
th
- Throwable to display in an error box. Best if this Throwable is a ViewerException.NavigationView getNavigationView()
StatusBar getStatusBar()
StatusBar extractStatusBar()
NavigationView extractNavigationView()
void replaceStatusBar(java.awt.Component component)
component
- Component to position at the status bar position, null if the status bar is simply to be removed.void replaceNavigationView(java.awt.Component component)
component
- Component to position at the navigation view position, null if the navigation view is simply to be removedvoid reload()
refresh()
void refresh()
reload()
void cancel()
STATUS_FINISHED
or STATUS_CANCELED
, this
method has no effect.void goToPage(int pageNum)
pageNum
- Number of page (starting at 1) to be displayed in this ReportView.int getCurrentPage()
int getTotalPages()
TOTAL_PAGE_COUNT_UNKNOWN
void prevPage()
void nextPage()
void goToLastPage()
void setViewMode(int i)
i
- Layout type to display in this ReportView.VIEW_DOUBLE_CONTINUOUS
,
VIEW_DOUBLE_PAGE
,
VIEW_SINGLE_PAGE
,
VIEW_SINGLE_CONTINUOUS
int getViewMode()
setViewMode(int)
,
VIEW_DOUBLE_CONTINUOUS
,
VIEW_DOUBLE_PAGE
,
VIEW_SINGLE_PAGE
,
VIEW_SINGLE_CONTINUOUS
void setZoomFactor(float factor)
setAutomaticZoomType(int)
factor
- Factor to zoom to - 1.0 as 100%, 2.0 as 200%, etc.MIN_ZOOM_FACTOR
,
MAX_ZOOM_FACTOR
,
setAutomaticZoomType(int)
void setAutomaticZoomType(int type)
type
- Zoom type to use when displaying the ReportView.ZOOM_MANUAL
,
ZOOM_TO_FULLPAGE
,
ZOOM_TO_PAGEHEIGHT
,
ZOOM_TO_PAGEWIDTH
,
getAutomaticZoomType()
int getAutomaticZoomType()
ZOOM_MANUAL
,
ZOOM_TO_PAGEHEIGHT
,
ZOOM_TO_PAGEWIDTH
,
ZOOM_TO_FULLPAGE
,
setAutomaticZoomType(int)
float getZoomFactor()
void setMouseActionMode(int mode)
mode
- Mouse mode to be used in the ReportView.MODE_HAND
,
MODE_SNAPSHOT
,
MODE_TEXT
int getMouseActionMode()
MODE_HAND
,
MODE_SNAPSHOT
,
MODE_TEXT
void setHasGroupTree(boolean hasGroupTree)
hasGroupTree
- Is this report view to show a group tree?getNavigationView()
,
extractNavigationView()
boolean hasGroupTree()
RenderData getReportData()
ReportViewer getReportViewer()
java.lang.String getReportTitle()
RenderData.setReportTitle(String)
int getLoadingStatus()
STATUS_CANCELED
,
STATUS_FINISHED
,
STATUS_INITIALIZED
,
STATUS_LOADING
void setAutoRefresh(int millis)
millis
milliseconds. Note that if the report has prompts, its prompts will not be re-requested
at each auto-refresh. Also, a refresh will be skipped if the prompt dialog is currently open, if the report is
already currently being refreshed, if the report was manually canceled or if it was stopped due to an error.millis
- number of milliseconds for auto-refresh cycle, 0 to turn off auto-refreshvoid setDrilldownEnabled(boolean enabled)
enabled
- true if it is to be enabledboolean isDrilldownEnabled()
setDrilldownEnabled(boolean)
and/or as a ViewerSettings entry.boolean isPageLimitExceeded()
boolean isReportSuppressed()
Copyright © 1999-2020 by i-net software GmbH