java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
quadbase.reportdesigner.PageViewer.swing.CApplet
quadbase.reportdesigner.PageViewer.swing.Viewer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public class Viewer extends quadbase.reportdesigner.PageViewer.swing.CApplet
The Viewer class is the entry point in using the Page Viewer to view a report. The Page Viewer provides the mechanism to view the report page by page, and in doing so, minimizes the amount of resources needed on the client application. The idea is that Espress Manager is being ran at some server and the client terminal simply requests to view a certain page of a report. This puts the client in a situation where it only need to worry about drawing and displaying the report on screen.
See Also:
  • Constructor Details

    • Viewer

      public Viewer()
      Allocates a new Viewer Object
  • Method Details

    • init

      public void init()
      internal use only
      Overrides:
      init in class Applet
    • main

      public static void main(String[] argv)
      This is the entry point of the Page Viewer application. Pass in a String array of one argument that contains a file name to a .page file to start the application viewing a certain page of a report.
      The .page file is what gets streamed by the Report Server to the Page Viewer. You may also use the export() method from QbReport to export specific pages of the report in .page format.
    • getComponent

      public static Component getComponent(Applet applet, String fileName, long bufferTimeInSec)
      Get the Page Viewer as a java.awt.Component.
      Parameters:
      applet - a handle to an applet for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      Returns:
      a Component representation of the Page Viewer.
    • getComponent

      public static Component getComponent(Frame frame, String fileName, long bufferTimeInSec)
      Get the Page Viewer as a java.awt.Component.
      Parameters:
      frame - a handle to a frame for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      Returns:
      a Component representation of the Page Viewer.
    • getComponent

      public static Component getComponent(Applet applet, String fileName, long bufferTimeInSec, String securityLevel)
      Get the Page Viewer as a java.awt.Component.
      Parameters:
      applet - a handle to an applet for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      securityLevel - the name of a security level to use for this Page Viewer. The security level name must already exist and set up in the report.
      Returns:
      a Component representation of the Page Viewer.
    • getComponent

      public static Component getComponent(Frame frame, String fileName, long bufferTimeInSec, String securityLevel)
      Get the Page Viewer as a java.awt.Component.
      Parameters:
      frame - a handle to a frame for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      securityLevel - the name of a security level to use for this Page Viewer. The security level name must already exist and set up in the report.
      Returns:
      a Component representation of the Page Viewer.
    • getReportCanvas

      public ReportCanvas getReportCanvas()
      Gets the ReportCanvas object associated with this viewer
    • getReportCanvas

      public static ReportCanvas getReportCanvas(Applet applet, String fileName, long bufferTimeInSec)
      Get the Page Viewer as ReportCanvas.
      Parameters:
      applet - a handle to an applet for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      Returns:
      a ReportCanvas representation of the Page Viewer.
    • getReportCanvas

      public static ReportCanvas getReportCanvas(Frame frame, String fileName, long bufferTimeInSec)
      Get the Page Viewer as ReportCanvas.
      Parameters:
      frame - a handle to a frame for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      Returns:
      a ReportCanvas representation of the Page Viewer.
    • getReportCanvas

      public static ReportCanvas getReportCanvas(Applet applet, String fileName, long bufferTimeInSec, String securityLevel)
      Get the Page Viewer as ReportCanvas.
      Parameters:
      applet - a handle to an applet for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      securityLevel - the name of a security level to use for this Page Viewer. The security level name must already exist and set up in the report.
      Returns:
      a ReportCanvas representation of the Page Viewer.
    • getReportCanvas

      public static ReportCanvas getReportCanvas(Frame frame, String fileName, long bufferTimeInSec, String securityLevel)
      Get the Page Viewer as ReportCanvas.
      Parameters:
      frame - a handle to a frame for viewing, if applicable. Otherwise, use null.
      fileName - name of report file to get pages from.
      bufferTimeInSec - this controls how often to get new pages from the Espress Manager. It looks at the local version of the .page file (if available), and if the time since it is last updated exceeds the bufferTimeInSec parameter, then new version of the page is requested again from Espress Manager. Otherwise it uses the local version of the .page file. If the local version of the .page file does not exist, it gets the page from the Espress Manager.
      securityLevel - the name of a security level to use for this Page Viewer. The security level name must already exist and set up in the report.
      Returns:
      a ReportCanvas representation of the Page Viewer.
    • setServletRunner

      public static void setServletRunner(String comm_url)
      Set servlet runner hostname and port number Note: this static method MUST be called before any QbChart constructor
      Parameters:
      comm_url - servlet runner hostname and port number
    • useServlet

      public static void useServlet(boolean b)
      Determines whether to use SOCKET or HTTP or SERVLET for chart server connection Note that this static method MUST be called before any QbChart constructor.
      Parameters:
      b - If true use SERVLET connection, otherwise use other connection The default value is false.
    • setServletContext

      public static void setServletContext(String context)
      Sets the servlet context for EspressManager servlet
      Parameters:
      context - the servlet context
    • getServletContext

      public static String getServletContext()
      Gets the servlet context for EspressManager servlet
      Returns:
      context the servlet context
    • setMenuVisible

      public void setMenuVisible(boolean b)
      Sets the visibility of the Menu.
    • setSectionMenuVisible

      public void setSectionMenuVisible(boolean b)
      Sets the visibility of the Section Menu.
    • setSectionMenuItemVisible

      public void setSectionMenuItemVisible(String[] menuItem, boolean b)
      Sets the visibility of some particular menu item(s).
    • setPageMenuVisible

      public void setPageMenuVisible(boolean b)
      Sets the visibility of the Page Menu.
    • setPageMenuItemVisible

      public void setPageMenuItemVisible(String[] menuItem, boolean b)
      Sets the visibility of some particular menuitem(s) on the page Menu.
    • setOutputMenuVisible

      public void setOutputMenuVisible(boolean b)
      Sets the visibility of the Output Menu.
    • setOutputMenuItemVisible

      public void setOutputMenuItemVisible(String[] menuItem, boolean b)
      Sets the visibility of some particular menu item(s) on the Output Menu.
    • setBackMenuItemVisible

      public void setBackMenuItemVisible(boolean b)
      Sets the visibility of the Back Menu Item.
    • setRefreshMenuItemVisible

      public void setRefreshMenuItemVisible(boolean b)
      Sets the visibility of the Refresh Menu Item.
    • setGoToMenuItemVisible

      public void setGoToMenuItemVisible(boolean b)
      Sets the visibility of the Go To Menu Item.
    • setSortMenuVisible

      public void setSortMenuVisible(boolean b)
      Sets the visibility of the Sort Menu.
    • setMultiDrillDownVisible

      public void setMultiDrillDownVisible(boolean b)
      Sets the visibility of Multi Drill Down.
    • setToolBarMenuVisible

      public void setToolBarMenuVisible(boolean b)
      sets the display status of toolbar menu item in popup menu
    • setExportServlet

      public void setExportServlet(String url)
      Sets the url to the ViewerExportServlet, which is used for exporting to a servlet that streams back content to the client via a browser url
      Parameters:
      url - the url to the servlet, for example: "http://localhost:8080/servlet/ViewerExportServlet"
    • setDynamicExport

      public void setDynamicExport(boolean state, String serverName, int serverPort, String servletDirectory)