Index

JReport Client API

Introduction

JReport Client API is intended for users who want to compile the program by themselves, or integrate JReport Enterprise Viewer with their own java application.  JReport Enterprise Viewer and JReport Viewer Bean are all based on JReport Client API.  Just like JReport Enterprise Viewer, JReport Client API allows users to view reports in the server and set up scheduled tasks.

Installation

When you install JReport Enterprise Viewer, JReport Client API will be installed at the same time.  After installation, you should have the components <JREntViewer_Install_Dir>\lib\JREntViewer.zip.

Notes: Client API classes are stored in the archive files - JREntViewer.zip.  You need to set the CLASSPATH environment variable before you compile and run the program.  Append the following string to your CLASSPATH starting the client API:
<JREntViewer_Install_Dir>/lib/JREntViewer.zip;<JREntViewer_Install_Dir>/lib/log4j-1.2.8.jar

Packages

Client API mainly includes two packages: API package and GUI package.  The API package offers methods for compiling the program, getting some information and viewing result versions etc., the GUI package offers the interface to view the report. 

Package jet.client.api

This package includes the following classes:

Package jet.client.api.gui

This package includes the following interfaces and classes.

Interfaces

  • CatPanelListener
    This interface defines the listener for getting current path changes of a catalog panel.
  • DirPanelListener
    This interface defines the listener for getting the current path changes of a directory panel.
  • Classes

  • CatalogPanel
    Class CatalogPanel is a panel to browse catalogs in the report server.
  • CliOpenCatDlg
    Class CliOpenCatDlg is a dialog box to select a catalog in the report server.
  • CliOpenDirDlg
    Class CliOpenDirDlg is a dialog box to select a directory in the report server.
  • DirectoryPanel
    Class DirectoryPanel is a panel to browse directories in the report server.
  • JRClientGUI
    Class JRClientGUI represents a client of JReport enterprise server.  It provides methods to run reports, view result versions and create/edit schedules etc.
  • ScheduledDlg
    Class ScheduledDlg is a dialog box to create/edit a scheduled task.
  • TaskListHolder
    Class TaskListHolder is a holder that holds a panel of the scheduled tasks, active tasks or completed tasks.  With the class, you can refresh the task list or set a new report server for the task list.
  • ViewerThread
    Class ViewerThread is a thread to view a report result.  It brings up a report viewer (frame) when the thread starts.
  • Reference Notes: For more details about methods, refer to JREntViewer javadoc jet.client package which includes all the documents generated by Javadoc.   You can go to http://www.jinfonet.com/docs.htm for the manual related materials.

    Illustrative Examples for Using Client API

    After you have installed JReport Enterprise Viewer, you will find the illustrative demo programs under <installroot>\help\viewer-material.  Or you can find them at http://www.jinfonet.com/docs.htm with the manual related materials. 

    ReportBrowser.java - browse catalogs and their reports and view report results.
    ResultVersionView.java - view a result version
    ScheduleDialogs.java - create/edit scheduled tasks
    ScheduleDemo.java - create/edit schedule tasks without GUI
    TasksInfo.java - list scheduled tasks, active tasks and completed tasks
    RunTaskDemoToEMail.java - run a task immediately. And demonstrates how to run a "Publish To EMail" task.
    ViewerThreadDemo.java - about viewer thread
    ExportResult.java - export report results

    Below are two examples, with which we will explain how they work and how they use the methods provided with Client API.

    Example 1: ResultVersionView.java

    ResultVersionView.java is designed to view a result version and export to different formats.

    Example 2: ScheduleDemo.java

    This example is designed to submit a schedule without GUI to generate a report version  every hour from 9:00 to 17:00 daily.  Also, the version manager will keep each of the generated results for 30 days from the day they are generated.  

    Index