Klasse SwingReportView
- Alle implementierten Schnittstellen:
ReportView, ViewerComponent, ImageObserver, MenuContainer, Serializable, Accessible
To obtain an instance of a SwingReportView, use the methods
SwingReportViewer.addNewReportView(RenderData)
and SwingReportViewer.createReportView(RenderData).Also, similarly to SwingReportViewer, a SwingReportView object is highly customizable. It is possible to hide components or place your own components in place of the navigation view or status bar. Here are a couple of examples of what could be done with a SwingReportView:
Hide the navigation view
If your report view does not have a group tree, or does not need a navigation view, you might want to hide the
navigation view. To do this, simply extract it with extractNavigationView(). This will cause the
navigation view to be hidden. If you should later still want to get a reference to the navigation view object, this
is possible using getNavigationView().
"Wrap" the status bar in an own component
Using the methods "extractStatusBar" and "insertAtStatusBarPosition" this is quite simple:
StatusBar oldStatusBar = myView.extractStatusBar(); // We have now extracted the old status bar from the view - it should now no longer be // visible in the report view. Now, we place this status bar into our own component. // Let's say our own component has a green button called "TestGreen". JPanel newStatusBar = new JPanel( new FlowLayout() ); JButton test = new JButton( "TestGreen" ); test.setBackground( Color.GREEN ); newStatusBar.add( woohoo ); newStatusBar.add( oldStatusBar ); // Now we take advantage of the "insertAtStatusBarPosition" method, which places the component // we pass into the old status bar position. myView.insertAtStatusBarPosition( newStatusBar );
Export the report to a file
Once again, this is quite simple using the given "export" method, combined with the various export constants from the interface ReportView:
myView.export( ReportView.EXPORT_PDF, "C:/test.pdf" );
Cause the report to be re-rendered and refreshed
myView.refresh();
- Seit:
- 7.0
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen JPanel
JPanel.AccessibleJPanelVon Klasse geerbte verschachtelte Klassen/Schnittstellen JComponent
JComponent.AccessibleJComponentVon Klasse geerbte verschachtelte Klassen/Schnittstellen Container
Container.AccessibleAWTContainerVon Klasse geerbte verschachtelte Klassen/Schnittstellen Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Feldübersicht
Von Klasse geerbte Felder JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWVon Klasse geerbte Felder Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTVon Schnittstelle geerbte Felder ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHVon Schnittstelle geerbte Felder ReportView
CURRENT_PAGE, EXPORT_CSV, EXPORT_DATA, EXPORT_HTML, EXPORT_PDF, EXPORT_PS, EXPORT_PS2, EXPORT_PS3, EXPORT_RTF, EXPORT_SVG, EXPORT_TXT, EXPORT_XLS, EXPORT_XML, MAX_ZOOM_FACTOR, MIN_ZOOM_FACTOR, MODE_HAND, MODE_SNAPSHOT, MODE_TEXT, PROP_LOADING_STATUS, PROP_TIMESTAMP, STATUS_CANCELED, STATUS_FINISHED, STATUS_INITIALIZED, STATUS_LOADING, TOTAL_PAGE_COUNT, TOTAL_PAGE_COUNT_UNKNOWN, VIEW_DOUBLE_CONTINUOUS, VIEW_DOUBLE_PAGE, VIEW_IS_AT_END_OF_REPORT, VIEW_MODE, VIEW_SINGLE_CONTINUOUS, VIEW_SINGLE_PAGE, ZOOM_FACTOR, ZOOM_MANUAL, ZOOM_TO_FULLPAGE, ZOOM_TO_PAGEHEIGHT, ZOOM_TO_PAGEWIDTH -
Methodenübersicht
Modifikator und TypMethodeBeschreibungvoidcancel()This cancels the loading of the current report in case it is still loading.export()Exports the report connected to this report view.Exports the report connected to this report view into the given file.
Export formats creating multiple files, e.g.export(Properties exportProperties) Exports the report connected to this report view into the given file.
This method use the default value for all not specified properties.Removes the navigation view GUI component from the ReportView and returns it.Removes the status bar GUI component from the ReportView and returns it.intReturns which type of automatic zoom is used in the report view whenever the ReportView is displayed anew, for example after resizing the display.All public graphical components of the viewer must implement this method, which returns the actual AWT component so that it can be added to containers, etc.
For example, if you have a "ReportViewer" and would like to add it to your own JFrame, simply call:myFrame.add(viewer.getComponent())intReturns the number of the "current page" being displayed in this ReportView.getDefaultAttributeSet(int fromPage, int toPage) Creates and returns a HashPrintRequestAttributeSet for the given page(s) with the default printing attributes.intFetches the current "loading status" of this report view.intReturns the currently selected mode for mouse actions such as clicking and dragging in this ReportView.Returns this ReportView's NavigationView, that is, the element containing this ReportView's SearchView, GroupView and/or IndexView.Returns the RenderData object belonging to this ReportView.Returns the title of this report if it is known.Returns the parent ReportViewer for this component.Returns this ReportView's StatusBar, the element which can display messages or progress bars.intReturns the total number of pages this report has.intReturns which type of layout view this ReportView is to take.floatReturns 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.voidNavigates 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.voidgoToPage(int pageNumber) Causes the page indicated by the parameter pageNum to be displayed in this ReportView.booleanReturns whether or not this report view is set to show a group tree.booleanReturns whether this report view should allow drill downs on its groups if it has any.booleanReturns if at least one export format is enabled for this ReportView.booleanReturns 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).booleanReturns whether this report was suppressed because it has no rows.voidnextPage()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.voidprevPage()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.print(int fromPage, int toPage, boolean showPrintDialog) Prints the current report in the page range with or without any dialogs.print(int fromPage, int toPage, PrinterJob pjob) Prints the current report to a PrinterJob without any dialogs.print(PrinterJob printerJob, PrintRequestAttributeSet attributeSet) Creates a new PrinterJobProgress with the given attributes and start it.voidrefresh()Causes this ReportView to refresh its pages by re-fetching the report data - this causes a re-rendering of the report data.voidreload()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.voidreplaceNavigationView(Component component) Inserts the given component at the position of the navigation view.voidreplaceStatusBar(Component component) Inserts the given component at the position of the status bar.voidsetAutomaticZoomType(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).voidsetAutoRefresh(int millis) Sets the auto-refresh time for this report view.voidsetDrilldownEnabled(boolean enabled) Sets whether this report view should allow drill downs on its groups if it has any.voidsetHasGroupTree(boolean hasGroupTree) Sets this report view to whether or not it is to show a group tree.voidsetMouseActionMode(int hand) Sets the mode this ReportView is to be in for mouse actions such as clicking and dragging.voidsetPageLimitExceeded(boolean pageLimitExceeded) sets the "page limit exceeded" flag which determines whether the toolbar will display the total page count with a "+".voidsetViewMode(int i) Sets the type of view this ReportView is to take and causes this view to be displayed immediately.voidsetZoomFactor(float factor) Sets the zoom factor to this value.voidDisplays an error box showing the Throwable's error message.static booleanshowPrintDialog(Component parentComponent, PrinterJob printerJob, HashPrintRequestAttributeSet attributeSet) Shows the viewer print dialog.Von Klasse geerbte Methoden JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIVon Klasse geerbte Methoden JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateVon Klasse geerbte Methoden Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeVon Klasse geerbte Methoden Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methodendetails
-
showError
Displays an error box showing the Throwable's error message. If a ViewerException is thrown, the special messages and properties of the ViewerException are shown. Otherwise, only the getMessage() as well as the stack trace are shown.- Angegeben von:
showErrorin SchnittstelleReportView- Parameter:
th- Throwable to display in an error box. Best if this Throwable is a ViewerException.- Seit:
- 7.0
-
getStatusBar
Returns this ReportView's StatusBar, the element which can display messages or progress bars.- Angegeben von:
getStatusBarin SchnittstelleReportView- Gibt zurück:
- StatusBar belonging to this ReportView
- Seit:
- 7.0
-
extractStatusBar
Removes the status bar GUI component from the ReportView and returns it. If the status bar has already been extracted, nothing happens, and in this case this method is equivalent to getStatusBar().- Angegeben von:
extractStatusBarin SchnittstelleReportView- Gibt zurück:
- StatusBar of this ReportView
- Seit:
- 7.0
-
reload
public 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.- Angegeben von:
reloadin SchnittstelleReportView- Seit:
- 7.0
- Siehe auch:
-
refresh
public void refresh()Causes this ReportView to refresh its pages by re-fetching the report data - this causes a re-rendering of the report data. If "promptOnRefresh" is set, this will cause the prompts to be fetched again as well.- Angegeben von:
refreshin SchnittstelleReportView- Seit:
- 7.0
- Siehe auch:
-
cancel
public void cancel()This cancels the loading of the current report in case it is still loading. It will cancel the render process on the server as well. The effect is similar to the stop button of the load progress component. If the current loading status isReportView.STATUS_FINISHEDorReportView.STATUS_CANCELED, this method has no effect.- Angegeben von:
cancelin SchnittstelleReportView- Seit:
- 12.0
-
nextPage
public 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.- Angegeben von:
nextPagein SchnittstelleReportView- Seit:
- 7.0
-
prevPage
public 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.- Angegeben von:
prevPagein SchnittstelleReportView- Seit:
- 7.0
-
goToPage
public void goToPage(int pageNumber) Causes the page indicated by the parameter pageNum to be displayed in this ReportView. If this page does not exist in the report, calling this method will do nothing at all. Note this is an asynchronous call - the page will be displayed at some point, but it is not guaranteed that the page is actually visible as soon as this method returns.- Angegeben von:
goToPagein SchnittstelleReportView- Parameter:
pageNumber- Number of page (starting at 1) to be displayed in this ReportView.- Seit:
- 7.0
-
goToLastPage
public 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. Note this is an asynchronous call - the page will be displayed at some point, but it is not guaranteed that the page is actually visible as soon as this method returns.- Angegeben von:
goToLastPagein SchnittstelleReportView- Seit:
- 7.0
-
setViewMode
public void setViewMode(int i) Sets the type of view this ReportView is to take and causes this view to be displayed immediately. By default, possible values are: ReportView.SINGLE_PAGE - only one page is shown at a time. ReportView.SINGLE_CONTINUOUS - the report can be scrolled through in its entirety, with each page being shown above the next. ReportView.DOUBLE_PAGE - only two pages are shown at a time, next to each other. ReportView.DOUBLE_CONTINUOUS - the report can be scrolled through in its entirety, however showing the pages two by two.- Angegeben von:
setViewModein SchnittstelleReportView- Parameter:
i- Layout type to display in this ReportView.- Seit:
- 7.0
- Siehe auch:
-
getDefaultAttributeSet
Creates and returns a HashPrintRequestAttributeSet for the given page(s) with the default printing attributes. If the first page was not loaded then it will wait until the first page is available.- Angegeben von:
getDefaultAttributeSetin SchnittstelleReportView- Parameter:
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.- Gibt zurück:
- The list of printing attributes for the given pages.
- Seit:
- 7.0
- Siehe auch:
-
print
Prints the current report in the page range with or without any dialogs. If the first page was not loaded then it will wait until the first page is available.- Angegeben von:
printin SchnittstelleReportView- Parameter:
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- iftrue, a print dialog is showing.- Gibt zurück:
- PrinterJobProgress of the running printing job.
- Seit:
- 7.0
- Siehe auch:
-
print
Prints the current report to a PrinterJob without any dialogs. It uses the default PrintRequestAttributeSet of the view. If the first page was not loaded then it will wait until the first page is available.- Angegeben von:
printin SchnittstelleReportView- Parameter:
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.- Gibt zurück:
- PrinterJobProgress of the running printing job.
- Seit:
- 7.0
- Siehe auch:
-
print
Creates a new PrinterJobProgress with the given attributes and start it.- Angegeben von:
printin SchnittstelleReportView- Parameter:
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.- Gibt zurück:
- a PrinterJobProgress
- Siehe auch:
-
showPrintDialog
public static boolean showPrintDialog(Component parentComponent, PrinterJob printerJob, HashPrintRequestAttributeSet attributeSet) Shows the viewer print dialog. This dialog will modify the PrinterJob and the AttributeSet, depending on the user input. The viewer print dialog supports some additional features which are not in Java's cross platform print dialog.- Parameter:
parentComponent- a parent component, used for showing the dialog as a modal dialog. Can be null.printerJob- a PrinterJob with the selected PrintService. On output the PrintService is updated. This parameter may not be null.attributeSet- print attributes that are to be shown in the dialog. Once the dialog is closed, the contents are updated to reflect user choices. This parameter may not be null.- Gibt zurück:
- true if the user clicks "print" and false if the user cancels the dialog.
- Löst aus:
ViewerException- if no print services are available.- Seit:
- 8.0
- Siehe auch:
-
export
Exports the report connected to this report view. At first the export dialog will be displayed. If the user does not cancel the export in the dialog, the export progress will be started after the export dialog has been closed.- Angegeben von:
exportin SchnittstelleReportView- Gibt zurück:
- ExportProgress of running export
- Seit:
- 7.0
- Siehe auch:
-
export
Exports the report connected to this report view into the given file.
Export formats creating multiple files, e.g. HTML and SVG, creating a sub directory with the name of the first file. All files will be saved in that directory expecting the first file.
This method use the default value for all properties expecting the export format. To export a report into a file without preview in the Java viewer we recommend to use the Engine directly instead of using the Viewer API because the Java viewer have to request the first report page in the Java viewer format before it can request the report in the specified export format.- Angegeben von:
exportin SchnittstelleReportView- Parameter:
format- The export format in that the report will be exported.filename- Name of the file in that the report will be exported.- Gibt zurück:
- ExportProgress of running export
- Seit:
- 7.0
- Siehe auch:
-
export
Exports the report connected to this report view into the given file.
This method use the default value for all not specified properties. For a complete list of report URL properties see the documentation.
To export a report into a file without preview in the Java viewer we recommend to use the Engine directly instead of using the Viewer API because the Java viewer have to request the first report page in the Java viewer format before it can request the report in the specified export format.- Angegeben von:
exportin SchnittstelleReportView- Parameter:
exportProperties- Properties for the export, including format, file and other properties if they are available for the selected format.- Gibt zurück:
- ExportProgress of running export
- Seit:
- 7.0
- Siehe auch:
-
isExportEnabled
public boolean isExportEnabled()Returns if at least one export format is enabled for this ReportView.- Angegeben von:
isExportEnabledin SchnittstelleReportView- Gibt zurück:
- exportEnabled Export enabled for this report; true if at least one format is enabled, false otherwise
- Seit:
- 7.0
-
setMouseActionMode
public void setMouseActionMode(int hand) Sets the mode this ReportView is to be in for mouse actions such as clicking and dragging. By default, possible values are: ReportView.MODE_HAND - Click and drag causes a scrolling of the page along with the mouse movement. ReportView.MODE_TEXT - Click and drag causes a text selection, line by line. ReportView.MODE_SNAPSHOT - Click and drag causes an image snapshot within a box at release of the mouse button.- Angegeben von:
setMouseActionModein SchnittstelleReportView- Parameter:
hand- Mouse mode to be used in the ReportView.- Seit:
- 7.0
- Siehe auch:
-
hasGroupTree
public boolean hasGroupTree()Returns whether or not this report view is set to show a group tree. If it is false, the report view will not show any group tree. Note this says nothing about whether or not the report actually has groups or not.- Angegeben von:
hasGroupTreein SchnittstelleReportView- Gibt zurück:
- Whether this report view is to show a group tree or not if the report should have groups
- Seit:
- 7.0
-
setHasGroupTree
public void setHasGroupTree(boolean hasGroupTree) Sets this report view to whether or not it is to show a group tree. If this is false, the report view should not show any group tree, regardless of whether or not its report has groups.- Angegeben von:
setHasGroupTreein SchnittstelleReportView- Parameter:
hasGroupTree- Is this report view to show a group tree?- Seit:
- 7.0
- Siehe auch:
-
setZoomFactor
public void setZoomFactor(float factor) Sets the zoom factor to this value. Only values greater than 0 are allowed. This value is not a percentage value, that is, 2.0 is 2x view, 0.25 is 1/4 view, etc.
If the value is less than MIN_ZOOM_FACTOR, this has the same effect as calling setZoomFactor(MIN_ZOOM_FACTOR).
If the value is greater than MAX_ZOOM_FACTOR, this has the same effect as calling setZoomFactor(MAX_ZOOM_FACTOR).
If you want to zoom relative to the page's size, you shouldn't use this method but ratherReportView.setAutomaticZoomType(int)- Angegeben von:
setZoomFactorin SchnittstelleReportView- Parameter:
factor- Factor to zoom to - 1.0 as 100%, 2.0 as 200%, etc.- Seit:
- 7.0
- Siehe auch:
-
setAutomaticZoomType
public 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). By default, possible values are: ReportView.ZOOM_MANUAL - always use the set zoom factor (settable with setZoom(float factor)) ReportView.ZOOM_TO_PAGEWIDTH - always zoom in or out far enough to see the full width of a page. ReportView.ZOOM_TO_PAGEHEIGHT - always zoom in or out far enough to see the full height of a page. ReportView.ZOOM_TO_FULLPAGE - always zoom in or out far enough to see the full page - this is equivalent to ZOOM_TO_PAGEHEIGHT when the page is a portrait view, or to ZOOM_TO_PAGEWIDTH when the page is a landscape view.- Angegeben von:
setAutomaticZoomTypein SchnittstelleReportView- Parameter:
type- Zoom type to use when displaying the ReportView.- Seit:
- 7.0
- Siehe auch:
-
getZoomFactor
public 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.- Angegeben von:
getZoomFactorin SchnittstelleReportView- Gibt zurück:
- The zoom factor currently set for this ReportView.
- Seit:
- 7.0
-
getCurrentPage
public int getCurrentPage()Returns the number of the "current page" being displayed in this ReportView. If more than one PageView is visible, this returns the lowest page visible at this time. If no PageView is visible, this returns 0.- Angegeben von:
getCurrentPagein SchnittstelleReportView- Gibt zurück:
- Number of the first page currently visible in this ReportView, or 0 if no page is visible.
- Seit:
- 7.0
-
getTotalPages
public int getTotalPages()Returns the total number of pages this report has. If the total number of pages is as of yet unknown (for example if the report is still being rendered), this will return TOTAL_PAGE_COUNT_UNKNOWN.- Angegeben von:
getTotalPagesin SchnittstelleReportView- Gibt zurück:
- Total number of pages in the report, or TOTAL_PAGE_COUNT_UNKNOWN if still unknown.
- Seit:
- 7.0
- Siehe auch:
-
getComponent
All public graphical components of the viewer must implement this method, which returns the actual AWT component so that it can be added to containers, etc.
For example, if you have a "ReportViewer" and would like to add it to your own JFrame, simply call:myFrame.add(viewer.getComponent())- Angegeben von:
getComponentin SchnittstelleViewerComponent- Gibt zurück:
- Actual AWT component of this object.
- Seit:
- 7.0
-
replaceStatusBar
Inserts the given component at the position of the status bar. If a status bar component is already there (which is by default), the component is replaced by the given component. Note the status bar itself remains referenced (getStatusBar will return the same object even after calling this method), this method simply places adds a java.awt.Component in its place. If the given component is null, the status bar will simply be removed, equivalent to calling extractStatusBar.- Angegeben von:
replaceStatusBarin SchnittstelleReportView- Parameter:
component- Component to position at the status bar position, null if the status bar is simply to be removed.- Seit:
- 7.0
-
getViewMode
public int getViewMode()Returns which type of layout view this ReportView is to take. By default, possible values are: ReportView.SINGLE_PAGE - only one page is shown at a time. (This is the default setting) ReportView.SINGLE_CONTINUOUS - the report can be scrolled through in its entirety, with each page being shown above the next. ReportView.DOUBLE_PAGE - only two pages are shown at a time, next to each other. ReportView.DOUBLE_CONTINUOUS - the report can be scrolled through in its entirety, however showing the pages two by two.- Angegeben von:
getViewModein SchnittstelleReportView- Gibt zurück:
- Layout type used by this ReportView
- Seit:
- 7.0
- Siehe auch:
-
getAutomaticZoomType
public 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. By default, possible values are: ReportView.ZOOM_MANUAL - always use the set zoom factor (default setting. Zoom factor is settable with setZoom(float factor)) ReportView.ZOOM_TO_PAGEWIDTH - always zoom in or out far enough to see the full width of a page. ReportView.ZOOM_TO_PAGEHEIGHT - always zoom in or out far enough to see the full height of a page. ReportView.ZOOM_TO_FULLPAGE - always zoom in or out far enough to see the full page - this is equivalent to ZOOM_TO_PAGEHEIGHT when the page is a portrait view, or to ZOOM_TO_PAGEWIDTH when the page is a landscape view.- Angegeben von:
getAutomaticZoomTypein SchnittstelleReportView- Gibt zurück:
- Currently chosen automatic zoom type used by this ReportView
- Seit:
- 7.0
- Siehe auch:
-
getMouseActionMode
public int getMouseActionMode()Returns the currently selected mode for mouse actions such as clicking and dragging in this ReportView. By default, possible values are: ReportView.MODE_HAND - Click and drag causes a scrolling of the page along with the mouse movement. ReportView.MODE_TEXT - Click and drag causes a text selection, line by line. ReportView.MODE_SNAPSHOT - Click and drag causes an image snapshot within a box at release of the mouse button.- Angegeben von:
getMouseActionModein SchnittstelleReportView- Gibt zurück:
- The currently selected mode for mouse actions such as clicking and dragging within this ReportView
- Seit:
- 7.0
- Siehe auch:
-
getReportData
Returns the RenderData object belonging to this ReportView. The RenderData object is the source of report data for this ReportView. If this is null, the ReportView has no connection to a RenderData source and should be considered obsolete.- Angegeben von:
getReportDatain SchnittstelleReportView- Gibt zurück:
- The RenderData object belonging to this ReportView
- Seit:
- 7.0
-
getReportViewer
Returns the parent ReportViewer for this component.- Angegeben von:
getReportViewerin SchnittstelleReportView- Gibt zurück:
- the parent ReportViewer for this component
- Seit:
- 7.0
-
getReportTitle
Returns the title of this report if it is known. If not known, the title returned will be null.- Angegeben von:
getReportTitlein SchnittstelleReportView- Gibt zurück:
- The report title of this report if known. Will return null if not known
- Seit:
- 7.0
- Siehe auch:
-
getLoadingStatus
public int getLoadingStatus()Fetches the current "loading status" of this report view. By default, possible values are:- ReportView.STATUS_INITIALIZED - means the report view is loading for the first time, no pages have been loaded yet.
- ReportView.STATUS_LOADING - 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.
- ReportView.STATUS_FINISHED - means the report has been successfully loaded.
- ReportView.STATUS_CANCELED - means the loading has been canceled by the user.
- Angegeben von:
getLoadingStatusin SchnittstelleReportView- Gibt zurück:
- Current loading status of the report view.
- Seit:
- 7.0
- Siehe auch:
-
setAutoRefresh
public void setAutoRefresh(int millis) Sets the auto-refresh time for this report view. This will cause this view to be refreshed everymillismilliseconds. 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.- Angegeben von:
setAutoRefreshin SchnittstelleReportView- Parameter:
millis- number of milliseconds for auto-refresh cycle, 0 to turn off auto-refresh
-
isDrilldownEnabled
public boolean isDrilldownEnabled()Returns whether this report view should allow drill downs on its groups if it has any. If not, right clicking a group node will not offer "drill down" as an option. The default value for this is "true" unless set differently inReportView.setDrilldownEnabled(boolean)and/or as a ViewerSettings entry.- Angegeben von:
isDrilldownEnabledin SchnittstelleReportView- Gibt zurück:
- whether this report view should allow drill downs on its groups
-
setDrilldownEnabled
public void setDrilldownEnabled(boolean enabled) Sets whether this report view should allow drill downs on its groups if it has any. If not, right clicking a group node will not offer "drill down" as an option. The default value for this is "true" unless set differently as a ViewerSettings entry.- Angegeben von:
setDrilldownEnabledin SchnittstelleReportView- Parameter:
enabled- true if it is to be enabled
-
isPageLimitExceeded
public 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).- Angegeben von:
isPageLimitExceededin SchnittstelleReportView- Gibt zurück:
- whether this report view has more pages than the server page limit
-
setPageLimitExceeded
public void setPageLimitExceeded(boolean pageLimitExceeded) sets the "page limit exceeded" flag which determines whether the toolbar will display the total page count with a "+".- Parameter:
pageLimitExceeded- true if page limit was exceeded- Seit:
- 10.1
-
isReportSuppressed
public boolean isReportSuppressed()Returns whether this report was suppressed because it has no rows.- Angegeben von:
isReportSuppressedin SchnittstelleReportView- Gibt zurück:
- true, if no rows.
-