0% found this document useful (0 votes)
2K views1,566 pages

JReport Server User's Guide

JReport server is a 100% Java report generation and management tool. It can be deployed to any Java EE application server. This guide is written for report administrators or system administrators of Java application that embed JReport reports into their application.

Uploaded by

Christian Romero
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views1,566 pages

JReport Server User's Guide

JReport server is a 100% Java report generation and management tool. It can be deployed to any Java EE application server. This guide is written for report administrators or system administrators of Java application that embed JReport reports into their application.

Uploaded by

Christian Romero
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Welcome to the JReport Server User's Guide

This User's Guide describes JReport Server. JReport Server is a 100% Java report generation and management tool that can be deployed to any Java EE application server. By leveraging its high performance report generation engine, JReport scales to meet the most demanding requirements. Using the report scheduling, distributing and alerting capabilities of the JReport Server, reporting can be integrated into the workflow of the application. This guide is written for report administrators or system administrators of Java application that embed JReport reports into their application.

Other JReport documentation


This guide is one in the complete JReport documentation set. The documentation set includes the following:
q

Getting Started with JReport JReport Tutorial JReport Designer User's Guide JReport Desktop Viewer User's Guide JReport Server Monitor User's Guide Server API Javadoc Designer and Catalog API Javadoc

What's New in This Release


This document introduces the new features and significant enhancements of JReport in this release.

JReport Server Live


Improved Usability via a simpler interface and more tools that enhance productivity
q

Simplified Installation of Server Cluster: Server cluster can now be configured using properties files or via a browser UI in the Cluster > Configuration panel of the JReport Administration page. Enhanced User Interface is better organized for more intuitive use
r

Component titles for web reports are now customizable directly at runtime Added option to show or hide the catalog and report file extensions displayed on the JReport Console and JReport Administration pages Consistent concept between Page Reports and Web Reports: Reports in Report Set have been replaced with a more intuitive Report Sheets in Page Report Format enhancement such as TTF with Bold/Italic support

Extended End User Reporting Capabilities at runtime allow actions such as filtering, sorting and others to be saved along with the report, and then re-run, scheduled or exported with it Enhanced Data Source
r

Support Web Services (both WSDL 1.1 and 2.0) as data sources XML data source with Target Namespace support

JReport Designer
q

Enhanced Chart
r

Additional chart properties including constant values and average values can be displayed graphically as an average line or a constant line Control whether or not to show the nodes at the highest or lowest point in each chart line with a defined color Control the position on X axis to show the data points and labels Pattern support on multiple lines as well as line nodes Customizable legend marks

Support for Google Maps Component helps users to visualize their data by combining it with geographic information More Robust, User Friendly Parameter Features

End users can now specify cascading values to sort data in an ascending or descending order, or by using other fields as the cascading group Special characters can now be interpreted literally by JReport to replace the special characters with another string according to your database requirements JReport now permits the Special Field "UserName" to query data sources such as Imported SQLs, stored procedures, and user defined data sources in addition to JDBC connections, controlling data security easily via different server logins

JDashboard (Beta)
JDashboard provides enhanced information delivery to end users via rich visual components such as charts, maps, tables and web controls with a robust set of interactions. In no time your business questions can be answered directly, and results can be shared instantly with other key players across the organization.
r

Rich Internet Application (RIA)


s

Running components in Flash in addition to AJAX for a superior visualization experience Easy-to-use tools for developing rich, interactive applications Support most commonly used components such as Charts, Tables, Crosstabs, Sliders, Filter controls and etc.

User Friendly Dashboard Design


s

Predefined JReport library components enable end users to create a dashboard by only a few clicks and drag-and-drop Precise and pixel perfect layout with snap-to-grid option plus drag-and-drop operations for users to easily create and organize the dashboards

Intuitive Interactions
s

One click for drilling down to detail On-screen filter, slider control for easier range filtering Linked report, runtime summary creation, etc

Auto-synchronous Components: JDashboard provides the mechanism for multiple components to instantly reflect a data change in one component and update all other components to keep information consistent Component Library: The Component Library can be customized to provide predefined complex components including 40+ chart types, tables, crosstabs, and web controls for users to use Open Architecture: API connectivity to 3rd party gadgets and widgets like Google Maps

Resolved/Known Issues in This Release


This document describes the resolved issues and any known issues for JReport Server in this release.

Resolved issues
Item 1 Case # 57991 Issue When JReport Server is running on a Linux system, the file [Link] now can be created automatically in <install_root>\realm\defaultRealm\<user name> after user checks Enable Saving Parameter Values, sets Maximum Number of Auto Complete Parameters List on JReport Administration page and then runs a report with parameters using the saved values. Resolved the [Link] error when user runs a report using multivalue parameters with the option 'All' selected in the Enter Values dialog and then exports the report to Excel format. Now user can go to My Tasks > New Schedule to create a schedule successfully if he has been granted the corresponding schedule permission. Continue to support showing the status message for exporting reports. Reports using user's UDS data can now run completely on JReport Server. Adding labels to a web chart report is now supported in JReport Server 10.1 version. The European numerical format can now take effect on user's web reports after he sets -[Link] and -[Link] into his start up script files of JReport Server. Display chart labels in web reports. The Clear icon on the filter component can now work normally on DHTML reports running with IE browser. Now when user exports a report to Excel using JRClient, the summary cell can be adjusted automatically in the result file. JReport now works well in deleting contents under temp folder when shutting down JReport Server. JReport no longer mistakenly creates cache for each of user's dataset instances when the parameter's Allow Multiple Values property is set to true in JReport Designer. Users can insert, delete, or edit parameter form control now. Now when user selects or enters a new date parameter to a web report and then submits the parameter form control, the start date parameter is rendered as a text field with a calendar selector icon. Resolved the node displaying error when user tries to schedule a report using My Tasks > New Schedule. The e-mail address can now be displayed and modified normally after user schedules a report with an e-mail address that contains special characters such as single quote. The date parameter value are displayed normally in web reports if user sets the parameter option Use Current Date-Time When Blank to true in JReport Designer. Resolved the OutOfMemoryError when user tries to publish a zip file containing large catalog files using the option Publish to Remote Server on the JReport Console page. The NLS settings on user's main report can now be transferred to link report and detail report successfully. Resolved the [Link] error when user does go-to actions in a DHTML report.

58195

3 4 5 6 7

58444 58554 58761 58783 58901

8 9 10 11 12 13 14

58932 59104 59172 59231 59388 59418 59429

15 16 17 18 19 20

59430 59446 59454 59457 59511 59772

21 22

59785 60076

Resolved the OutOfMemoryError when user runs a report on JReport Server. When exporting reports to DHTML, charts are rendered in the PNG format instead of JPEG format.

Known issues
Compiling formulas in JReport under JDK 6 or higher gets warnings Since generic type is introduced to JDK 6 or higher version, when compiling formulas in JReport under JDK 6 or higher, you may come across warning messages as follows:
q

Note: [Link] uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

You may see that the situations are logged as Javac errors. However, the warning messages do not prevent Javac from creating .class files and reports can still run correctly. In this case, you can simply ignore the messages and logged errors. TOC Browser tree doesn't work well for reports with cached report bursting When end user runs a report which has been defined with some cached report bursting policy in JReport Viewer, if he opens the TOC Browser, he will be displayed with all the groups the report has instead of the ones he is supposed to view. In addition, no matter a group is allowed for him or not, he cannot click the group name from the TOC tree to get corresponding details. JReport will further enhance the cached report bursting feature in future release to resolve this issue. Report data get cut off in PDF result When you export a report to PDF format, if the report contains a large amount of data but its page mode was specified to be continuous page mode when it was designed in JReport Designer, or its page size was set to be larger than 200 inches, you will find that in the PDF result some data of the report are cut off. This is because in one PDF page, the data displayed can no larger than 200 inches. Derby cannot auto start in cross-computer integration By default, JReport Server uses the embedded Derby as the system database, and automatically starts the Derby database server (the start of Derby requires the JDK path). If you build a WAR/EAR on computer A and then integrate it into an application server on computer B, it is probable that the Derby database server cannot auto start using the JDK path on computer A. If you want to use Derby in an integration environment, you should update [Link] when building the WAR/EAR, and remove the following line from [Link]: <auto-start-derbyservice>true</auto-start-derbyservice> Then JReport will not try to auto start the embedded Derby server, and you need to start it by yourself. Derby can be started and stopped by using the batch files in <install_root>/derby/bin. There you will find [Link]/sh and [Link]/sh. No entry for relogin after logging out with Google Chrome After logging out of JReport Console page with Chrome, there is no entry prompted for the login again. If you would like the relogin entry to be shown, you can set [Link].use_new_realm_name=true in [Link] in the <install_root>\bin directory.

API change
[Link] has been set to private now. You can use getDisplayValue(DbValue paramvalue, [Link] locale) instead. For example: ParamDesc desc = new ParamDesc(); ... ... [Link]([Link](), [Link]());

JReport Product Overview


JReport is a complete Java reporting solution that provides sophisticated enterprise reporting, ad hoc reporting, and data analysis. A 100% Java EE architecture and a rich set of APIs allow JReport to be seamlessly embedded into any application, providing end users with a transparent interface to easily generate reports, share information, and analyze data. With JReport, any report can be made interactive, extending the "life" of a report by allowing users to easily sort, group, navigate, and filter via the Web. This wide range of functionality, including the ability to drill down on data, enables users to quickly derive value from their business intelligence. This chapter describes the JReport product in the following sections:
q

Features of JReport JReport product architecture Reporting a problem or requesting a feature Visiting our web pages for more information

Features of JReport
JReport Designer supports report development. It provides the following key features:
q

Interactive IDE Sophisticated report design Precise, flexible layout Reusable report objects Access any data source

JReport Server supports report generation and management. It has the following key features:
q

High performance engine Scale to any workload Seamless integration SDK Pure Java EE deployment Scheduling, distribution, alerting & versioning

JReport Web supports information delivery. It has the following key features:
q

Interactive DHTML technology Dynamic sort, filter, drill, pivot, convert Ad hoc reporting Taglib to customize JSPs Flexible output formats: PDF, Excel, XML, RTF, e-mail and more

JReport product architecture


The JReport solution spans a 3-tier architecture.

JReport Designer is a Swing-based Integrated Development Environment (IDE) that enables sophisticated report design and presentation of critical business data. It provides an intuitive interface, reusable report components, flexible layout, and a toolset for designing and testing reports. With JReport Designer, you can build reports using simple drag and drop techniques or by using the Report Wizard. Data can be accessed from any data source to design and preview reports in order to deliver information to end users in the most relevant and intuitive manner. Rapid creation and modification of report templates is accomplished by toggling between design mode and view mode where the report will be displayed with the actual dataset. Once report design is complete, the template is published to the JReport Server for generation, delivery, and management. JReport Server is a 100% Java report generation and management tool. It enables efficient management, sharing, scheduling, versioning, and delivery of reports and enables reporting to be integrated into the workflow of any Java application. The high-performance engine can scale to any workload. Report results can be saved to a versioning system, sent to enterprise/workgroup printers, or e-mailed. With JReport, reports can be viewed in any modern enterprise format including DHTML, HTML and standard business documents, such as PDF, Excel, and RTF. JDashboard delivers information using a user portal user interface rather than a report. Users can freely choose the objects they want to display in the dashboard, without having to know how these objects were created, what data sources to use, what styles to set, etc. A dashboard can hold multiple data components so that when browsing the dashboard users are able to see multiple data aspects. Within a dashboard, data components are able to communicate with each other via the message mechanism. This allows actions such as common filters to be applied to all the components of a dashboard even when coming from different data sources. JReport Viewer and JReport Studio enable reports to be accessed through a web browser via Dynamic HTML, or AJAX. With JReport Viewer and JReport Studio, reports can be modified using dynamic filter, sort, and drill capabilities. Using JReport Viewer and JReport Studio's advanced capabilities, users can drag and drop columns to and from an existing report, dynamically change chart types, pivot crosstabs, add groups, convert report components or create an entirely new report. JReport SDK - All JReport functionality can be accessed through Java APIs using JSP pages, servlets, or standalone applications.

Reporting a problem or requesting a feature


If you are having trouble running JReport Server or encounter any problems during reporting, take the following steps. 1. Check whether the system on which JReport Server is running meets the system requirements. 2. Check the JReport FAQ pages for frequently-asked questions and their solutions. If the problem persists, report it to Jinfonet Support (support@[Link]) with the following information: 1. Describe the precise steps leading to the problem. 2. Run the batch file [Link] in the <install_root>\bin subdirectory. Running this batch file will generate a file called [Link] in the current directory. Send this file to Jinfonet Support. Also, describe the operating environment, including machine type, CPU, memory, OS, and Java version. 3. If you are running JReport in an integrated Java application server, click the Server Information button on the JReport Administration page to list the environment.

4. Send Jinfonet Support the log file with the recorded JReport Server problems.
r

For a standalone server Start JReport with the batch file [Link] (.sh on Unix). Running this batch file will record the most detailed logging information and write them to the log files in the <install_root> \logs directory. Try to reproduce the problem, and send the log files along with the other information. For an integrated JReport Server If your JReport Server runs as a servlet inside a Java application server, send the log files generated by the JReport Engine in the application server. When the JReport Servlet is installed, a property file is generated which is used to define the class and arguments of the JRServlet. For example, if you integrated JReport Server into WebLogic, find the WebLogic properties file located in the installation path of WebLogic. Edit the file to use the option -vDebug -vError. Your file should then contain the following content: vError=true vDebug=true In addition, you can also directly add the java option -Dlogall=true (or -DvError=true, DvDebug=true) to the java command line within the launch file of the application server. After restarting your application server, reproduce the problem and send the log files to Support.

5. Send Support the log files recording all of the logging information of engine and server (including event, error, debugging, access, management, and performance).
r

Change the configuration to record all logging events by starting the server and accessing the JReport Administration page through [Link] a. Go to the Configuration > Log panel.

b. Set the trace level of all logs to TRIVIAL, and set the error level of all logs to WARN. c. After that, reproduce your problem and send Support the log files in <install_root> \logs. In addition, you can also directly modify the logging configuration file LogConfig. properties in <install_root>\bin. If you set the server property [Link] to true (all server properties are managed within the file [Link] in <install_root> \bin), any changes to the configuration file will automatically take effect at runtime after the specified update interval (set by the server property [Link]).
r

If your JReport Server runs as a servlet within a Java application server, in the address bar of a web browser, type in [Link] where jreport is the servlet context path.

6. To reproduce your problem of running reports with JReport Server, we will often need your report, catalog and data information. a. Send Support the catalog file (*.cat and *.fml) and the report file *.cls that you are having problems with. b. In order to resolve technical issues that you have reported, we will need to access your report data so that we can recreate and analyze the problem. Your database may be very large. However, we will only require access to the data returned by the query of the troublesome report, and if necessary we will sign a confidentiality agreement with you. To extract the report data, in the Catalog Browser of JReport Designer, right-click the query that your report is using, select the menu item Create Cached Query Result. Then, input the data file name and click the Save button. The query result will then be saved in this file. Send Support all of the files generated (including the description file).

Visiting our web pages for more information


q

Products information [Link] Release information [Link] News center [Link] Demo center [Link] Products download center [Link] White papers [Link] JReport product documentation [Link] JReport Javadoc [Link] JReport technical support center [Link]

Installing and Uninstalling


This chapter presents how to install JReport Server using a variety of different methods. It covers issues associated with installing, removing and solving problems encountered during installation.
q

System requirements JReport licenses Supported databases Installing using the Installation Wizard Installing silently Installing using the console interface Installing on Unix manually Uninstalling Solving installation problems JReport Server reporthome directory overview

System requirements
The following table displays the basic system requirements for installing JReport Server. Check your system to make sure that all the requirements are met before installation.
JReport Server System Requirements Recommended Requirements Minimum Requirements OS: CPU: Memory: Disk: JDK: Windows, Unix, Linux, z/Linux Intel Dual Core Xeon 2.8GHz 3 GB 1 GB free 6 or above Windows, Unix, Linux, z/Linux Intel P4 Xeon 3.0GHz 2 GB 1 GB free 6 or above

Client Requirements Recommended Internet Explorer 6, Firefox 3, Google Chrome 5, and higher versions.

You can download a JDK version at [Link] Notes:


q

Jinfonet supports Java VMs released by Sun and IBM to run with JReport Server. You can try using other Java VMs, but their compatibility cannot be guaranteed. Reports of any problems you find with other Java VMs are welcome. If you want to use JReport Server on a z/Linux system, you must download the JDK specially used for IBM from [Link] and the version should be at least V6.

JReport licenses
JReport Server has 3 add-on licenses which can be added in addition to the JReport Server license. These licenses enable some specific features in JReport: JReport Live license, JReport Server cluster license, and JDashboard license. Contact your Jinfonet Software account manager to obtain your required license.

JReport Live license


The JReport Live license enables the use of web reports and ad hoc page reports and all their related functions. JReport Designer and JReport Server have separate live licenses. Live license for JReport Designer A JReport Live license for JReport Designer controls the data sources for ad hoc page reports and web reports and the creation of web reports from those data sources on JReport Designer. The Live license allows you to utilize the following features on JReport Designer:
q

Create and edit report cubes, business cubes, and business views. These are meta-data descriptions created in JReport Designer to be used as data sources for ad hoc page reports and web reports. They can be created on any type of data source such as JDBC, ODBC, XML and Web Services. Create web reports from business views. Export and print web reports. The following functions also require that JReport Server has a Live license:
r

Preview web reports in JReport Studio. Publish web reports to JReport Server. Download reports which use business views, report cubes or business cubes as the data source from JReport Server.

Live license for JReport Server A JReport Live license for JReport Server controls the real time ad hoc and analysis reporting on JReport Server. The Live license allows you to utilize all of the following features and functions on JReport Server:
q

Create, view, run, edit, export, print, and publish ad hoc page reports and web reports. The data sources for these reports are created in JReport Designer, which requires JReport Designer has a Live license. All actions in JReport Viewer (the browser for opening a DHTML format page report) involving report cube/business cube or changes of report template:
r

Create new page reports or page report tabs Delete report tabs from a page report Add components and data fields into reports

Remove components from reports Move and resize components Edit component properties Drill Change chart type Rotate tables and crosstabs Convert between crosstab and chart Create query filters Display the Resource View panel which shows the data resources for the current open report tab

JReport Server cluster license


JReport Server cluster license enables a group of JReport Servers to work together with shared resources, load balancing, and failover in a distributed cluster.

JDashboard license
A JDashboard license enables the use of JDashboard and all related functions. JReport Designer and JReport Server have separate JDashboard licenses. Since JDashboard requires using business views as data sources, the JReport Live license is also required. JReport Designer and Server have separate Live licenses too. JDashboard license for JReport Designer A JDashboard license for JReport Designer allows for creation of library components which are used to build dashboards and publishing of library components to JReport Server. JDashboard license for JReport Server A JDashboard license for JReport Server enables the management of library components in the component library, the creation of dashboards using library components, and the use of dashboards.

Supported databases
JReport supports all of the current mainstream databases as well as most databases which support ODBC or JDBC drivers. The following table lists the databases and JDBC drivers that have been tested with JReport. If you are using any of the databases listed below, you are recommended to use the corresponding driver version with JReport although any driver which the DBMS supplier recommends is also fine. Also, if you encounter problems when using a database or driver version that is not listed here, you can contact Jinfonet Support (support@[Link]) for help.
Database MS SQL Server MS SQL Server MS SQL Server MS SQL Server Oracle Version 2005 Driver File Name [Link] JDBC Driver [Link]. [Link]. SQLServerDriver [Link]. sqlserver. SQLServerDriver Example URL jdbc:sqlserver://<host>:1433;user=sa; password=1234;database=test jdbc:microsoft:sqlserver://<host>:1433

2000

[Link]; msutil. jar; [Link] [Link] [Link] JDK1.2&1.3: [Link]; JDK1.4: [Link] JDK1.2&1.3: [Link]; JDK1.4: [Link] [Link]

2000 2000 9i

[Link] jdbc:inetdae7:<host>:1433? database=test [Link]. [Link] [Link]. OracleDriver [Link]. OracleDriver [Link]. OracleDriver jdbc:jtds:sqlserver://<host>:1433/test jdbc:oracle:thin:@<host>:1521:ora9i

Oracle

[Link].0 (10g) [Link].0 (11g) 8.1 8.1 8.2

jdbc:oracle:thin:@<host>:1521:ora9i

Oracle DB2 DB2 DB2

jdbc:oracle:thin:@<host>:1521:ora11g j[Link]//<host>/test

[Link]; [Link] [Link]. DB2Driver [Link] [Link]; db2jcc_license_cu.jar (Linux, Unix and Windows); db2jcc_license_cisuz. jar (Linux, Unixand Windows, z/OS, OS/390,z/OS, iSeries etc) [Link] [Link]

[Link]. j[Link]test DB2Driver [Link]. DB2Driver j[Link]//<host>:50000/test

DB2 RedBrick warehouse Informix

8.2

[Link]. j[Link]test DB2Driver [Link]. RBWDriver [Link]. IfxDriver [Link] jdbc:rbw:protocol:<host>:5050/test/ jdbc:informix-sqli://<host>:1526/ stores_demo:informixserver=DBSC jdbc:postgresql://<host>:5432/test jdbc:mysql://<host>:3306/test

9.30

[Link] postgresql-8.0-310. [Link]

PostGre SQL 8.0 MySql mysql5.0.18win32

mysql-connector-java- [Link] [Link]

MySql

mysql 4

mysql-connector-java- [Link] 3.0.14-production-bin. jar

jdbc:mysql://<host>:3306/test

MySql

mysqlmysql-connector-java- [Link] 5.0.2-alpha- [Link] win mysql4.1.12win32 mysql 5 mysql-connector-java- [Link] [Link] mysql-connector-java- [Link] [Link] [Link] 12.5 12.5 [Link] [Link] postgresql-8.0-310. [Link] [Link] [Link] [Link]

jdbc:mysql://<host>:3306/test

MySql

jdbc:mysql://<host>:3306/test

MySql HSQL Sybase Sybase

jdbc:mysql://<host>:3306/test jdbc:hsql[Link]\JReport\Demo\db \SampleDB

[Link]. jdbc:sybase:Tds:<host>:5000/master SybDriver [Link]. jdbc:sybase:Tds:<host>:5000/master SybDriver [Link] [Link]. CacheDriver jdbc:postgresql://<host>:5432/test jdbc:Cache://<host>:1972/samples

PostGre SQL 8.0 Cache Derby Cache 4 [Link]

[Link]. jdbc:derby:D:\derby\demo\databases EmbeddedDriver \toursdb

Note: If you want to use the DB2 app connection, you need to install the client and configure the net address first.

Installing using the Installation Wizard


Installing JReport Server with the Installation Wizard is intuitive. You only need to follow the screens and enter the required information. The Installation Wizard provides two installation types:
q

Typical Installation for Standalone Server Installs JReport Server with the default configuration settings. Custom Installation for Standalone Server Installs JReport Server in a standalone environment. If you choose this installation type, you can configure the server in the Installation Wizard.

This document shows you how to install the server to different systems with the Installation Wizard and configure the server according to your requirements.

Installing on Windows
To install JReport Server on a Windows platform, take the following steps: 1. Download the JReport Server installation file for Windows [Link] from the Jinfonet download center: [Link] 2. Run [Link] and follow the prompts to install. During installation, pay attention to the following:
q

The installer requires that you choose a Java JDK to complete the installation. You can download the appropriate JDK from [Link] or your computer vendors web site. The Installation Wizard will first find a JVM to get started. If no JVM is found, the JReport installer will fail to launch. To solve this issue, you can try either way:
r

Set JAVA_HOME in system environment. Install JReport Server from a DOS command by specifying the LAX_VM option for the Installation Wizard as follows: [Link] LAX_VM "C:\jdk1.6.0_17\bin\[Link]" The JDK path should use absolute path and be quoted by "".

The installer provides a chance for you to add additional class paths. You can also choose to add them manually into the [Link] in <install_root>\bin after installation. If you select to install JReport Server in a folder that already contains an existing copy, the installer will replace the packages and create new batch/script files. Meanwhile, a copy of the old batch/script files will be kept for your reference. You should use the batch/script files that come with the installer in order to make sure that all new packages are added to the class path and manually merge any changes you made into the new version.

Installing on Unix

JReport Server supports Solaris, Linux, HP-Unix, and AIX. In the following process, an X server is running and Java 1.5 or above is available, otherwise ask your administrator for help. Installing and running JReport Server requires that an X server has been configured. 1. Download the JReport Server installation file for Unix [Link] from the Jinfonet download center: [Link] If you need to transfer the installation file from your download machine to your Unix box, you should transfer it using FTP in binary mode. 2. Click the executable file [Link] to launch the Installation Wizard. Alternatively, you can open a console window, and change the directory to the location of the [Link] file. Following are examples of the commands that can be used: $ cd /opt/JReport/Server (or your preferred install location) To make [Link] executable, type the command: $ chmod +x [Link] Run [Link]: $ ./[Link] The Installation Wizard will first locate a JVM to get started. If no JVM is found, the installer will fail to launch. To solve this issue, you can try either way:
r

Set JAVA_HOME in system environment. Specify a JVM for Installation Wizard with the option LAX_VM as follows: $ ./[Link] LAX_VM "/opt/jdk1.6.0_17/bin/java" The JDK path should use absolute path and be quoted by "".

3. Once the Installation Wizard has successfully loaded, you can follow the standard prompts to install JReport Server.

Installing on z/Linux
JReport Server supports Linux on IBM system z. In the following process, an X server is running and a JDK specially used for IBM is available, otherwise ask your administrator for help. Installing and running JReport Server requires that an X server has been configured. 1. Download the JReport Server installation file for z/Linux [Link] from the Jinfonet download center: [Link] If you need to transfer the installation file from your download machine to your z/Linux box, you should transfer it using FTP in binary mode. 2. Click the executable file [Link] to launch the Installation Wizard. Alternatively, you can open a console window, and change the directory to the location of the [Link] file. Following are examples of the commands that can be used: $ cd /opt/JReport/Server (or your preferred install location) To make [Link] executable, type the command: $ chmod +x [Link] Run [Link]:

$ ./[Link] The Installation Wizard will first locate a JVM to get started. If no JVM is found, the installer will fail to launch. To solve this issue, you can try either way:
r

Set JAVA_HOME in system environment. Specify a JVM for Installation Wizard with the option LAX_VM as follows: $ ./[Link] LAX_VM "/opt/ibm-java2-sdk-6.0/bin/java" The JDK path should use absolute path and be quoted by "".

3. Once the Installation Wizard has successfully loaded, you can follow the standard prompts to install JReport Server.

Configuring the server


When installing JReport Server using the Installation Wizard, if you choose Custom Installation for Standalone Server, you can configure the server according to your requirements during the installation. You can configure the following items:
q

Service Cluster E-mail Cache


r

Cache Loaded Catalogs Specifies whether to keep a catalog in memory, or to remove it from memory after a report is completed. Normally, after a report has been generated, the catalog that is used to generate the report will be removed from memory. However, if you specify this option, the catalog will be cached rather than removed. Cache Loaded Reports Specifies whether to keep the reports in memory or remove them from memory after they have been generated.

Performance Pre-loading the Java classes and fonts which are used by catalogs, reports and JReport Engine at startup time will improve performance when these classes are needed at runtime.
r

Preload Catalog Referred Classes Pre-loads the Java classes that are used for a catalog. Preload Report Referred Classes Pre-loads the Java classes that are used for a report. Preload Engine Referred Classes Pre-loads the Java classes that are used by JReport Engine to generate reports. Preload Fonts Specifies to load the fonts when JReport Server is started rather than when they are first used.

Maximum Number of Concurrent Reports in the Queue Specifies the maximum number of concurrent reports in the queue, which must be less than or equal to the number that the license permits. Advanced Data Source

Installing silently
JReport provides two files for installing JReport Server silently without user participation in the installation process. It is ServerInstall_typical.properties for the Typical Installation for Standalone Server type and ServerInstall_custom.properties for the Custom Installation for Standalone Server type. Follow the steps below to install JReport Server silently: 1. Download the appropriate file from the Jinfonet website according to your requirement. 2. Some built-in demo reports (\SampleReports\*.cls) with Derby as the data source (install_root\db \[Link]) have been provided. At the end of the installation, the installer will configure the reports and catalog to the correct data path. This calls some AWT classes that require GUI support. So, if you have an X server installed, you should set the Display variable so that this step can be performed successfully. $ DISPLAY=hostname(or IP address):0.0 $ export DISPLAY Note: If you do not have X server or a pure text environment, this step can be ignored. However, you may find that the demo reports will not be able to run after you start the JReport Server due to having the wrong default data source path. In this case, you can use JReport Designer to publish some working reports for testing purposes. 3. Run the following command, and JReport Server will be installed in the designated path: $ ./[Link] -i silent -f ServerInstall_typical.properties Notes:
q

When installing JReport Server silently, make sure you do not use overwrite installation, instead, install the server to a new directory. When you install the Update or Service Pack silently, edit the file [Link] in <install_root>\help\server\en\samples to your own requirements. This file is used to create an option file (i.e. response file) for the Installation Wizard. It predefines all the information that is required for the installation. You can also create a property file and save it as follows: USER_INSTALL_DIR=/usr/local/JReport/Server USER_KEY=UID USER_PASSWORD=Password Modify the above lines according to your own environment and configurations.

Installing using the console interface


JReport enables you to perform an interactive installation from a command prompt on platforms that do not have GUI. In this way, you are able to see the installation status and follow the installation process. Take the following steps to perform console installation: 1. Download the installation program ([Link] for Unix and z/Linux, [Link] for Windows) from the Jinfonet download center: [Link] 2. Run the following command: For Unix and z/Linux: $ chmod +x [Link] $ ./[Link] -i console For Windows: [Link] -i console 3. Make decisions following the installation process.

Installing on Unix manually


In some rare cases, JReport Server may fail to install on Unix directly. In this case, follow the steps below to install it manually: 1. Install JReport Server on Windows following the steps in Installing on Windows, but don't start it. 2. Prepare a directory on Unix where you will copy the installation, for example /opt/JReport/ Server. 3. Modify javahome and reporthome in the following files to the Unix directories where the Java JDK is located and the directory you are going to copy the release to. Be sure to modify them carefully. Any mistake will cause problems starting JReport. [Link] [Link] [Link] 4. Delete the file [Link] from <install_root>\bin if it exists and remember to reset the required configuration settings on the JReport Administration page (8889 as the default port) after launching JReport Server on Unix. The [Link] file is created if you use the custom format to install. 5. Make a zip or jar archive of the above folders, and then copy it to your Unix system (use binary format if using FTP). 6. Extract the folder in the destination directory in accordance with the path defined in the property files. 7. Use the dos2unix command to convert all the .sh files under <install_root>/bin to the format that can be recognized by Unix. You can execute the command like this: $ dos2unix *.sh 8. Use the chmod command to set the converted files under <install_root>/bin to have read, write and execute permission. You can execute the command like this: $ chmod 777 *.sh 9. Start a shell (Console) and login as root or become the root user by running the su command. Make [Link] executable and then start JReport Server by running ./[Link]. Note: If you fail to intall JReport Server on your z/Linux system directly, you can also follow the above steps to install the server manually.

Uninstalling
Use either of the following methods to remove JReport Server:
q

From the Control Panel, open Add or Remove Programs, and then select JReport Server 10.1 to uninstall it. Run [Link] (uninstaller on Unix) in <install_root>\_uninst.

Note: The uninstaller will remove all the files generated by the installer, while the files that are created later by the program will be retained. They should be removed manually.

Solving installation problems


This section is trying to help you solve the problems you encounter during the installation.

Where to find log information


If error occurs during the installation, you can check the log information recorded to find out what the problem is. Where logs are generated depends on when the installation process get stuck:
q

If the installation is cancelled before you click the Install button on the installation wizard, logs are created on the desktop for Windows and in the userhome directory for Unix/Linux. If the installation is cancelled after you click the Install button on the installation wizard, logs are created in the logs folder in the installation root directory.

Besides, on a Windows platform, you can choose to specify the log destination that should use absolute path and log file name when launching the installation wizard: [Link] -D$INSTALL_LOG_NAME$="[Link]" -D$INSTALL_LOG_DESTINATION$="D:\temp" or $ ./[Link] -D$INSTALL_LOG_NAME$="[Link]" -D$INSTALL_LOG_DESTINATION$="/opt/ temp" Feel free to send your questions to support@[Link].

An issue on Windows Vista


Problem When running JReport Server's installer on Windows Vista, the installer cannot find the installed JDKs. Reason By default Vista's security settings are stricter than Windows 2000, XP, and 2003. The children processes do not inherit the execution right from their parent process. Solution Make the compatibility property of the installer file (.exe) available: 1. Right-click the installer file, and select Properties from the shortcut menu. 2. In the Compatibility mode panel of the Compatibility tab, check the Run this program in compatibility mode for option, and then select Windows 2000 from the drop-down list. 3. Click OK. 4. Run the installer.

JReport Server reporthome directory overview


This section provides a general view of the directories in the JReport Server installation root, including what they contain, what they are used for, and how to set their location if possible. The following is a list of the server reporthome directories:
Directory _uninst bin db Demo dynamicclasses Contents Files used for uninstalling the JReport Server Command, configuration, and properties files Demo reports' database Demo reports used in the tutorial lessons UDS jar/zip files Directory location Configurability Fixed. Fixed. Fixed. Fixed. The directory location can be specified by the [Link] property in the [Link] file in <install_root>\bin. The directory location can be specified by -[Link] or by the [Link] property in the server. properties file in <install_root>\bin. Fixed.

font

TTF font

help

Help documents introducing the function, features and usage of JReport Server and JReport Designer together with Tutorial manual. Version files

history

The directory location can be specified by the [Link] property in the [Link] file in <install_root>\bin. Fixed. Fixed.

images jreports

Public images for DHTML Demo reports. When scheduling a task to disk, the directory refers to the destination root of the server resource tree.

lib logs ntservice

Library files required by JReport runtime Log files Files for C program and for writing a Windows NT-service to run JReport Server Reads customized configuration for launching JReport Console and Administration pages from the Start menu. Profiling related files Default location for JReport Server realm database

Fixed. The directory is the default location for log files. Fixed.

prestart

Fixed.

profiling properties

Fixed. The directory location can be specified using the URL option on the JReport Administration page > Data > Realm DB > Configuration tab. Fixed.

public_html

Standalone web app folder

realm resources scratchdir

Realm files Language packages for specifying JReport Server UI language. Output files of compiled JSPs

Fixed. Fixed. The directory location can be specified by the [Link] property in the [Link] file in <install_root>\bin. Fixed. The directory location can be specified by stylePath in the [Link] file in <install_root>\bin. For Engine temp files, the directory location can be specified by tempPath in the [Link] file in <install_root>\bin. Fixed for Server temp result files.

script_files style

Script files for creating and deleting system database tables CSS style files and style group files

temp

Engine temp files and Server temp result files

txtdriver

Demo reports' flat data files

Optional.

Upgrading from a Previous Version


Upgrading a standalone JReport Server and an integrated JReport Server involves different processes while sharing some common steps. Both updated JReport Servers require converting the report resources in the old version in order to comply with the new server version.

Upgrading in a standalone environment


JReport Server 10.1 provides two migration tools in <install_root>\bin folder, which can help you to convert all the resources on the previous version of JReport Server before version 6.0. Resources the migration tools cover include the security information (realm, user, group, protection, and ACL), report resources (catalog and reports), scheduled tables, completed tables, version and version tables, and other relevant information (such as fonts, NLS, and style groups). For versions later than V6.0 (included), the upgrade is performed automatically by JReport Server 10.1. You need only install JReport Server 10.1 into the same directory as the old server version. Note: When installing the JReport Server 10.1 into the same directory as the old version, the report level resources in the old version will be maintained and not be replaced by the report resources of V10.1.

Upgrading a version between V5.2 Build 590 (included) and V6 (excluded) to V10.1
You can make the upgrade using the migration tool [Link] ([Link] for Unix) that is available in the <install_root>\bin folder. This tool is used to convert all the resources of the versions between V5.2 Build 590 (included) and V6 (excluded) to the resources of JReport Server 10.1. If you install the new version to the same folder as the old one, the parameter can be omitted.
q

Usage MigrationV52 [orgReportHome] Options


r

orgReporthome The reporthome of the original JReport Server. If this parameter is not provided, the reporthome of JReport Server 10.1 will be used as its value.

Case 1: Installing JReport Server 10.1 to a new folder (recommended) 1. Provided that the old JReport Server is located in C:\JREntServer595. Install JReport Server 10.1 to a new folder C:\JReport\ServerV10.1. DO NOT start the newly installed JReport Server. 2. In the DOS window, switch to <install_root>\bin, and run MigrationV52 C:\JREntServer595. Case 2: Installing JReport Server 10.1 to the folder where the old version resides 1. Provided that the old JReport Server is located in C:\JREntServer595. Install JReport Server 10.1 to the same location. DO NOT start the newly installed JReport Server.

2. In the DOS window, switch to <install_root>\bin, and run [Link].

Upgrading a version earlier than V5.2 Build 590 (excluded) to V10.1


You can do the upgrade using the migration tool [Link] ([Link] for Unix) that is available in the <install_root>\bin folder. This tool is used to convert all the resources of versions lower than V5.2 Build 590 to the resources of JReport Server 10.1. If you install the new version to the same folder as the old one, the parameter can be omitted.
q

Usage MigrationBV52 [orgReportHome] Options


r

orgReporthome The reporthome of the original JReport Server. If the parameter is not provided, the reporthome of JReport Server 10.1 will be used as its value.

Case 1: Installing JReport Server 10.1 to a new folder (recommended) 1. Provided that the old JReport Server is located in C:\JREntServer580. Install JReport Server 10.1 to a new folder C:\JReport\ServerV10.1. DO NOT start the newly installed JReport Server. 2. In the DOS window, switch to <install_root>\bin, and run MigrationBV52 C:\JREntServer580. Case 2: Installing JReport Server 10.1 to the folder where the old version resides 1. Provided that the old JReport Server is located in C:\JREntServer580. Install JReport Server 10.1 to the same location. DO NOT start the newly installed JReport Server. 2. In the DOS window, switch to <install_root>\bin, and run [Link].

Upgrading in an integration environment


1. Suppose that you already have a standalone JReport Server 10.1, whether it is installed directly or upgraded from a previous version. In this step you need not convert the old version reports. 2. Use the JReport Server 10.1 to create a self-contained WAR/EAR file. For information on how to create the WAR/EAR, see Building a WAR/EAR file to include a self-contained JReport Server. 3. Use the Java application server that integrates the previous version of JReport Server to deploy the new self-contained WAR/EAR and update the old WAR/EAR with the new. By now, if the previous version of JReport Server is later than V6.0 (included), the integrated JReport Server has already been upgraded to V10.1. But if the previous version is earlier than V6.0, go to step 4 and you need do further upgrade. 4. For a previous version between V5.2 Build 590 (included) and V6 (excluded): in the DOS window, switch to <reporthome>\bin, and run [Link]. For a previous version earlier than V5.2 Build 590 (excluded): in the DOS window, switch to <reporthome>\bin, and run [Link].

Launching
After you have installed JReport Server, you must set up the reporting environment and start it before you can access it via a web browser. This chapter provides you with detailed information of how to run JReport Server in different running modes. The following topics are discussed in this chapter:
q

Setting up the reporting environment Running as a standalone server Running as an OS service Running within an application server

Setting up the reporting environment


Now that you have installed JReport Server, you can start it. However, it is better to first check the reporting environment to see whether you have published the reports including the catalog files, added the necessary class paths, and set up the data sources.

Report publishment & creation


The separation of the report file and the data is powerful. It facilitates easy re-use of the report's layout. Report files built with JReport Designer can then be published to JReport Server for running in the thin-client/server mode. Today, computing is a service-based model in which web based applications are rapidly replacing monolithic fat-client hosted and maintained software applications. JReport Server is a high performance server for running reports on demand or unattended on a scheduled basis. In this environment, thousands of clients may view, print and generate new reports. JReport Server has its own resource tree with each node mapping to a folder or file in your physical drive. So when publishing report files to the server, it is recommended that you check:
q

Whether the report files reside somewhere in the server machine. Whether the files are mapped in the resource tree. That not only the report files, but also the catalog files (including the .fml file) exist and are in the same directory. In addition, one directory can only contain one catalog. However, it can contain many report files which use that catalog.

Data sources
You may have your own catalogs and reports that you developed, and want them to be run and be distributed by JReport Server. In order to do this, the data sources used by your catalogs must be correctly set to the runtime environment of JReport Server. User data source Append the class path of your user class files to the first item of the class path set in your batch file or command line that starts JReport Server. If you are using JReport Server embedded in an application server, add your user class files to the WAR file used to deploy JReport Server.

Additional class paths


If your reports reference any external classes, you will need to add them to the class path option in the batch file and command line that starts JReport Server. For example, if your reports contain user defined objects (UDO) or user defined formula functions, do not forget to add them to the class path or to the WAR file.

Running as a standalone server


JReport Server can be started from the web application server contained in the JReport Server package. This section explains how to start JReport Server as a standalone report server, how to send commands to the server and how to use the batch files in the <install_root>\bin directory.
q

Starting using launch files Starting using Java Sending commands to JReport Server from Java Running without a GUI

Starting using launch files


After you have installed JReport Server, many batch files are automatically generated in <install_root>\bin. They are for assisting you with using and maintaining JReport Server. All of these batch files can be edited to suit different circumstances. However, make sure that you understand their functions when you want to edit them. The following are the JReport Server launch files.

[Link]
This tool detects the default client browser and installation path. It is invoked by [Link].

[Link]/[Link]
This tool is for sending commands to JReport Server. If the option "-s" or "-p" is not used, the JVM system property "reporthome" must be defined so that [Link]/[Link] will use it to get data from the local machine. Usage cmdsender [-s:<server> -p:<port> -u:<user>] -w:<password> admin|shutdown|localshutdown|(local:on|off) Options
q

-s The server host name. -p The administration port. -u The admin user name. -w The admin password. shutdown Shuts down the server. localshutdown Shuts down the local server. local The administration tasks are available to local host only. gc Run the Java garbage collector.

[Link]/[Link]
This tool is for administrators to backup and restore JReport Server data. It is invoked by the following command line: Usage DBMaintain -[?|cleanup|B<[systemtables|realmtables|profiling]:<filename>>|R<[systemtables| realmtables|profiling]:<filename>>] Options
q

-? Displays the usage information and then exits. -cleanup Checks integrality of the server data and cleans up the invalid data. -Bsystemtables:<filename>/-Brealmtables:<filename>/-Bprofiling:<filename> Backup the data in the database with the related data to a specified file. For example, for backing up the server data realmtables to file c:\[Link], you can type: DBMaintain -Brealmtables:c:\[Link]

-B0realmtables:<filename> Only backup the data in the realm database. -Rsystemtables:<filename>/-Rrealmtables:<filename>/-Rprofiling:<filename> Restore the data including the related data outside the database from a specified file. For example, for restoring server data realmtables from the file c:\[Link], you can type: DBMaintain -Rrealmtables:c:\[Link]

-R0realmtables:<filename> Only restore the data in the realm database.

[Link]/[Link]
This tool is used to launch JReport Server with debug and log information. The output log files are in the <install_root>\logs directory. In case of problems, you may run this batch to reproduce the problem. Open the files to see the detail information and find out the problem. Send the log files to support@[Link] if you are unable to resolve the problem. Usage DJRServer [-?|-p <port>|-ap <adminport>|-realm <realmname>|-l backlog|-m <max> |-t <timeout>|-s <filename>|-web <directory>|-env|-silent| |-local|-vDebug|-vError|-[Link] <host:port>|-cleanup] Options
q

-? Prints this help message. -p <port> The port number to listen on.

-ap <adminport> The port number which is used by the administration tools. -realm <realmname> Specifies the active realm. -l <backlog> The maximum queue length for incoming connections. -m <max> The maximum number of connection handlers. -t <timeout> The connection timeout in milliseconds. -s <filename> The servlet property file name. If this option is not used, the file [Link] in <install_root> \bin will be used as the servlet property file when launching JReport Server. -web <directory> The root directory when accessing the server via the web, its default value is <intall_root> \public_html. -env Prints the environment. -silent No output is sent to the console. -local The administration tasks are available on local host only. -vDebug Enables JReport Engine to output messages to a file and sets all log files' trace levels to INFO and error levels to WARN. -vError Enables JReport Engine to output messages to a file and sets all log files' trace levels to OFF and error levels to ERROR. -[Link] <host:port> The admin server host and RMI port. -cleanup Checks integrality of the server data and cleans up the invalid data.

[Link]/[Link]
This tool is used to launch JReport Server in standalone mode without any predefined options. On Windows, you can start server by double-clicking on [Link]. If you cannot start the server successfully in this way, the reason will be displayed in the MS-DOS command prompt. Usage JRServer [-?|-p <port>|-ap <adminport>|-realm <realmname>|-l backlog|-m <max>

|-t <timeout>|-s <filename>|-web <directory>|-env|-silent| |-local|-vDebug|-vError|-logall|-[Link] <host:port>|-cleanup] Options


q

-? Prints this help message. -p <port> The port number to listen on. -ap <adminport> The port number which is used by the administration tools. -realm <realmname> Specifies the active realm. -l <backlog> The maximum queue length for incoming connections. -m <max> The maximum number of connection handlers. -t <timeout> The connection timeout in milliseconds. -s <filename> The servlet property file name. If this option is not used, the file [Link] in <install_root> \bin will be used as the servlet property file when launching JReport Server. -web <directory> The root directory when accessing the server via the web, its default value is <intall_root> \public_html. -env Prints the environment. -silent No output to the console. -local The administration tasks are available on local host only. -vDebug Enables JReport Engine to output messages to a file and sets all log files' trace levels to INFO and error levels to WARN. -vError Enables JReport Engine to output messages to a file and sets all log files' trace levels to OFF and error levels to ERROR. -log[:file Name] (deprecated) Outputs JReport Engine messages to the log file as specified and uses the -vDebug level. -logall Sets all loggers' trace level to INFO and error level to WARN. -[Link] <host:port>

The admin server host and RMI port.


q

-cleanup Checks integrality of the server data and cleans up the invalid data.

Notes:
q

You may need to set an appropriate -[Link] option in the file to start JReport Server in order to view characters correctly. You may also need to set an appropriate -Dresolution option in the file to start JReport Server in order to set the system resolution in DPI.

[Link]/[Link]
This tool is for generating the report environment file [Link] in the current directory. This file can help the Jinfonet support staff assist you when you run into problems.

[Link]
This tool is used to launch JReport Server in the standalone mode and open the JReport Server Launch Pad page.

[Link]/[Link]
See here.

[Link]/[Link]
This tool is used to convert all the resources from JReport versions which are lower than V5.2 Build 590 to the resources of JReport Server V8. If you install the new version to the same folder as the old one, the parameter can be omitted. Usage MigrationBV52 [orgReportHome] Options
q

orgReporthome The reporthome of the original JReport Server. If this parameter is not provided, the value of "reporthome" of new JReport Server will be used as its value.

[Link]/[Link]
This tool is used to convert all the resources of which the versions are between V5.2 Build 590 (included) and V6 (not included) to the resources of JReport Server V8. If you install the new version to the same folder as the old one, the parameter can be omitted. Usage MigrationV52 [orgReportHome]

Options
q

orgReporthome The reporthome of the original JReport Server. If this parameter is not provided, the value of "reporthome" of new JReport Server will be used as its value.

[Link]/[Link]
This tool is used to launch JReport Server without JIT option. If your server often crashes with JIT option, try this batch file instead of [Link]. Usage NJRServer [-?|-p <port>|-ap <adminport>|-realm <realmname>|-l backlog|-m <max> |-t <timeout>|-s <filename>|-web <directory>|-env|-silent| |-local|-vDebug|-vError|-logall|-[Link] <host:port>|-cleanup] Options
q

-? Prints this help message. -p <port> The port number to listen on. -ap <adminport> The port number which is used by the administration tools. -realm <realmname> Specifies the active realm. -l <backlog> The maximum queue length for incoming connections. -m <max> The maximum number of connection handlers. -t <timeout> The connection timeout in milliseconds. -s <filename> The servlet property file name. If this option is not used, the file [Link] in <install_root> \bin will be used as the servlet property file when launching JReport Server. -web <directory> The root directory when accessing the server via the web, its default value is <intall_root> \public_html. -env Prints the environment. -silent No output to the console. -local The administration tasks are available on local host only.

-vDebug Enables JReport Engine to output messages to a file and sets all log files' trace levels to INFO and error levels to WARN. -vError Enables JReport Engine to output messages to a file and sets all log files' trace levels to OFF and error levels to ERROR. -log[:file Name] (deprecated) Outputs JReport Engine messages to the log file as specified and uses the -vDebug level. -logall Sets all loggers' trace level to INFO and error level to WARN. -[Link] <host:port> The admin server host and RMI port. -cleanup Checks integrality of the server data and cleans up the invalid data.

[Link]
It is invoked by [Link].

[Link]/[Link]
This tool is used to generate the rmi authentication file. JReport Server uses the authentication file to secure remote objects. If no argument was provided, an authentication file named "[Link]" will be created in <install_root>\bin, using the userid and install key of JReport Server. Usage RMIAuthFileCreator [authFileName [userid key]] Options
q

? Shows the usage message. authFileName The RMI authentication file name. If only input this argument, the userid and install key of JReport Server will be used to create the authentication file. userid The user ID, which will be used to generate the contents of the authentication file. key The key which will be used to generate contents of the authentication file.

[Link]/[Link]
This tool is for replacing user ID and license key. Usage

rp UID Key

[Link]/[Link]
This tool is for converting old report schema to be current version. Usage rptconv "-source=source_path" ["-target=destination_path"] [-r] [-s] Options
q

-source Specify the source path of the reports that are to be converted. -target Specify the destination path for the converted reports. -r Replace the source report with the converted version. If this option is set, ["-target=destination_path"] is ignored. If both "-r" and "-target" are not specified, the converted reports are saved in the same directory as the source reports and named as "converted_SourceReportName".

-s Convert all the reports in the specified directory, including the reports in all subdirectories.

Examples
q

To convert a single report: rptconv "-source=C:\JReport\Server\jreports\SampleReports\[Link]" " target=C:\temp" This will convert C:\JReport\Server\jreports\SampleReports\[Link] to C:\temp \[Link]. rptconv "-source=C:\JReport\Server\jreports\SampleReports\[Link]" " target=C:\temp\[Link]" This will convert C:\JReport\Server\jreports\SampleReports\[Link], save the converted report to C:\temp, and name it as "[Link]" (if license allows). rptconv "-source=C:\JReport\Server\jreports\SampleReports\[Link]" This will convert C:\JReport\Server\jreports\SampleReports\[Link], save the converted report in the same directory, and name it as "converted_InvoiceReport.cls". rptconv "-source=C:\JReport\Server\jreports\SampleReports\[Link]" -r This will overwrite C:\JReport\Server\jreports\SampleReportss\[Link].

To convert all reports (*.cls, *.rpt, *.clx, *.[Link]) in a directory: rptconv "-source=C:\JReport\Server\jreports" "target=C:\temp" This will convert all the reports in C:\JReport\Server\jreports and save the converted reports to C: \temp. The converted reports use the same file names as source reports.

rptconv "-source=C:\JReport\Server\jreports" "target=C:\temp" -s This will convert all the reports in C:\JReport\Server\jreports and in the subdirectories and save the converted reports to C:\temp. The converted reports take the same file names and directory structure as source reports. rptconv "-source=C:\JReport\Server\jreports" "target=C:\temp\*.cls" -s This will convert all the reports in C:\JReport\Server\jreports and in the subdirectories and save the converted reports to C:\temp. The converted reports take the same directory structure as source reports and the suffixes of their file names are all changed to ".cls". rptconv "-source=C:\JReport\Server\jreports" -r -s This will convert all the reports in C:\JReport\Server\jreports and in the subdirectories. The converted reports overwrite the source reports. rptconv "-source=C:\JReport\Server\jreports" This will convert all the reports in C:\JReport\Server\jreports. All the converted reports are saved in the same directory and named as "converted_SourceReportName".
q

To convert a type of reports with same suffixes in a directory: The usage is similar to converting a directory. You can specify the wildcard to filter reports, for example: rptconv "-source=C:\JReport\Server\jreports\SampleReports\*.cls" "target=C:\temp" This will convert all the reports with the suffix ".cls" in C:\JReport\Server\jreports \SampleReports and save the converted reports to C:\temp.

Notes:
q

There must be one and only one catalog file in the directory where the reports to be converted reside. If the reports to be converted contain UDO or UDF, make sure the corresponding classes or jars are included in the class path of [Link]/[Link].

[Link]
This tool is used to launch the JReport Administration page from the Start menu after the server is started.

[Link]
This tool is used to launch the JReport Console page from the Start menu after the server is started.

[Link]
This tool is used to exit JReport Server from the Start menu.

[Link]

This tool is used to exit JReport Server.

Starting using Java


The class of the standalone server is [Link]. You can start JReport Server with the following command instead of using the generated batch files: JAVA -classpath <classpath> -[Link]=NONE -Dreporthome=<install_root> [Link]. JREntServer [options]
q

-classpath The class path must include the following packages originally in your <install_root>\lib: [Link]; [Link]; [Link]; [Link]; [Link]; -[Link]=NONE This is without JIT. This is not a required option. However, if you encounter problems running the server and you think that they relate to the Java VM, you can try turning off the JIT compiler and then running again. -[Link] Specifies the encoding to encode/decode escape characters in URL strings. If not specified, the system default encoding will be used. For example: java ... -[Link]=8859-1... -Dreporthome This is where JReport Server is installed. It is the Destination Location you specified when you installed it. This option is required. When you set the reporthome, upon launching, JReport will try to find the [Link] and [Link] files in <install_root>\bin and check whether they are valid. [Link] is the License control file. Open [Link], and you will find the configuration information, including the temp, template and the help path. JReport will use the temp path to export the temporary files so you should make sure that the temp folder specified in [Link] exists and has space available. -[Link] Specifies the encoding to encode/decode escape characters in the server data. If not specified, the system default encoding will be used. For example: java ... -[Link]=8859-1... -Dresolution Sets the system resolution in DPI. If not specified, the system default resolution will be used, which is the resolution of your monitor, for example, -Dresolution=96. [options]
Option -? -p port -ap adminport -l backlog -m max -t timeout -s filename -realm realmname Description Print brief help message. The port that this server listens on, default is 8888. The port number that the remote administration uses, default is 8889. Maximum length of queue for incoming connection indications. Maximum number of connection handlers. Connection timeout in milliseconds. Servlet property file name. Active realm when the server starts up. The specified realm should exist, otherwise the server will use an existing realm as the active realm. The server will then record a warning message in the log file, and set the selected active realm by the [Link] property in the [Link] file.

-web directory -local -vDebug -vError -env -silent -log[:file Name] (deprecated) -logall -[Link] host:port -cleanup

Web application server root directory, default is <intall_root> \public_html. Administration on local host only. Enables JReport Engine to output messages to a file and sets engine log file's trace level to INFO and error level to WARN. Enables JReport Engine to output messages to a file and sets engine log file's trace level to OFF and error level to ERROR. Print environment settings when the server starts up. Outputs nothing, not even the server start information. Outputs JReport Engine messages to the log file as specified and uses the vDebug level. Sets all loggers' trace level to INFO and error level to WARN. The admin server host and RMI port. Checks integrality of the server data and cleans up the invalid data.

Notes:
q

For detailed information on how to configure the logging and debugging information, read the [Link] file in <install_root>\bin. Some of the common options will be used in later chapters. In addition, JReport has automatically generated some batch files for you so that you do not have to write a complicated command line. You can find these in the <install_root>\bin directory.

Sending commands to JReport Server from Java


After JReport Server has been started as a standalone server, you can send commands to the server to either shut it down or pop up the user interactive interface for administration. All of these can be done through the class [Link]. The full command is as follows: JAVA -classpath <classpath> -[Link]=NONE [-Dreporthome=<install_root>] jet. [Link] [-s:server -p:port] -w:password [-?]|admin|shutdown|gc|(local:on| off)
q

-? Prints brief help message. -[Link]=NONE This is without JIT. This is not a required option. However, if you encounter problems running the server and you think that they relate to the Java VM, you can try turning off the JIT compiler and running again. -Dreporthome This is where JReport Server is installed. It is the destination location you specified when you installed it. It is required only if you do not execute the command from the local host on which JReport Server is running. -Dpoperror=true This property is used to control whether to pop up a message to show error information. The default value is false which indicates that the error message will not be displayed. -Classpath The class path must include the following packages originally in your <install_root>\lib: [Link]; [Link]. -s:server Host name on which JReport Server is running. -p:port The port JReport Server used for administration. The default value is 8889. -w:password Password of the admin user. Example: -w:admin. admin A command sent to the server asking to pop up the user interactive interface for administering JReport Server. shutdown A command sent to the server asking it to shut down. local:on A command sent to the server asking to only allow the administration commands sent by the local machine. local:off A command sent to the server asking to accept administration commands from anywhere.

gc A command sent to the server asking the JVM to schedule the Java Garbage Collector.

Note: Some of the common options will be used in the later chapters. In addition, JReport has automatically generated the batch file [Link] for you so that you do not have to write a complicated command line.

Running without a GUI


Many environments, such as mainframe machines and dedicated servers, do not support a display, keyboard, or mouse. JReport Server supports Java headless implementation, in which case you do not have to install a third-party tool, such as PJA, XWindows, or XVFB, in order to run JReport in a non-GUI environment.

Using Java headless implementation


JReport Server runs fluently in headless environments. What you need to do is make some simple configuration changes before starting JReport Server in headless environments. To launch JReport Server in a headless environment: 1. Add -[Link]=true as a JVM parameter before starting JReport Server. 2. Start JReport Server. Note: If JDK 6 is used, it is not necessary to add the parameter -[Link] manually, because JDK 6 can automatically give a value to the parameter according to the environment the server will run. For example, if it is headless, the true value will be given.

Using a third-party tool (deprecated)


The method of using a third-party tool is no longer needed but is still available in this release. It may be removed in the future. The following introduces three ways to run JReport Server on Unix without GUI.

Running with XVFB


XVFB is an acronym of the Xserver Virtual Frame Buffer. It can provide a virtual Xserver and release you from the need of a real Xserver. It runs without a head or graphics card. XVFB is freeware and can be obtained from [Link]'s X11R6 distribution. Compiling it is supposedly difficult, however, there are some Solaris binaries on certain sites, including:
q

[Link] [Link]/pub/XFree86/3.3.6/binaries/Solaris [Link]/pub/XFree86/4.0.1/binaries/Solaris [Link]/pub/XFree86/4.0.1/binaries/Solaris-8 [Link]

Take the following steps to run JReport Server with XVFB: 1. Install XVFB. 2. To have XVFB start up automatically when a workstation boots, you can add the Virtual Frame

Buffer to the Automatic Startup. That is, write a script /etc/init.d/xvfb as below, and make it executable. #!/bin/sh mode=$1 case "$mode" in 'start') # start the X Virtual Framebuffer (Xvfb) if [ -f /usr/X11R6/bin/Xvfb ]; then echo "***Starting up the Virtual Frame Buffer on Screen 1***" /usr/X11R6/bin/Xvfb :1 -screen 0 1152x900x8 & fi ;; *) echo " Usage: " echo " $0 start (start XVFB)" echo " $0 stop (stop XVFB - not supported)" exit 1 ;; esac exit 0

Then create a soft link to /etc/rc2.d/S98xvfb: ln -s /etc/init.d/xvfb /etc/rc2.d/S98xvfb If you need not to start XVFB automatically, you can manually start up XVFB: /usr/X11R6/bin/Xvfb :1 -screen 0 1152x900x8 & 3. Set DISPLAY to screen 1 (assuming that JReport Server is running on machine jaguar). DISPLAY=jaguar:1.0 export DISPLAY Then, you can start JReport Server. Logging out the terminal may result in JReport Server shutting down. To avoid this, you can first start JReport Server in the background using the command nohup: nohup ./JRServer &. This command will continue running programs specified by you and enables JReport Server to ignore hangup signals.

Running with PJA toolkit


When there is neither X Window, nor XVFB available, a PJA (Pure Java AWT) Toolkit is supported to run JReport Server. This is a Java library for drawing graphics developed by eTeks. It supplies a replacement AWT toolkit and eliminates the requirement of an X display. To use it: 1. Install PJA. The PJA package is not included in our product, go to [Link] to download PJA and install it. 2. Install JReport Server. 3. Assuming that [Link] has been used to install JReport Server on a Non-GUI platform, modify the file [Link] in <install_root>\bin by appending /pja_2.4/lib/[Link] to the

class path, and add the following options.


r

-Xbootclasspath/a:[Link] - (changing class path is not enough). -[Link]=[Link] - This enables the changing of AWT Toolkit. -[Link]=[Link] - This enables the changing of the Graphics environment. -[Link]=false - This avoids the class [Link]. RasterOutputManager calling the native method getPlatformFontVar(), which can cause a JVM crash. -[Link]=path - With path equal to the directory where the Lucida *.ttf files can be found. You can add to the path other directories containing True Type Fonts by using a separator. Either -[Link]=dir with dir equal to the directory where the sub directory lib containing PJA [Link] file can be found, or add lib/[Link] to the [Link] system property.

Below is an example of the modified file [Link] that is used to start up JReport Server: #!/bin/sh CLASSPATH=$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/itext_1.[Link]:$REPORTHOME/lib/poiHSSF_151.jar: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/jai_core.jar:$REPORTHOME/lib/jai_codec.jar: $REPORTHOME/lib/[Link]:$REPORTHOME/lib/[Link]: $REPORTHOME/lib/[Link]:$REPORTHOME/derby/lib/[Link]: $REPORTHOME/derby/lib/[Link]:$REPORTHOME/derby/lib/[Link]: $REPORTHOME/derby/lib/[Link]:$JAVAHOME/lib/[Link]:$ADDCLASSPATH cd $REPORTHOME/bin $JAVAHOME/bin/java -[Link]=[Link] -[Link]=[Link] -[Link]=false -[Link]=/usr/j2se/jre/lib/fonts: /JREntServer/font:/usr/openwin/lib/X11/fonts/TrueType -[Link]=$REPORTHOME/ -[Link]=UTF-8 -Xmx512m -Dreporthome=$REPORTHOME [Link] "$@"

Notes:
q

Printing reports is not supported. To support multiple encoding, the file [Link] in jre\lib should be added to -Xbootclasspath. Without this Jar file, only the default encoding (iso8859-1) can be applied to JReport. For the

encoding types which are supported by [Link], refer to the website [Link] j2se/1.4.2/docs/guide/intl/[Link].
q

If you are using other True Type Fonts instead of the fonts in X11, you should add the location of the Lucida*.ttf files directory to -[Link].

Starting from a telnet session with an X server installed


If you are using telnet to start JReport and your Unix has an X server installed, you can directly point your display to your X server: $ DISPLAY=hostname(or IP address):0.0 $ export DISPLAY Then, you can run JReport Server or your application with JReport embedded.

Running as an OS service
JReport Server can be configured as an OS service. This section shows you how to run JReport Server as a service of Windows XP, Unix and Linux.
q

Running as a Windows Service Running as a service on Unix Running as a service on Linux

Running as a Windows Service


A tool is provided to assist you in installing JReport Server as a Windows Service. This tool JRservice. exe can be found in <install_root>\bin. You will get the following information if you run [Link] without any options: Usage: JRService -install [-interactive] to install the service JRService -remove to remove the service -interactive to enable JReport Server service to interact with the desktop StartServiceCtrlDispatcher being called. This may take several seconds. Please wait.

JRService -install Running [Link] with the -install option will install JReport Server as a Windows Service. If you open the Services item in the Control Panel, you will find a service named JReport Server in the list. JRService -install -interactive If you use the -interactive option together with -install, the service installed will be run in interactive mode. That is, when you start the service, a Command Prompt Window will pop up. However, if you don't specify this option when you install the service, the Command Prompt Window will not be displayed on the window when you start the service. After you have installed JReport Server as a service, you will then be prompted to re-start your computer for the service installation to take effect. JRService -remove Running [Link] with -remove option removes the Windows service of JReport Server from Windows. However, before you run this, you should stop the service.

Configuring JReport Server service


The parameters for the Windows service of JReport Server are read from the file [Link] in <install_root>\bin. In this file you will find three parameters specified, as shown in the following example:

JavaVM="C:\jdk1.6.0_17\jre\bin\[Link]" StartArg= "-[Link]=C:\JReport\Server" -classpath "C:\JReport\Server\lib\[Link]; C:\JReport\Server\lib\[Link];C:\JReport\Server\lib\[Link];C:\TEMP"... -[Link]=NONE -Dreporthome=C:\JReport\Server [Link] ShutdownArg= "-[Link]=C:\JReport\Server" -classpath "C:\JReport\Server\lib\[Link]; C:\JReport\Server\lib\[Link];C:\JReport\Server\lib\[Link];C:\TEMP" ... -[Link]=NONE -Dreporthome=C:\JReport\Server [Link] localshutdown

JavaVM The path of the Java VM. StartArg The Java command line for launching JReport Server as an independent web application server. This will be called when the service is started. ShutdownArg The Java command line for shutting down JReport Server. This is called when the service is stopped.

Starting the service


There are two ways to start the JReport Server service.
q

After the server has been installed as a service, it is by default configured to start automatically each time. In other words, without otherwise modifying the Control Panel, the service will start automatically each time Windows is started. You can directly start the service through the Services item in the Control Panel. Open the Services list, find JReport Server on the list, select it and click the Start button.

You can change the options in the file [Link] in <install_root>\bin before you start the service. In the example above, there are no options specified in StartArg. If you would like to set all error log levels to WARN and trace log levels to INFO, you will need to append -logall at the end, as in the following example: ... StartArg= "-[Link]=C:\JReport\Server" -classpath "C:\JReport\Server\lib\[Link]; C:\JReport\Server\lib\[Link];C:\JReport\Server\lib\[Link]; C:\JReport\Server\lib\[Link];C:\TEMP" -[Link]=NONE -Dreporthome=C:\JReport\Server [Link] -logall ...

Reference: For more information on the options available, see Starting JReport Server using Java.

Stopping the service


There are three ways for you to stop the JReport Server service:

Open the Control Panel, go to Administrative Tools, double-click the Services item, select JReport Server, and then click the Stop button if it is not disabled. Run the batch file [Link] in <install_root>\bin with the localshutdown argument, for example: <install_root>\bin\[Link] localshutdown. Use the Shut Down the Server button on the JReport Administration page.

Notes:
q

All ODBC data sources used by the JReport Server Service belong to the System DSN. System data sources can be used by all users on a computer, and are visible to all users on the computer and system-wide services, such as Microsoft Windows services. User data sources can only be used by the current user and are visible only to that user. To establish JReport Server as a service, you should choose System Data Source. That is, define the data source in the System DSN. To do this, open Data Source (ODBC) in Control Panel, and add the data source used by JReport Server to the System DSN panel. Also, remove any old ones from the User DSN. When using NT service to start JReport Server, the mapped disk in path cannot be accessed due to JVM limitation. You should use UNC path (e.g. \\[Link]\public_write) instead of the mapped disk it is mapped to (e.g. Z).

Running as a service on Unix


Assuming that JReport Server has been installed to /user/report/jns, 1. Write a script /etc/init.d/jrserver as below, and make it executable. #!/bin/sh mode=$1 if [ ! -d /user/report/jns ] then # JReport not installed exit 1 fi case "$mode" in 'start') if [ -d /user/report/jns ] then echo "Starting JReport Server" /user/report/jns/bin/[Link] & fi ;; 'stop') if [ -d /user/report/jns ] then echo "Stopping JReport Server" /user/report/jns/bin/[Link] localshutdown & fi ;; *) echo " Usage: " echo " $0 start (start JReport Server)" echo " $0 stop (stop JReport Server)" exit 1 ;; esac exit 0

2. Create a soft link to /etc/rc2.d/S99jrserver. ln -s /etc/init.d/jrserver /etc/rc2.d/S99jrserver 3. Create a soft link to /etc/rc0.d/K99jrserver. ln -s /etc/init.d/jrserver /etc/rc0.d/K99jrserver

Running as a service on Linux


Running JReport Server as an OS service on Linux is more or less the same as with running on Unix. Here it is assumed that your default start up rc is rc5.

Setting up XVFB
1. Install XVFB. 2. Write a script /etc/init.d/xvfb as below, and make it executable. #!/bin/sh mode=$1 case "$mode" in 'start') echo "start xvfb " if [ -f /usr/X11R6/bin/Xvfb ] then /usr/X11R6/bin/Xvfb :1 -screen 0 1152x900x8 & fi ;; *) echo " Usage: " echo " $0 start (start XVFB)" echo " $0 stop (stop XVFB not support)" exit 1 esac exit 0

3. Create a soft link to /etc/rc5.d/S97xvfb. ln -s /etc/init.d/xvfb /etc/rc5.d/S97xvfb

Using rc to run JReport Server as a service


Assuming that JReport Server has been installed to /JReport/Server. 1. Write a script /JReport/Server/bin/JRServer as shown below, and make it executable. Here it is assumed that JReport Server is running on a machine with IP address [Link]. #!/bin/sh DISPLAY=[Link]:1.0 export DISPLAY /JReport/Server/bin/JRServer -silent "$@"

2. Write a script /etc/init.d/jrserver as below, and make it executable.

#!/bin/sh mode=$1 if [ ! -d /JReport/Server ] then # JReport not installed exit 1 fi case "$mode" in 'start') if [ -d /JReport/Server ] then echo "Starting JReport Server" cd /JReport/Server/bin/; JRServer -silent & fi ;; 'stop') if [ -d /JReport/Server ] then echo "Stopping JReport Server" /JReport/Server/bin/CmdSender localshutdown & fi ;; *) echo " Usage: " echo " $0 start (start JReport Server)" echo " $0 stop (stop JReport Server)" exit 1 ;; esac exit 0

3. Create a soft link to /etc/rc5.d/S98jrserver. ln -s /etc/init.d/jrserver /etc/rc5.d/S98jrserver 4. Create a soft link to /etc/rc5.d/K98jrserver. ln -s /etc/init.d/jrserver /etc/rc5.d/K98jrserver If all has been carried out successfully, the installation of the service will now have finished. JReport Server is now ready to run as a daemon process.

Running within an application server


In addition to running as a standalone server and as a service, JReport Server can also run as a servlet inside a Java application server. Since JReport Server is implemented using servlets and JSPs, it can work with any servlet-enabled web application server by assembling and deploying JReport Server as a Web Application Archive (WAR) or Enterprise Application Archive (EAR). There is a separate chapter about integration with different application servers - Integrating with a Java Application Server. It provides a general method for creating the deployable archive and detailed procedures for deploying the archive into some popular application servers.

Basic Concepts
This chapter gives you some basic JReport Server concepts. You can first go through this chapter to gain a general understanding about JReport Server before you use it. Also, while you are using JReport Server, if you do not understand any of the basic concepts, you can refer to this chapter to get help. This chapter discusses the following JReport Server main concepts:
q

Background tasks Interactive reporting Scheduling Resource Version Security Integration JReport Server cluster

Background tasks
JReport Server provides a background running system, which shows the status information of tasks submitted using the Run, Advanced Run, or Background Run mode. Status information includes: report name, report path and name, catalog path and name, running format, time when the task is started/ completed, time elapsed since the task is performed, and the status of the task. It allows you to view detailed information in a timely fashion. The records saved in the background running system are cleared under the following conditions:
q

JReport Server is restarted. The maximum time limit specified for the report result life has been reached. By default it is 86400 seconds (24 hours). The maximum time limit specified for the interval between a user logout and login has been reached. By default it is 300 seconds. If the number of records exceeds the number specified for the background task list (by default it is 100 records), the latest 100 records will be retained.

Interactive reporting
JReport Server provides you with interactive reporting of DHTML reports. DHTML allows you to control objects such as images, buttons, text fields, checkboxes, radio buttons, and drop-down lists. With interactive DHTML output, you can dynamically modify - filter, search, sort and drill - reports to obtain unique and personal data views. The DHTML toolbar and interactive web objects can be embedded into reports or JSPs at design time, enabling you to control, customize and navigate report views. JReport further extends interactive reporting by empowering applications with ad hoc reporting. You can define report criteria and layout at runtime to generate interactive ad hoc reports.

Related topics:
q

JReport Viewer - Interactive Reports

Scheduling
JReport Server provides a scheduling system which you can customize to suit your requirements. You can submit a scheduled task from web page and URL or by calling the Server and Client API methods. However, before you can do this, you must first specify the report, catalog, task type and its launch type. In addition, you can also customize notification messages to notify others of whether or not the task is executed successfully.

User Task
In order to provide the means to run tasks defined outside of JReport on JReport Server, and to just use JReport Server's schedule function, JReport provides a task named User Task. With this task, you can implement a customized task with the schedule properties. Also, you can submit the user task from a web page, or by calling JReport Server API methods. After creating a class that implements the UserTask interface in the [Link] package and adding the class to the class path, you can then submit the task either from a server web page or by calling Server API methods. The task can then be run by the server at the scheduled times just as if it were a report.

Trigger
The scheduling mechanism supports trigger conditions in addition to time conditions. Triggers are managed by name in JReport Server, so each trigger must have a unique name. After creating a trigger, you can submit a task that is bound with the trigger, and then fire the trigger to activate the task at anytime. Trigger conditions are based on event driven modes. The server does not care whether a customized condition is ready. It only waits there for trigger firing events. Therefore, you determine whether the condition is ready before firing a trigger. Triggers can also work together with time conditions for activating a scheduled task.

Related topics:
q

Scheduling reports

Resource
JReport Server provides a resource system for managing a group of archive versions that can be processed or organized.

What is a resource
Generally, a resource refers to report or dashboard related material. To be exact, a resource in the JReport Server reporting system is a conceptual node. There are different types of resources, such as catalogs, reports, dashboards, library components, and their results. A resource can only hold versions of the same type.

Resource tree
All the resources are organized in a folder-tree structure. JReport Server defines an XML file called [Link], and the resource tree conforms to this file. This file is maintained automatically by JReport Server. For example, your company has two departments - Support and Marketing. Each department has its reports on their own machine. There are some report documents that are submitted by the departments located on the machine where JReport Server runs. Now, suppose you are the administrator, and you would like to organize these files and folders into the Resource Tree. The following diagram may help you to figure out the framework on which you should build the resource tree.

The resource tree consists of the following three layers:


q

Folder layer: Basic resource tree element that builds the main framework for the resource tree. There are two built-in folders in the root of the resource tree -- Public Reports and My Reports. A folder can be mapped to a real file path. Resource layer: An abstract layer, based on the Folder layer that hosts various types of archive versions and provides user access to the versions. Archive layer: A concrete layer, where the archive versions reside for executable resources, which function as the leaves of the resource tree.

Public Reports and My Reports

There are two built-in folders in the resource tree root - Public Reports and My Reports. You can create your own folders in either of them. The Public Reports folder and the My Reports folder cannot be deleted. The Public Reports folder contains public report documents and executable reports, and can be accessed by everyone. All folders except for the personal folders are public folders. The My Reports folder is a personal folder. It contains personal report documents and executable reports. Each user has one personal folder, specified by the administrator when the user account is created. The My Reports folder can only be accessed by its owner, and the user has full control over his/her personal folder. This folder is the default output location for reports run by the user.

Report
There are two types of reports in JReport: page reports and web reports. A page report is a collection of report tabs and each report tab can have multiple pages, while a web report has no report tabs and is always displayed as a web layout report with just one page. JReport Server supports viewing, advanced running, scheduling and managing of reports. The background run/scheduled/ active/completed record are based on report level. When viewing a page report directly, if DHTML is set as the default report view format, the page report with all its report tabs will be run. Otherwise, only the default selected report tab will be run. When using Advanced Run to run a page report, you can only select one report tab in the page report to run. When using scheduling to publish a page report to the versioning system or to disk, the DHTML and JReport Result formats are based on the report level, that is, the report with all selected report tabs will be output to a single file. As for the other formats, each selected report tab will be output to a separate file but you still have the convenience of scheduling all the report tabs with a single schedule entry.

Component Library
A component library is a repository on JReport Server for storing and managing library components. It is accessible to server administrators. Library components are designed using JReoprt Designer, and then are published to the component library for use when creating or modifying dashboards. A folder in a component library can have no more than one catalog, therefore when your library components require different catalogs, you need to create multiple folders in the component library.

Related topics:
q

Managing resources

Version
JReport Server provides a versioning system for controlling the resources contained in the resource tree. To understand what the versioning system is, first you have to understand the resource mechanism in JReport Server. A resource in the JReport reporting system is a conceptual node, which holds a group of archive versions that can be processed or organized in JReport Server. Information of these versions is stored in the System DB database that JReport Server uses, while version files are saved in the directory - <reporthome>\history.

What is a version
All the server resources in the resource tree are controlled by versions. A version is the fundamental unit of the resource tree, and your resources might change over time. JReport Server uses a versioning system to create and manage resources that have changed in content and properties owing to updates issued upon them. All the resources in the resource tree have versions. A large portion of resource management tasks are done by managing resource versions.

Different version types


The versions in JReport Server fall into the following major categories:
q

Catalog Version The version of a catalog file. Report Version The version of a report file. Result Version The version of a report result file. The report result can be generated and maintained in two places - the resource tree and the built-in version folder. When you schedule a report to publish to the versioning system, you can choose an archive location to generate the report result. You can generate the report result in the built-in version folder, the My Reports folder or the Public Reports folder in the resource tree. The report results generated in the resource tree are standalone results and can have their own versions, while those generated in the built-in version folder can only be bound with their respective reports.

Dashboard Version The version of a dashboard file. Library Component Version The version of a library component file.

Real path of versions


If you check the property of a version, you will find its real path. Remember that version information is stored to a database, and version files are stored in the directory <reporthome>\history. For the report [Link], the report version's real path is <reporthome>\history\1 \JReport_System_User894485281\[Link], which is the actual report result path on disk and stored in the server database. That is, when you click the [Link] report result resource on the server interface, you are accessing it on the disk, only the path to it is stored in the database. And this works the same for the other types of versions.

Archive policy
JReport Server uses an archive policy to control the resource versions. You can control whether or not to use multiple versions for a specific resource. Also, you can define the maximum number of versions that can be listed in the version table. The archive policy can be applied to a single resource individually, or to many resources in a folder as a whole.

Related topics:
q

Managing versions

Security
JReport Server provides a security system for setting up and maintaining security on it, allowing you to protect your resources from inappropriate access by other users. To help you understand security in detail, the following security features with their concepts are described below:

Realm
A realm is an abstract security concept, which hosts the resources and authentication entities on JReport Server. There can be more than one realm on the server and each realm is independent from others. The resources and authentication entities that reside in different realms are different. At runtime, only one realm can be active and only the users and resources in the active realm are accessible. A realm is identified by a unique name, which can contain any characters other than forward slash (/) and backward slash (\). The authentication entities consist of user accounts, group accounts and role accounts.

User
To use JReport Server, you must have a user account, which consists of a unique user name and password. JReport Server verifies your identity when you type your user name and password and then logs you on. If your user account has been disabled or deleted, JReport Server prevents you from accessing the services that JReport Server provides, in order to ensure that only valid users have access. JReport Server comes with two built-in user accounts, which are admin and guest. The built-in user accounts cannot be deleted. The admin user account can neither be deleted nor disabled.

Group
The principle group, which represents an organization of user accounts, is available for managing users. Users or groups can then be added into a group as its child members, and therefore inherit the resource and folder permissions from the group.

Role
Users must have certain user rights and permissions in order to perform tasks on resources. Roles, which represent an aggregate of permissions, help you to efficiently assign the appropriate user rights and permissions to users. Assigning roles to users gives them the user rights and permissions that they require to perform their jobs with. A role can also be assigned to other groups or roles, and thus groups or roles can inherit the permissions of other roles. JReport Server comes with two built-in role accounts, which are administrators and everyone. The builtin role accounts cannot be deleted. The administrator role account can neither be deleted nor disabled.

Permission
Permissions, associated with resources and folders, are the rules that are granted to users to control their access to resources and folders. Permissions in JReport Server include:
Permission Visible Read Write Description Allows or denies viewing object names in the resource tree or version table, such as folders, resources, and archive versions. Allows or denies viewing object properties, versions, and, if it is a folder, folder contents. Allows or denies publishing folders and resources, changing the properties (not including permission settings) of the objects in the resource tree or version table, such as folders, resources, and archive versions, and modifying version table settings. Allows or denies running resources in normal and Advanced mode (report type resources only). Allows or denies submitting resources to schedules (report type resources only). Allows or denies deleting objects in the resource tree or version table, such as folders, resources, and archive versions. Allows or denies granting permissions to other users, groups or roles. Users, groups or roles that have obtained the Grant permission are also endowed with the other seven permissions - Visible, Read, Write, Delete, Execute, Schedule, and Update Status, and can grant these seven permissions except the Grant permission itself. Allows or denies updating report status, and if it is a folder, the status of reports in the folder.

Execute Schedule Delete Grant

Update Status

Privilege
Privilege is a mode which manages permissions. It can be used to manage different access permissions unrelated with nodes. Privilege of JReport Server manages the following access permissions for users:
q

Publish The privilege of publishing resources to JReport Server. Advanced properties The privilege of viewing advanced information of version properties such as catalog connections and report related resources. Message Table Manipulation The privilege of mapping fields from different data sources in a dashboard.

Alias
JReport Server organizes files and directories into a Resource Tree. Aliases are used to provide different "views" of the tree for different users. For example, you may set an alias resource tree (based on the resource tree) for Tanya, so that she can only see the marketing resource node and can directly enter into the report folder she is interested in. An alias is a combination of users and resource nodes.

Related topics:
q

JReport Security System

Managing security

Integration
JReport Server can be seamlessly integrated with any other Java application server to meet the information delivery needs of a single department or an entire enterprise. It contains a rich set of APIs that allow for seamless integration and is implemented using Java Servlet technology and Java Server Page (JSP). These servlets and JSP pages enable the user to work with any Java EE compliant application server that supports a Servlet Container and administer the JReport Server remotely through a web browser.

Related topics:
q

Integrating with a Java Application Server

JReport Server cluster


A JReport Server cluster is a distributed cluster in which a group of servers work together to provide cluster-wide shared resources, security, schedules and version services. In a JReport Server cluster, all clustered servers play exactly the same role and any one can exit from the cluster any time. The JReport Server cluster provides the following major benefits:
q

Manageability: All users and resources can be controlled from a clustered server, remotely. High-Availability: When one server fails to perform, the tasks running on it will be re-allocated to other servers. If a server has already been fully utilized, the tasks sent to it will be allocated to the other servers. Scaleable: You can add or remove servers dynamically according to your needs.

There are many nodes (clustered servers) in a JReport Server [Link] clustered server has the same responsibility. You can set a clustered server to perform a specific role in a JReport Server cluster by configuring its properties.

Related topics:
q

Clustering

Accessing
You can access JReport Server in either browser/server mode (B/S) or in client/server mode (C/S). In browser/server mode, you can use a web browser to access JReport Server. In client/server mode, you can access JReport Server from one of our products: Client API, JReport Desktop Viewer, or the JReport Viewer Bean. Both JReport Desktop Viewer and JReport Viewer Bean are based on the Client API. This chapter presents to you two modes in which you can access JReport Server:
q

Accessing in browser/server mode Accessing in client/server mode SSL in standalone JReport Server

Accessing in browser/server mode


This section shows you how to access JReport Server through a web browser such as Internet Explorer, Firefox, or Chrome.

Starting and logging onto JReport Server


To log onto JReport Server, first start the server via one of the following ways:
q

Double-click the JReport Server 10.1 shortcut on your desktop. Click Start > All Programs > JReport 10.1 > Server > Start JReport Server. Run the [Link]/[Link] file located in <install_root>\bin. Run the startup file from a command prompt or shell. For example, assume that JReport Server has been installed in C:\JReport\Server on Windows or /opt/JReport/Server on Linux, you can type the following commands: C:\>cd JReport\Server\bin C:\JReport\Server\bin>[Link] $cd /opt/JReport/Server/bin $./[Link]

Then,
q

To access the JReport Console page: 1. Click Start > All Programs > JReport 10.1 > Server > JReport Server Console, or open a web browser and set the URL to [Link] (by default, the port for accessing the JReport Console page is 8888). 2. On the Welcome to JReport User Console page, click the Login Now button. 3. Type your user name and password as assigned by your administrator. For first time users, the default user name and password are admin. 4. Click OK and the JReport Console page will be displayed.

To access the JReport Administration page: 1. Click Start > All Programs > JReport 10.1 > Server > JReport Server Administration, or open a web browser and set the URL to [Link] (by default, the port for accessing the JReport Administration page is 8889). 2. Type your user name and password as assigned by the administrator. For first time users, the default user name and password are admin. 3. Click OK and the JReport Administration page will be displayed.

Tip: If you don't know the IP address of the machine on which the server runs, and if it is the same machine where you run JReport Server, you can use localhost instead of the IP address. You can also

open a console window such as telnet on the server machine and type hostname, then the name of the host will be displayed.

Fast launch pad for local users


Local users can also access JReport Server in a fast way with the launch pad, which is a convenient entry to access the server without having to start it. The launch pad provides some key functions of JReport Server by setting up the connections to corresponding JReport Server JSPs, which are:
q

Viewing the JReport sample reports Creating new reports Scheduling to run reports by time or event Configuring server profiles to customize the server interface and functionality Managing security principals Visiting the JReport Demo Center

To access the launch pad, click Start > All Programs > JReport 10.1 > Server > JReport Server Launch Pad.

Additional login channel for admin users


JReport Server provides a special channel that creates an extra user session for management purposes if the license limit of the maximum number of concurrent users has been reached. The extra user session cannot be used to run reports or submit schedules. It can only be used by admin users for performing management operations. If your JReport Server license has a bounded limit to the maximum number of concurrent users, this feature will take effect. Only one extra valid user session can be created and used within this special channel at any time. If an extra user session has already been created and it is still valid, your request for login will be prompted with a confirmation page asking you whether or not to close the existing extra user session. If you select Yes, a new extra user session will be created for you to perform management operations. Otherwise, you will not be allowed to log onto JReport Server. Note: If all normal user sessions have been used up, a request from a client viewer will be denied permission to log onto JReport Server. Only a normal user session can use a client viewer to log onto JReport Server, not the extra user session.

Logging off and shutting down JReport Server


To log off JReport Server, click the Logout link on the upper right corner of the JReport Administration/ Console page. To shut down JReport Server normally:
q

In a standalone environment, click the Shut Down the Server button on the JReport Administration page, or click Start > All Programs > JReport 10.1 > Server > Stop JReport Server. In an integrated environment, shut down the application server according to the vendor's

instructions. Also, JReport provides a feature for handling an abnormal system exit that enables the program to close itself gracefully when the Java virtual machine (JVM) is terminated in response to a user interrupt, such as typing ^C, or a system-wide event such as user logoff or system shutdown.

Accessing in client/server mode


Besides a web browser, JReport Server supports three other viewers to browse reports from a client: JReport Desktop Viewer, JReport Client API and JReport Viewer Bean. Since JReport Desktop Viewer, JReport Client API, and JReport Viewer Bean are based on the Client API, strictly speaking there are two viewers: thin-client through a web browser and thick-client using the Client API. Reference: For details about the usage of JReport Desktop Viewer, Client API and JReport Viewer Bean, refer to JReport Desktop Viewer User's Guide in <viewer_install_root>\help\userguide if you have installed it on your machine. Also, you can go to the Jinfonet website and read the online help at [Link]

Accessing via JReport Desktop Viewer


JReport Desktop Viewer is a thick-client way to connect to JReport Server. It is based on the Client API but with a Swing based GUI. Compared with a web browser, it has better compatibility with JReport Server, and allows faster access but has more limited functionality. You can view existing reports in server either on a remote server or on your local disk. JReport Desktop Viewer also includes task scheduling functionality. With this you can schedule and view reports at any time and as often as you want. Also, you can publish reports to different formats. Finally, an important feature of JReport Desktop Viewer is that it enables you to manage reports such as adding/deleting reports and defining their properties. However, it does not support using the JReport Web features such as sorting and filtering. 1. Download JReport Desktop Viewer for Windows or for Unix from Jinfonet website at [Link] [Link]/downloadjreport/[Link]. You need to use JReport Desktop Viewer and JReport Server of the same version (the same build number). 2. Follow the installation wizard to install JReport Desktop Viewer (by default, it is installed to C: \JReport\Viewer). 3. Launch JReport Server using the batch file [Link] in <server_install_root>\bin if it is not already running. 4. After JReport Server is started, launch JReport Desktop Viewer using the batch [Link] ([Link] on Unix) in <viewer_install_root>\bin. 5. In the Connect to JReport Server dialog, enter the host, port number, servlet path, user name and password of JReport Server. The default servlet path is /jrserver. If you want to connect to JReport Server with SSL support, check the SSL option. Then, click Connect to complete the connection. 6. After being authenticated, you will see a resource tree in the Explorer tab of JReport Desktop Viewer (or alias resource tree if defined), which corresponds to that of JReport Server. JReport Desktop Viewer contains basic features such as exploring the resource tree, viewing reports and scheduling.

Accessing via Client API


The usual method to connect to JReport Server is through a web browser, such as Microsoft Internet Explorer, Firefox, Google Chrome, or with JReport Desktop Viewer. However, what if you want to integrate the client viewer into your own applications? The answer is you can. Both JReport Desktop Viewer and JReport Viewer Bean are based on the Client API. Since the Client API and JReport Viewer Bean share some functions, you can call methods in either of them. However, JReport Viewer Bean is most often used in running reports and exporting report results to other formats or printers. Client API has more flexibility including the scheduling feature. When you install JReport Desktop Viewer, the archive file [Link] for Client API is also installed to <viewer_install_root>\lib at the same time. There are sample code files you can refer to in <viewer_install_root>\help\samples. For details about using the Client API, refer to JReport Desktop Viewer User's Guide in <viewer_install_root>\help\userguide.

Accessing via JReport (Client) Viewer Bean


JReport Viewer Bean is also based on Client API. JReport Viewer Bean enables you to connect with JReport Server to run reports, view report results, and export report results to other formats (HTML, PDF, XLS, RTF, PostScript, Text, CSV, Applet), e-mail and printer. For the usage of JReport Viewer Bean, refer to the JReport Desktop Viewer User's Guide in <viewer_install_root>\help\userguide. You can go to [Link] [Link] to download JReport Viewer Bean in which some demo sample code files are included.

SSL in standalone JReport Server


JReport Server supports HTTPS requests in standalone mode. Secure ports for HTTPS requests should use different ports from non-secure ports for HTTP requests. By default, port 6888 and 6889 are set as the secure ports separately for accessing JReport Console UI and JReport Administration UI. The URL for visiting JReport Server via HTTPS schema is like this: [Link] or localhost:6888 SSL support is disabled by default. You need to enable it and configure corresponding settings in order to use HTTPS schema to visit JReport Server UI. This can be done either on the JReport Administration page or in the [Link] file located in the <install_root>\bin directory. To enable SSL function via the administration UI: 1. Log onto the JReport Administration page. The default port is 8889. 2. Click Configuration on the system toolbar, and then select Service from the drop-down menu. 3. Check the Enable Secure Socket Layer Connection option. 4. Make sure that Secure Port and Secure Administration Port use different port numbers from Port and Administration Port. 5. Specify the other settings about Keystore. 6. Click Save. 7. Restart JReport Server in order for the settings to take effect. To enable SSL function in the [Link] file: 1. Open the [Link] file located in the <install_root>\bin directory. 2. Set [Link] to [Link] 3. Set the other properties starting with [Link] to meet your requirements. 4. Save the [Link] file. 5. Restart JReport Server in order for the settings to take effect. Notes:
q

JReport does not provide a keystore file since Jinfonet is not a trusted certificate authority and just provides a Keystore File Path option for you to configure the location of your trusted keystore file. There are many trusted authorities that can provide keystore files. Sun is one of them. Here is an example of creating a keystore file provided by Sun: [Link] gdwpf?l=zh_TW&a=view. JReport Server Monitor does not support SSL.

Working with Reports


After successfully logging onto the JReport Console page using the user name and password assigned by your administrator via a web browser, you can then perform tasks according to your requirements. For example, you can view reports in different formats, run them via URLs, and schedule tasks for the reports. Pick a task from the following:
q

Running reports Scheduling reports Using JSPs to print reports

Tip: You can customize the JReport Console > Reports page to suit your requirements by setting your own preferences. To do this, click Tools > Preferences on the task bar of the Reports page, then specify the settings in the Preferences dialog as required. For example, you can specify the default viewing format when directly run a report from this page, set which columns will be shown in the resource information table, and predefine the properties for each export format which will be applied when you run or schedule a report on this page.

Running reports
To run reports on JReport Server:
q

If you just want to view a report in the browser, on the JReport Console > Reports page, simply click the name of the report. If you want to run the report in a specified format and save the report result document, you can use the Advanced Run mode to get the required report result. You can also input the URL of a report directly into the address bar of the web browser to run it.

The following topics describe how to run reports in detail:


q

Viewing reports Running reports in Advanced mode Running reports via URL

Viewing reports
To view a specified report, on the JReport Console > Reports page, browse to the report, then do one of the following:
q

Click the name of the report in the Name column of the Reports page. Select the report row and click Run > Run on the task bar of the Reports page. Select the report row, right-click in the row and select Run from the shortcut menu. Put the mouse pointer over the report row and click the Run button on the floating toolbar.

Then, the last-time focused report tab in the page report when it was saved in JReport Designer or the web report will be displayed according to its Default Format for Viewing Report property setting in JReport Designer. If this property of the report tab or the web report is set to Server Setting, the viewing format will be determined by the Default Format for Viewing Report option on the JReport Administration/Console page > Profile > Customize Server Preferences > General tab. However, for the page report, if the viewing format of the report tab is DHTML, no matter what viewing formats the other report tabs in this report are defined as in JReport Designer, all the report tabs will be opened in DHTML format when you view this report on JReport Server.

Running reports in Advanced mode


Apart from simply running a report to view it in the specified default format, JReport Server also supports viewing a report in other formats, and saving the report result version according to your requirements. To run a report in Advanced mode: 1. On the JReport Console > Reports page, browse to the report you want to run in Advanced mode. 2. Do either of the following:
r

Select the report row, then on the task bar of the Reports page, click Run > Advanced Run. Select the report row, right-click in the row and select Advanced Run from the shortcut menu. Put the mouse pointer over the report row and click the Advanced Run button floating toolbar. on the

The Advanced Run dialog is then displayed. 3. In the General tab, select the report tab in the report you want to run (only one report tab in a report can be run in Advanced mode at a time). If the report has parameters, specify the parameter values as required (for details, see General tab - Parameters). Then, specify the other options as required. 4. In the Format tab, choose a format to view the report result, and set the other settings. 5. In the Archive tab, archive the report result version according to your requirements. 6. If you want to limit the amount of time that the report is allowed to run, in the Duration tab, specify a time duration for the task, and ask JReport Server to cancel the task or to notify you or someone else of the task status via e-mail if the task has not yet finished running when the task duration is up. For detailed information, see Task-level timeout for advanced run and schedule tasks. 7. Click Finish to view the report in the format you specified. See also Advanced Run dialog for details about options in the dialog. Notes:
q

If you choose to view the report result in DHTML format, besides the selected report tab, all the other report tabs in the report will also be run. When you run a report in Advanced mode in HTML format, the names of page navigation links in the report, such as First, Previous, Next, and Last, can be localized according to your requirements. For details, refer to Localizing the page navigation links in HTML report outputs. By default, the Duration tab is not displayed in the Advanced Run dialog. To make it available, the Enable Task Duration option on the JReport Administration page > Configuration > Advanced panel must be checked.

Running reports via URL


Sometimes, you may want to reach a specific page by typing a full URL in a web browser instead of clicking hyperlinks from the JReport Console page. This section explains to you how to run reports via URL in different ways.
q

Running reports via URL with protocols or commands Running reports via URL with authentication parameters Running reports via URL using the POST method Specifying parameter values using dialog when running reports via URL Example 1: Accessing reports via URL using the switching database command at runtime Example 2: Sending a large report result by e-mail upon finishing Example 3: Running a report tab in a page report via URL

Related topics:
q

Setting dynamic parameter values when running or scheduling a report via API

Running reports via URL with protocols or commands


With the commands below, you can directly type the whole URL in a web browser to access the destination. The HTTP methods GET and POST are available for almost all of the commands.
q

jrs.get_cat_rpts_new/jrs.get_subnodes Description: Gets all resource nodes (folder, catalog, report and result) of a folder. HTTP Method: GET/POST URL Format: [Link] path=RESOURCENODE URL Example: [Link] SampleReports Response: Resource nodes list.

jrs. get_node_prop Description: Gets the properties of a resource node. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] SampleReports/[Link] Response: Resource node properties.

jrs.delete_resource Description: Deletes the resource node from the resource tree. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] SampleReports/[Link]

jrs.get_rst_vers Description: Gets a result version list of a report. HTTP Method: GET/POST URL Format: [Link] report=REPORT_SET URL Example: [Link] SampleReports/[Link]&[Link]=/SampleReports/[Link] Response: Result versions list.

jrs.get_rpt_vers Description: Gets a report version list of a report. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] SampleReports/[Link] Response: Report version list.

jrs.get_cat_vers

Description: Gets a catalog versions list of a catalog. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] SampleReports/[Link] Response: Catalog versions list.
q

jrs.get_rst_doc_vers Description: Gets a result versions list of a result document. The result document can be generated by advanced running or scheduling a report. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] SampleReports/EmployeeInformation Response: Result versions list.

jrs.get_ver_rst_page Description: Gets a result version of the report from the version manager. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] 5cJReport_System_User327406359%[Link] Response: The result file from the version manager.

jrs.get_ver_rst Description: Gets an HTML page for viewing a result version of a report with the ViewerApplet. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] [Link]?[Link]=jrs.get_ver_rst&[Link]=1%5cJReport_System_User327406359% [Link] Response: HTML page for viewing the result file with the ViewerApplet.

jrs.get_ondemands Description: Gets a list of reports run in background mode. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] Response: Background run report list.

jrs.view_ver_rst Description: Views a result version of a report. HTTP Method: GET/POST URL Format: [Link] hist_file=RESULT_VERSION_FILE_NAME&jrs.result_type=RESULT_TYPE&jrs. applet_type=APPLET_TYPE[&[Link]=TRUE/FALSE][&jrs.is_multi_files=TRUE/FALSE] [&jrs.is_applet_chart=TRUE/FALSE][&jrs.has_hyperlink=TRUE/FALSE][&jrs. has_page_number=TRUE/FALSE][&jrs.use_table=TRUE/FALSE][&[Link]=TRUE/FALSE] [&jrs.relative_font_size=TRUE/FALSE][&jrs.no_margin_html=TRUE/FALSE][&jrs. web_browser=BROWSER_TYPE][&jrs.no_margin_pdf=TRUE/FALSE][&jrs.is_norm_txt=TRUE/FALSE]

[&[Link]=DELIMITER][&jrs.udchar_width=NUMBER][&jrs.udchar_height=NUMBER][&jrs. no_margin_ps=TRUE/FALSE][&jrs.no_margin_rtf=TRUE/FALSE] URL Example: [Link] [Link]?[Link]=jrs.view_ver_rst&jrs.hist_file=1% 5cJReport_System_User327406359%[Link]&jrs.result_type=1 Notes:


r

RESULT_TYPE: 0 - To Applet 1 - To HTML 2 - To PDF 3 - To TEXT 4 - To Excel 5 - To PostScript 6 - To Rich Text Format 7 - To XML 8 - To DHTML APPLET_TYPE: 2 - Java Plug-In 1.2 for Windows 3 - Java Plug-In 1.3 for Windows BROWSER_TYPE: 0 - IE or Chrome 1 - Firefox

jrs.get_rpt_desc_page Description: Gets an HTML page for entering parameter values and choosing the result type of a report. HTTP Method: GET/POST URL Format: [Link] catalog=CATALOG&[Link]=REPORT URL Example: [Link] catalog=/SampleReports/[Link]&[Link]=/SampleReports/[Link]

jrs.get_rpt_param_page Description: Gets an HTML page for entering parameter values of a report. HTTP Method: GET/POST URL Format: [Link] catalog=CATALOG&[Link]=REPORT URL Example: [Link] catalog=/SampleReports/[Link]&[Link]=/SampleReports/[Link]

jrs.del_rpt_ver Description: Deletes a version of a report. HTTP Method: GET/POST URL Format: [Link] version_id=VERSION_ID URL Example: [Link] [Link]?[Link]=jrs.del_rpt_ver&jrs.version_id=103

jrs.del_rst_ver Description: Deletes a result version of a report. HTTP Method: GET/POST URL Format: [Link] version_id=VERSION_ID URL Example: [Link] [Link]?[Link]=jrs.del_rst_ver&jrs.version_id=106

jrs.del_rstdoc_ver Description: Deletes a version of a result document. HTTP Method: GET/POST URL Format: [Link] version_id=VERSION_ID URL Example: [Link] InvoiceReport&[Link]=jrs.del_rstdoc_ver&jrs.version_id=108

jrs.get_ver_param Description: Gets the parameter file of a report's result version. HTTP Method: GET/POST URL Format: [Link] version_id=VERSION_ID URL Example: [Link] [Link]?[Link]=jrs.get_ver_param&jrs.version_id=103

jrs.web_vw Description: Runs a report and views its result in a web browser. HTTP Method: GET/POST URL Format: [Link] result_type=RESULT_TYPE&jrs.applet_type=APPLET_TYPE[_isMultiple_jrs.param $NAME=true&[Link]$NAME=VALUE&[Link]$NAME=VALUE...][&[Link]=TRUE/FALSE] [&jrs.is_multi_files=TRUE/FALSE][&jrs.is_applet_chart=TRUE/FALSE][&jrs. has_hyperlink=TRUE/FALSE][&jrs.has_page_number=TRUE/FALSE][&jrs.use_table=TRUE/FALSE] [&[Link]=TRUE/FALSE][&jrs.relative_font_size=TRUE/FALSE][&jrs. no_margin_html=TRUE/FALSE][&jrs.web_browser=BROWSER_TYPE][&jrs.no_margin_pdf=TRUE/ FALSE][&jrs.is_norm_txt=TRUE/FALSE][&[Link]=DELIMITER][&jrs. udchar_width=NUMBER][&jrs.udchar_height=NUMBER][&jrs.no_margin_ps=TRUE/FALSE][&jrs. no_margin_rtf=TRUE/FALSE][&jrs.use_def_db_user=TRUE/FALSE][&jrs.db_user=DB_USER][&jrs. db_pswd=DB_PASSWORD][&jrs.jdbc_url=JDBC_URL][&jrs.jdbc_driver=JDBC_DRIVER][&jrs. rpt_language=RPT_LANGUAGE][&jrs.rpt_encoding=RPT_ENCODING][&[Link]=DBField='value'] [&jrs.named_wp=ExistedWhereportion][&jrs.report_sheet$RPT_TAB_NAME=true] URL Example: [Link] [Link]?[Link]=jrs.web_vw&jrs.result_type=1&[Link] $Country=Australia&[Link]$State=New South Wales&[Link]$City=Sydney&jrs. is_multi_files=true&jrs.is_applet_chart=true&jrs.use_def_db_user=false&jrs. db_user=dba&jrs.db_pswd=123456&jrs.rpt_language=en Notes:
r

RESULT_TYPE: 0 - To Applet 1 - To HTML

2 3 4 5 6 7 8
r

To To To To To To To

PDF TEXT Excel PostScript Rich Text Format XML DHTML

APPLET_TYPE: 2 - Java Plug-In 1.2 for Windows 3 - Java Plug-In 1.3 for Windows BROWSER_TYPE: 0 - IE or Chrome 1 - Firefox Use [Link]$NAME=VALUE to set parameter values of the report. Where, NAME is the parameter name and VALUE is the URL-encoded parameter value. For Example: [Link] $TERMSDAYS=30&[Link]$PTODAY=May 21, 1998. While, when specifying values for a multi-value parameter, you need to add _isMultiple_jrs. param$NAME=true before the parameter values to declear that the parameter supports multiple values. For example: &_isMultiple_jrs.param$PM=true&[Link]$PM=3&jrs. param$PM=16.

If you want to run a specific page report tab, use jrs.report_sheet$RPT_TAB_NAME=true to specify a report tab in the current page report, where RPT_TAB_NAME is the report name of the specific report tab, not the display name. For example, jrs.report_sheet$Report2=true. To get the report name and display name of a page report tab, you can make use of the API methods getName() and getDisplayName() in the interface [Link]. For the detailed usages, see JReport Server Javadoc located in <install_root>\help\server\en \api.

If you want to define a new WHERE portion from the URL, you can choose the property [Link]. For example, the report has a DBField Customer Region, and you want to restrict the field Customer Region to CA in the URL. You can then set a new WHERE portion such as, "...jrs. result_type=1&jrs.is_applet_chart=true&[Link]=[Link]='CA'...". If you want to set an existing WHERE portion in the URL, you should use the property jrs. named_wp. For example, to set the existed WHERE portion Region from URL, use "...jrs. result_type=1&jrs.is_applet_chart=true&jrs.named_wp=Region...". Here Region is the WHERE portion's name.

jrs.try_vw Description: Tries to view a report in a web browser. HTTP Method: GET/POST URL Format: [Link] result_type=RESULT_TYPE&jrs.applet_type=APPLET_TYPE[&[Link]=TRUE/FALSE][&jrs. is_multi_files=TRUE/FALSE][&jrs.is_applet_chart=TRUE/FALSE][&jrs.has_hyperlink=TRUE/ FALSE][&jrs.has_page_number=TRUE/FALSE][&jrs.use_table=TRUE/FALSE][&jrs. drilldown=TRUE/FALSE][&jrs.relative_font_size=TRUE/FALSE][&jrs.no_margin_html=TRUE/ FALSE][&jrs.web_browser=BROWSER_TYPE][&jrs.no_margin_pdf=TRUE/FALSE][&jrs. is_norm_txt=TRUE/FALSE][&[Link]=DELIMITER][&jrs.udchar_width=NUMBER][&jrs.

udchar_height=NUMBER][&jrs.no_margin_ps=TRUE/FALSE][&jrs.no_margin_rtf=TRUE/FALSE] [&jrs.use_def_db_user=TRUE/FALSE][&jrs.db_user=DB_USER][&jrs.db_pswd=DB_PASSWORD] [&jrs.jdbc_url=JDBC_URL][&jrs.jdbc_driver=JDBC_DRIVER][&jrs.rpt_language=RPT_LANGUAGE] [&jrs.rpt_encoding=RPT_ENCODING][&[Link]=DBField='value'][&jrs. named_wp=ExistedWhereportion][&jrs.report_sheet$RPT_TAB_NAME=true] URL Example: [Link] [Link]?[Link]=jrs.try_vw&jrs.result_type=1 Notes:
r

RESULT_TYPE: 0 - To Applet 1 - To HTML 2 - To PDF 3 - To TEXT 4 - To Excel 5 - To PostScript 6 - To Rich Text Format 7 - To XML 8 - To DHTML APPLET_TYPE: 2 - Java Plug-In 1.2 for Windows 3 - Java Plug-In 1.3 for Windows BROWSER_TYPE: 0 - IE or Chrome 1 - Firefox jrs.get_schedules

Description: Gets the schedules list. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]
q

jrs.del_schedule Description: Deletes a schedule. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] [Link].455

jrs.enable_schedule Description: Enables a schedule. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] task_id=2003-12-11 [Link].455

jrs.disable_schedule Description: Disables a schedule. HTTP Method: GET/POST

URL Format: [Link] URL Example: [Link] task_id=2003-12-11 [Link].455


q

jrs.get_new_schd_page Description: Gets an HTML page in order to create a new schedule for the report with a web browser. HTTP Method: GET/POST URL Format: [Link] catalog=CATALOG&[Link]=REPORT URL Example: [Link] catalog=/SampleReports/[Link]&[Link]=/SampleReports/ [Link]

jrs.get_edit_schd_page Description: Gets an HTML page to edit the schedule with a web browser. HTTP Method: GET/POST URL Format: [Link] task_id=TASK_ID URL Example: [Link] task_id=2003-12-11 [Link].02

jrs.get_completed Description: Gets the completed tasks list. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]

jrs.del_completed Description: Deletes a completed task. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link] id=1071119897006-154848108

jrs.del_all_completed Description: Deletes all completed tasks. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]

jrs.get_active Description: Gets the active tasks list. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]

jrs.stop_task Description: Stops an active task. HTTP Method: GET/POST

URL Format: [Link] URL Example: [Link] 200312-11 [Link].02


q

jrs.get_change_password_page Description: Gets an HTML page in order to change the password with a web browser. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]

jrs.change_password Description: Changes the password for a user. HTTP Method: POST Form Action: [Link] Content Type: application/x-www-form-urlencoded Content: [Link]=jrs.change_password&[Link]=admin&[Link]=CURRENT_PASSWORD&jrs. new_password=NEW_PASSWORD&jrs.confirm_new_password=NEW_PASSWORD Content Example: [Link]=jrs.change_password&[Link]=admin&[Link]=ad&jrs. new_password=1234&jrs.confirm_new_password=1234

jrs.get_preference_page Description: Gets an HTML page in order to change the user preference settings with a web browser. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]

[Link] Description: Logs out from the JRServlet. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]

[Link] Description: Logs into the JRServlet from a login dialog with web browsers or the JRViewer. HTTP Method: GET/POST URL Format: [Link] URL Example: [Link]

Tip: When running reports to the PDF format via URL, you can encrypt the PDF results by using the encrypting PDF properties.

Running reports via URL with authentication parameters


Sometimes you are required to give your user name and password before you can run reports. Under this circumstance, if you want to avoid the login dialog in the web browser, use either of the following two parameters:
q

[Link] Tag of the HTTP query field [Link]. Description: Loads the JRServlet and avoids the login dialog in web browsers. Format of the value of the HTTP query field: Base64-encoded (userID:password). Example: If the user ID and password are both set as admin, then the value of the HTTP query field is Base64encoded("admin:admin")="YWRtaW46YWRtaW4=", and the URL will be as follows: [Link] authorization=YWRtaW46YWRtaW4%3D. Note: The JRServlet does not check security when an HTTP request has no [Link] in the HTTP query in the root path of the JRServlet, and also does not accept the [Link] for the request [Link]

jrs.auth_uid and jrs.auth_pwd Tags of HTTP query field: jrs.auth_uid and jrs.auth_pwd. Description: Loads the JRServlet and avoids the login dialog in web browsers. Format of the value of the HTTP query field: jrs.auth_uid=USER_ID, jrs.auth_pwd=PASSWORD. Example: If the user ID and password are both set as admin, the URL will be as follows: [Link] auth_uid=admin&jrs.auth_pwd=admin Note: The JRServlet does not check security when an HTTP request has no [Link] in the HTTP query in the root path of the JRServlet, and also does not accept the jrs.auth_uid and jrs. auth_pwd for the request [Link] auth_pwd=admin.

Running reports via URL using the POST method


q

In HTML pages Specify the POST as the method of a form in an HTML page.

Using JRClient API or JRViewer Bean Three methods: usePostAsDefaultMethod(), useGetAsDefaultMethod() and ifUsePostAsDefaultMethod () can be used in the class [Link].

In Java program For example: URL url = new URL("[Link] URLConnection uc = [Link](); if (uc instanceof HttpURLConnection) { HttpURLConnection huc = (HttpURLConnection)uc; //set use POST method. [Link]("POST"); [Link]("Content-Type", "application/x-www-form-urlencoded"); [Link](true); //write the HTTP query to the output stream. OutputStreamWriter writer = new OutputStreamWriter([Link]()); [Link]("[Link]=jrs.get_subnodes"); [Link](); [Link](0); //get the response content from the server. InputStream inStream = [Link](); if (inStream != null) { BufferedReader reader = new BufferedReader(new InputStreamReader(inStream)); String inputLine; while (null != (inputLine = [Link]())) { [Link](inputLine); } } }

Specifying parameter values using dialog when running reports via URL
When running a report with parameters via URL, you need to manually enter the parameter values in the URL string without any mistakes. You may find this painful sometimes because it's not easy to remember all parameters in a report. However, JReport provides you with the special JSP [Link], which enables to display the Enter Parameter Values dialog to manage parameters. The display of the parameter dialog requires:
q

The report has parameters. The URL calls [Link]. No parameter specified in the URL or the parameters provided in the URL fail to include all necessary parameters.

With the above three conditions fulfilled, the Enter Parameter Values dialog will be displayed right after you finish the URL in the address bar and make it run. After setting the values and clicking OK in the dialog, JReport Server will append the values to the URL string for you and execute the URL. However, if you click Cancel in the dialog, the URL running will be cancelled. Tip: If you want to specify parameters via dialog when running reports via URL, the most effective way to display the parameter dialog is that you do not specify parameters at all in the URL.

Example 1: Accessing reports via URL using the switching database command at runtime
To access reports via URL, you can switch the connection in the same database or between different databases at runtime with the commands listed in the section Running reports via URLs with protocols or commands. As a result, if the databases you want to switch between have the same structure, you will then be free from having to build another similar catalog. You can use the switch database commands to set the JDBC connection or to change the user name/password in order to connect to another database.

Switching the connection and user/password in the same database


1. Set the Oracle database named oracle815 connection when designing the report [Link], and later switch the connection to the Oracle database named demo at runtime. The URL for switching the connection: [Link] cmd=jrs.try_vw&jrs.result_type=1&jrs.jdbc_url=jdbc:oracle:thin:@host:1521:demo 2. Specify the user ID system/manager to ensure security when designing the report [Link], and then switch to the user ID Scott and the password tiger. The URL for switching the user ID and password: [Link] cmd=jrs.try_vw&jrs.result_type=1&jrs.db_user=Scott&jrs.db_pswd=tiger 3. Set the Sybase 12 database named master when designing the report [Link], and later switch the connection to the Sybase 12 database named product at runtime. The URL for switching the connection: [Link] cmd=jrs.try_vw&jrs.result_type=1&jrs.jdbc_url=jdbc:sybase:Tds:host:5000/product 4. Set the SQL database named MBA2000 when designing the report [Link], and later switch the connection to the SQL database named JTTest at runtime. The URL for switching the connection: [Link] cmd=jrs.try_vw&jrs.result_type=1&jrs.jdbc_url=jdbc:inetdae:host:1433? database=JTTest&sql7=true

Switching the connection between different databases


1. Set oracle815 connection when designing the report [Link], and then switch the connection to Access database with the JDBC-ODBC driver named products at runtime. The URL for switching the connection: [Link]

cmd=jrs.try_vw&jrs.result_type=1&jrs.jdbc_driver=[Link]&jrs. jdbc_url=jdbc:odbc:products 2. Set oracle815 connection when designing the report [Link], and then switch the connection to SQL server database named products at runtime. The URL for switching the connection: [Link] cmd=jrs.try_vw&jrs.result_type=1&jrs.jdbc_driver=[Link]&jrs. jdbc_url=jdbc:inetdae:JT_P05:1433?database=products&sql7=true

Example 2: Sending a large report result by e-mail upon finishing


Here two ways are provided to publish a large report result via URL: JSP and servlet. Take the following examples to publish a large report result by e-mail and to customize the message displayed in the web browser.
q

JSP parameter specification [Link]=%2fcatalog path%2fcatalog name [Link]=%2freport path%2freport name jrs.timeout_send_email=true/[false] jrs.report_timeout=number (if timeout >number and jrs.timeout_send_email=true, send mail) [Link]=mail address [Link]=mail subject jrs.result_type=1 (HTML) or 2(PDF) or 3(Text) or 4(Excel) or 5(PostScript) or 6(Rich Text) or 7(XML) [Link]=mail content [Link]=mail address of sender jrs.timeout_sendmail_message=the message which you customize There are two server JSPs for running a report:
r

[Link] This is the normal method of accessing reports using URLs. If the report has parameters and the parameters provided in the URL fail to include all necessary parameters, the Enter Parameter Values dialog will be shown for you to specify parameters, otherwise it will directly go to runReport. jsp. For more, see Specifying parameter values using dialog when running reports via URL. [Link] The [Link] functions the same as [Link] when the report has no parameter. When it has parameters, the report runs with the default parameters if no parameter is specified, or else it runs with the parameters specified in the URL.

When you use [Link] to run a report without a parameter: [Link] 2fSampleReports%[Link]&[Link]=%2fSampleReports%2fEmployeeInformation. cls&jrs.timeout_send_email=true&jrs.report_timeout=5&[Link]=person@company. com&[Link]=TaskForTimeoutSendEmail&jrs.result_type=1&jrs. mailcomments=IFTHEREPORTISFINISHEDTHERESULTWILLBESENT&[Link]=person@[Link] When you use [Link] to run a report with parameters: [Link] 2fSampleReports%[Link]&[Link]=%2fSampleReports%2fCustomerAnalysis. cls&[Link]$P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&jrs. timeout_send_email=true&jrs.report_timeout=1&[Link]=person@[Link]&jrs. mailsubject=AboutTaskForTimeout&jrs.result_type=1
q

Servlet parameter specification [Link]=jrs.try_vw (when the report has no parameter) [Link]=jrs.web_vw (when the report has parameter) jrs.timeout_send_email=true/[false] jrs.report_timeout=number (if timeout >number and jrs.timeout_send_email=true, send mail)

[Link]=mail address [Link]=mail subject jrs.result_type=1 (HTML) or 2(PDF) or 3(Text) or 4(Excel) or 5(PostScript) or 6(Rich Text) or 7(XML) [Link]=mail content [Link]=mail address of the sender jrs.timeout_sendmail_message=the message that you can customize When you use a servlet to run a report without a parameter: [Link] cls?[Link]=jrs.try_vw&jrs.timeout_send_email=true&jrs.report_timeout=1&jrs. mailto=person@[Link]&[Link]=AboutTaskForTimeoutSendEmail&jrs. result_type=1&[Link]=COUNTRECORDSPERPAGE When you use a servlet to run a report with a parameter: [Link] [Link]=jrs.web_vw&[Link]$P_StartDate=01/01/2006&[Link] $p_EndDate=12/31/2007&jrs.timeout_send_email=true&jrs.report_timeout=1&jrs. mailto=person@[Link]&[Link]=TaskForTimeoutEmail&jrs.result_type=1&jrs. mailcomments=CUSTOMERORDER
q

Customize your message to be displayed in the web browser You can set a message by setting the parameter jrs.timeout_sendmail_message. For example, you want to display message as below: Running <report name> takes more than <Timeout> seconds. The subject is <mail subject> and has been sent to <mailto> from <mailfrom> It is a file whose type is <type>. Then you can set the parameter in URL: jrs.timeout_sendmail_message=Running {6} takes more than {0} seconds.<p>The subject is {2} and has been sent to {1} from {5}.<p>It is a file whose type is {3}. Where {0} - The report timeout {1} - mail to {2} - mail subject {3} - result type {4} - mail comment {5} - mail from {6} - Catalog name/report <p> - an Enter key Example [Link] [Link]=jrs.web_vw&[Link]$P_StartDate=01/01/2006&[Link] $p_EndDate=12/31/2007&jrs.timeout_send_email=true&jrs.report_timeout=1&jrs. mailto=person@[Link]&[Link]=AboutTaskForTimeoutSendEmail&jrs. result_type=1&[Link]=CustomerAnalysis&[Link]=person@[Link]&jrs. timeout_sendmail_message=... This {6} is a large report whose runtime is over {0} seconds.<p>The report is sent to {1} from {5}. <p>The subject of the mail is {2}.<p>Its type is {3}.

Note: You should type the sign " ' " twice if you use it in the message.

Example 3: Running a report tab in a page report via URL


You can use the following command to specify a specific report tab in the current page report: jrs.report_sheet$RPT_NAME=true Where, RPT_NAME is the report name of the specific report tab, not the display name. To get the report name and display name of a report tab, you can make use of the API methods getName() and getDisplayName() in the interface [Link]. For the detailed usages, see JReport Server Javadoc located in <install_root>\help\server\en\api. The URL for running a report tab Applet within the report [Link] is as below: [Link] 2fSampleReports%[Link]&[Link]=%2fSampleReports%2fMultimediaObjects. cls&jrs.result_type=8&jrs.report_sheet$Report1=true Or [Link] [Link]=jrs.try_vw&jrs.result_type=8&jrs.report_sheet$Report1=true

Scheduling reports
JReport Server can run reports at a specified time or periodically by scheduling tasks for reports. The scheduled tasks will be recorded by the server according to their different executing status. Pick a topic from the following for details about how to schedule tasks in JReport Server:
q

Scheduling reports with dialog Scheduling reports via URL Scheduling a task containing a bursting report Scheduling a customized task using User Task Recording scheduled tasks Viewing scheduled report results Importing and exporting scheduled tasks Adding TaskListener

Notes:
q

When you schedule to publish a report to DHTML format, if the report is linked to another report, in the DHTML result, the link will no longer be supported, and if you schedule to publish the report to several formats and DHTML format is included at the same time, the link will not be available in the other format outputs either. When you schedule to publish a report to HTML format, the names of page navigation links in the report, such as First, Previous, Next, and Last, can be localized according to your requirements. For details, refer to Localizing the page navigation links in HTML report outputs.

Scheduling reports with dialog


You can schedule tasks for a specified report with dialog as follows: 1. On the JReport Console > Reports page, browse to the report you want to schedule to run. 2. Do either of the following:
r

Select the report row, then on the task bar of the Reports page, click Run > Schedule. Select the report row, right-click in the row and select Schedule from the shortcut menu. Put the mouse pointer over the report row and click the Schedule button toolbar. on the floating

The Schedule dialog is then displayed. 3. In the General tab, select the report tabs you want to run from the report. You can choose multiple normal report tabs or one bursting report at a time (for scheduling a bursting report, see Scheduling a task containing a bursting report). If the report has parameters, specify the parameter values as required (for details, see General tab - Parameters). Then, specify the other options as required. 4. In the Publish tab, specify the type of the task. Six task types are provided by JReport Server: publishing to version, publishing to disk, publishing to e-mail, publishing to printer, publishing to fax and publishing to FTP. Choose the type you want to publish, and then set the settings for the specified type. 5. In the Conditions tab, specify the time for when the task is to be performed in the Time sub tab, and select or create a trigger to bind with the task in the Trigger sub tab. 6. In the Notification tab, specify to notify someone via e-mail of when the task is finished and whether it is successful or unsuccessful. 7. In the Duration tab, specify a time duration for the task, and ask JReport Server to cancel the task or to notify you or someone else of the task status via e-mail if the task has not yet finished running when the task duration is up. For detailed information, see Task-level timeout for advanced run and schedule tasks. Note: By default, the Duration tab is not displayed in the Schedule dialog. To make it available, the Enable Task Duration option on the JReport Administration page > Configuration > Advanced panel must be checked. 8. Click Finish, and JReport Server will then perform the task. See also Schedule dialog for details about the task types and settings in each tab. The following are some specific scheduling examples:
q

Example 1: Publishing a report to the versioning system Example 2: Publishing a report to the file system

Example 3: Publishing a report to e-mail Example 4: Publishing a report to printer Example 5: Publishing a report to fax Example 6: Publishing a report to an FTP site

Example 1: Publishing a report to the versioning system


In this example, a task is set up and will be performed immediately. The generated result is asked to be kept for 30 days. 1. On the JReport Console > Reports page, select the report row, right-click in the row and select Schedule from the shortcut menu to display the Schedule dialog. 2. In the General tab, a. Specify a name for the task in the Schedule Name text box. b. Assign a priority to the task from the Priority drop-down list. c. In the Enter Parameters section, select the report tabs you want to run from the report. d. If the report has parameters, specify the parameter values as required. e. Expand the Report Information section, click Select Another Catalog to specify another catalog for the report if required. f. Select the report version and catalog version from the corresponding drop-down lists. g. Expand the Advanced section, if the report has a style group, check the Enable Style Group checkbox and choose the style group. h. Check the Enable Converting Encoding option if required and specify the encoding before and after converting from the corresponding drop-down lists. i. Enter a name for the task in the Name of the schedule field. j. Define the encoding for the report by selecting from the drop-down list. k. Check Use the default DB user and password defined in catalog. l. Check the Add TaskListener to be Invoked option, and input the class name (for details, see Adding TaskListener). m. Check the Enable Auto Recover Task option to specify auto recovering settings. 3. In the Publish tab, a. Click the To Version sub tab, then check Publish to Versioning System. b. Select the required formats and set the format settings. c. Check the Built-in Version Folder option in Archive Location to save the report result version in the built-in version folder. d. Set 0 for the Maximum Number of Versions. e. Check the Result Auto-delete option and define the result to expire in 30 days. 4. In the Conditions tab, select the Time sub tab, define the time zone from the Time Zone dropdown list, then from the Time Type drop-down list, choose Run this task immediately. 5. If you want to notify someone of when the task is finished by sending an e-mail, go to the

Notification tab and then set the settings. 6. If you want to specify a timeout for the task, specify the settings in the Duration tab as required. 7. Click Finish to have the task performed. Then, click My Tasks on the system toolbar. While the task is being performed, you can see a record of it in the Running tab. On completion it will be put into the Completed tab. Notes:
q

When publishing a report to XML format, if you want to use the URL to get the .xsd file, follow the steps below: 1. Put the existing XML schema file in <intall_root>\public_html. 2. Input [Link] address:8888/name of the existing XML schema file.

There is another way to publish the report result to version. If you have set the property server. [Link] to true in the [Link] file in <install_root>\bin, or selected the option Enable "Publish to Versioning System" for Background Tasks View on the JReport Administration page > Configuration > Advanced panel, you will get the link Publish to Version System on the system toolbar of the JReport Console page. Click the link to publish the result to version.

Example 2: Publishing a report to the file system


In this example, you will learn how to set up a task to publish the report result in various file formats to the file system repeatedly at the start of each month. 1. Take steps 1 and 2 as in Example 1. 2. In the Publish tab of the Schedule dialog, click the To Disk sub tab, select the required format, specify the result location, and set the format settings according to your requirements. 3. In the Conditions tab, a. In the Time sub tab, define the time zone from the Time Zone drop-down list, then from the Time Type drop-down list, choose Run this task periodically. b. In the Duration box, specify a time period for when the task will be performed. c. Select Monthly from the Date drop-down list and keep the default to run the first day of every 1 month. d. Keep the Time settings as default. e. If you also want to set an event which needs to occur before running the report, select a trigger to bind with the task from the Select a trigger to bind drop-down list in the Trigger sub tab, then specify the trigger logic with time condition. For detailed information about the logic between the trigger condition and the time condition, see Trigger tab. 4. If you want to notify someone of when the task is finished by sending an e-mail, go to the Notification tab and set the settings. 5. If you want to specify a timeout for when the scheduled report will be allowed to run, specify the settings in the Duration tab as required. 6. Click Finish to have the task performed. Then, click My Tasks on the system toolbar, you will see that the scheduled task has been recorded in the Scheduled tab. Since you have not specified the duration Run until a time for this task, it will not stop being performed until you delete or disable it from the Scheduled tab. Notes:
q

When you specify to publish the report result to the server resource tree, if the specified folder has a real path, the result will be put to the real path. Otherwise it will be put to the default disk location where server resources are. If you specify to publish the report result to a non-existent folder on disk, JReport Server will automatically create it. If you use a fixed name to perform the task periodically, only the most recently generated report result will be kept. In order to keep the report result generated every time, you should use the dynamic result file name. Similarly, you are able to input the dynamic directory path to avoid report management difficulties, since when a fixed directory path is specified, too many results may be generated in one directory. For more information, see Appendix 5: Dynamic names.

Example 3: Publishing a report to e-mail


In this example, you will learn how to set up a task to publish the report result to e-mail. 1. Take steps 1 and 2 as in Example 1. 2. In the Publish tab of the Schedule dialog, click the To E-mail sub tab, then from the Mail To list, select to whom the report result will be sent. If required, click the Edit button to edit the specified e-mail. If you want to create another e-mail, click the New button, then fill in every field, select the format in which you want to export the report result and set the settings according to your requirements. When you choose to specify a report result as an attachment to e-mail, you need to specify a file name for the attachment. For details about settings of creating a new e-mail, refer to Schedule dialog - To E-mail. 3. In the Conditions tab, select the Time sub tab, define the time zone from the Time Zone dropdown list, then from the Time Type drop-down list, choose Run this task immediately. 4. If you want to notify someone of when the task is finished by sending an e-mail, go to the Notification tab and set the settings. 5. If you want to specify a timeout for the task, specify the settings in the Duration tab as required. 6. Click Finish to have the task performed. Then, click My Tasks on the system toolbar. When the task is being performed, you can see a record of it in the Running tab and on completion it will be put into the Completed tab.

Example 4: Publishing a report to printer


In this example, you will learn how to set up a task to publish the report result to a printer. 1. Take steps 1 and 2 as in Example 1. 2. In the Publish tab of the Schedule dialog, a. Select the To Printer sub tab and then check Publish to Printer. b. Select a JDK print method for the report result in the Select Print Method field. c. Type a name with the path of the printer in the Printer field. 3. In the Conditions tab, select the Time sub tab, define the time zone from the Time Zone dropdown list, then from the Time Type drop-down list of the Time tab, choose Run this task immediately. 4. If you want to notify someone of when the task is finished by sending an e-mail, go to the Notification tab and set the settings. 5. If you want to specify a timeout for the task, specify the settings in the Duration tab as required. 6. Click Finish to have the task performed. Then, click My Tasks on the system toolbar. When the task is being performed, you can see a record of it in the Running tab and on completion it will be put into the Completed tab. Note: When there is no printer connected with JReport Server, and you schedule to publish a report to a printer, the server may crash or throw an exception.

Example 5: Publishing a report to fax


In this example, you will learn how to set up a task to publish the report result to fax. Before you can fax the report result, you must first have your modem configured. Otherwise a warning message will be displayed when you try to export to fax. 1. Take steps 1 and 2 as in Example 1. 2. In the Publish tab of the Schedule dialog, click the To Fax sub tab, check the Publish to Fax option and then fill in every field and set the settings according to your requirements. 3. In the Conditions tab, select the Time sub tab, define the time zone from the Time Zone dropdown list, then from the Time Type drop-down list, choose Run this task immediately. 4. If you want to notify someone of when the task is finished by sending an e-mail, go to the Notification tab and set the settings. 5. If you want to specify a timeout for the task, specify the settings in the Duration tab as required. 6. Click Finish to have the task performed. Then, click My Tasks on the system toolbar. When the task is being performed, you can see a record of it in the Running tab and on completion it will be put into the Completed tab.

Example 6: Publishing a report to an FTP site


In this example, you will learn how to set up a task to publish the report result to an FTP site. 1. Take steps 1 and 2 as in Example 1. 2. In the Publish tab of the Schedule dialog, a. Click the To FTP sub tab, then click the New button to set up a new FTP site or click the Edit button to edit a specified FTP site in the FTP To list. b. Fill in every field, select the format in which you want to send the report results and then set the settings according to your requirements. 3. In the Conditions tab, select the Time sub tab, define the time zone from the Time Zone dropdown list, then from the Time Type drop-down list, choose Run this task immediately. 4. If you want to notify someone of when the task is finished by sending an e-mail, go to the Notification tab and set the settings. 5. If you want to specify a timeout for the task, specify the settings in the Duration tab as required. 6. Click Finish to have the task performed. Then, click My Tasks on the system toolbar. When the task is being performed, you can see a record of it in the Running tab and on completion it will be put into the Completed tab. Note: Dynamic result name for FTP task is currently not supported.

Scheduling reports via URL


A schedule contains two kinds of properties. The first is about time information and the second is about task information (for detailed information about each property, see Appendix 7: Properties - scheduling reports via URL). When reports are scheduled via URL in a web browser, the method jrs.submit_schedule is called. The following is a description of this method.
q

Constant: [Link].CMD_SUBMIT_SCHEDULE Description: Submits a scheduled task to JReport Server. If the report has no parameters then it directly run the URL. If the report has parameters and no parameter specified in the URL or the parameters provided in the URL fail to include all necessary parameters, the server then returns the parameter dialog for entering parameter values. HTTP Method: GET/POST. Response: Returns the task ID to JRClient API, and returns the scheduled tasks page to web browsers.

Specifying parameter values using dialog when scheduling reports via URL
When scheduling a report via URL, if the report contains parameters, you need to manually enter the parameters in the URL string without any mistakes. You may find this painful sometimes because it's not easy to remember all parameters in a report. However, JReport provides you with the special command jrs.submit_schedule, which enables to display the Enter Parameter Values dialog to manage parameters. The display of the parameter dialog requires:
q

The report has parameters. The URL contains the command jrs.submit_schedule. No parameter specified in the URL or the parameters provided in the URL fail to include all necessary parameters.

With the above three conditions fulfilled, the Enter Parameter Values dialog will be displayed right after you finish the URL in the address bar and make it run. After setting the values and clicking OK in the dialog, JReport Server will append the values to the URL string for you and execute the URL. However, if you click Cancel in the dialog, the URL running will be cancelled. Tip: If you want to specify parameters via dialog when scheduling reports via URL, the most effective way to display the parameter dialog is that you do not specify parameters at all in the URL.

URL examples
The following are some specific examples on how to schedule a report via URL. The report [Link] that uses the catalog /SampleReports/[Link] is used in these examples.

Publishing to the versioning system immediately To publish the report to the versioning system immediately, the URL used for this task could be as below:
q

To RST [Link] 2fSampleReports%[Link]&jrs.task_class=[Link]. PublishRptTask&jrs.launch_type=0&[Link]$P_StartDate=01/01/2006&[Link] $p_EndDate=12/31/2007&[Link]=admin&jrs.to_version=true&jrs.to_version_rst=true&jrs. report=%2fSampleReports%[Link] To PDF [Link] catalog=%2fSampleReports%[Link]&jrs.task_class=[Link]. [Link]&jrs.launch_type=0&[Link]$P_StartDate=01/01/2006&[Link] $p_EndDate=12/31/2007&[Link]=admin&jrs.to_version_pdf=true&jrs.to_version=true&jrs. report=%2fSampleReports%[Link]

If you want to publish the report to other formats, you can refer to the examples above, but you will need to modify the parameter jrs.to_version_pdf=true to suit the particular format that the report will be published to. For example, if you want to publish the report to Excel, you will need to change the parameter to jrs.to_version_excel=true. Publishing to the versioning system periodically To publish the report to the versioning system periodically, the URL used for this task could be as below: [Link] [Link]&jrs.hour2=5&jrs.task_class=[Link]. PublishRptTask&jrs.to_version=true&jrs.to_version_html=true&jrs.is_between=true&jrs. is_weekday=false&jrs.launch_type=8&jrs.min2=0&jrs.is_pm=false&[Link]=9&jrs. is_pm2=true&[Link]$P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&jrs. uid=admin&[Link]=1&jrs.is_hourly=true&jrs.at_min=0&jrs.days_id=0&[Link]=1&jrs. timezone=CTT&[Link]=0&jrs.expire_days=30&[Link]=%2fSampleReports% [Link]&jrs.rpt_language=en&jrs.report_sheet$Report=true&jrs. schedule_name=periodicalTask Publishing to the versioning system at a specific time To publish the report to the versioning system at [Link] CST, December 1, 2008, the URL used for this task could be as below: [Link] [Link]&jrs.task_class=[Link]&jrs. to_version=true&jrs.to_version_rst=true&jrs.launch_type=1&[Link] $P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&[Link]=admin&jrs.exe_day=1&jrs. exe_month=12&jrs.exe_hour=12&jrs.exe_min=00&jrs.exe_year=2008&jrs.expire_days=30&jrs. report=%2fSampleReports%[Link]&jrs.report_sheet$Report=true&jrs. schedule_name=atTimeTask Publishing to the versioning system immediately and notifying others of success or failure To publish the report to the versioning system immediately, and notify the user support1, support2, and support3 of success or failure, the URL used for this task could be as below: [Link] [Link]&jrs.task_class=[Link]&jrs.

launch_type=0&[Link]$P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&jrs. uid=admin&jrs.expire_days=30&[Link]=%2fSampleReports%[Link]&jrs. to_version=true&jrs.to_version_rst=true&jrs.success_notify=true&jrs. fail_notify=true&jrs.notification_emails=To%3A+person1@[Link]%0D%0ACc%3A +person2@[Link]%0D%0ABcc%3A+person3@[Link]%0D%0A Publishing to the file system immediately To publish the report to the file system immediately, the URL used for this task could be as below:
q

To RST [Link] catalog=%2fSampleReports%[Link]&jrs.task_class=[Link]. [Link]&jrs.launch_type=0&[Link]$P_StartDate=01/01/2006&[Link] $p_EndDate=12/31/2007&[Link]=admin&jrs.to_disk_rst_path_type=1&jrs.rst_dir=C:\&jrs. to_disk=true&jrs.to_rst=true&[Link]=[Link]&[Link]=%2fSampleReports% [Link]& To PDF [Link] 2fSampleReports%[Link]&jrs.task_class=[Link]. PublishRptTask&jrs.launch_type=0&[Link]$P_StartDate=01/01/2006&[Link] $p_EndDate=12/31/2007&[Link]=admin&jrs.to_disk_pdf_path_type=1&jrs.pdf_dir=C:\&jrs. to_disk=true&jrs.to_pdf=true&[Link]=[Link]&[Link]=%2fSampleReports% [Link]&

Note: If you want to publish a report to a disk path, for example, jrs.rst_dir=C:\, you can do the same as the example described above. If you want to publish a report to a resource tree, for example, jrs. rst_dir=%2fSampleReports, you can omit this parameter &jrs.to_disk_pdf_path_type=1 in the above example and replace jrs.pdf_dir=C:\ with jrs.rst_dir=%2fSampleReports. Here SampleReports is the resource path. Publishing to e-mail immediately To publish the report to e-mail immediately, the URL used for this task could be as below: [Link] catalog=/SampleReports/[Link]&[Link]=/SampleReports/CustomerAnalysis. cls&jrs.task_class=[Link]&jrs.to_mail=true&jrs. jrmail0=[Link]%3dperson@[Link]%[Link]%3dreport&jrs. launch_type=0&[Link]$P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&jrs. uid=admin&jrs.rpt_language=en Publishing to printer immediately To publish the report to a printer immediately, the URL used for this task could be as below: [Link] [Link]&jrs.task_class=[Link]&jrs. launch_type=0&jrs.to_printer=true&[Link]=%2fSampleReports%2fCustomerAnalysis. cls&[Link]$P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&jrs.rpt_language=en Publishing to fax immediately To publish the report to a fax immediately, the URL used for this task could be as below: [Link] catalog=%2fSampleReports%[Link]&[Link]=%2fSampleReports% [Link]&jrs.task_class=[Link]&jrs.

launch_type=0&[Link]$P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&jrs. uid=admin&jrs.to_fax=true&jrs.to_fax_is_include_cover=false&jrs. to_fax_to_fax_number=888888 Publishing to FTP immediately To publish the report to an FTP site immediately, the URL used for this task could be as below: [Link] [Link]&[Link]=%2fSampleReports%[Link]&jrs. task_class=[Link]&jrs.launch_type=0&[Link] $P_StartDate=01/01/2006&[Link]$p_EndDate=12/31/2007&[Link]=admin&jrs. to_FTP=true&jrs.ftp0=[Link]%3d192.168.0.0%[Link]%3d21%[Link]%3dftpuser% [Link]%3d1234%[Link]%3d%2ftest%[Link]%3dtrue

Related topics:
q

Setting dynamic parameter values when running or scheduling a report via API

Scheduling a task containing a bursting report


In a large enterprise reporting deployment, it is important to handle both large amounts of data as well as a large number of users. Report bursting enables running a report once and distributing the report results to multiple recipients who each will receive a subset of the report results. Bursting reports can be distributed to e-mail or FTP addresses, to disk, to the JReport versioning system, or to the security system members such as users, groups, and roles. End users can submit a schedule task which contains only one bursting report to JReport Server. When a bursting task is activated, it will create a main bursting task and some sub bursting tasks. The system will guarantee bursting tasks compete with normal tasks for system resources. The bursting tasks can be given lower priority if desired (set [Link] to 1).
q

Main bursting task: It is responsible for getting/splitting data and distributing work to the sub tasks. There can be only one main bursting task for a sub bursting task. Sub bursting task: It is responsible for generating the report result according to split data and sending the result to the address of the bursting recipient.

For details about what is a bursting report and how to design a bursting report, see Report Bursting in the JReport Designer User's Guide. On JReport Server, direct running and advanced running actions support normal reports but not bursting reports. A report containing only bursting report tabs cannot be run directly, it must be scheduled. Scheduling supports both types of reports excluding the combination of the two types: for normal reports, multiple reports can be scheduled at a time; however for bursting reports, only one can be scheduled. For a scheduled bursting task, seven kinds of result file formats are supported: HTML, PDF, Excel, Text, RTF, XML, and PostScript. In addition, when scheduling to run a bursting report, you can make it generate not only the bursting result by applying bursting schemas but also the non-bursting result based on whole data without data splitting.

Scheduling a bursting report to generate bursting result


Though a bursting report may have one or more bursting schemas, you need apply one or more of them in order to get a bursting result. To do this, select a bursting report and schemas, and then specify required parameter values in the General tab of the Schedule dialog. Then a tab named Bursting Result is displayed in the Publish tab and only the corresponding sub tabs are available that are defined in the selected bursting schemas' recipients in JReport Designer. For example, a bursting report has three bursting schemas: Schema 1 defines recipient E-mail and Disk, Schema 2 defines recipient FTP, and Schema 3 defines recipient JReport Server Version. If Schema 1 and Schema 3 are selected, only To E-mail, To Disk, and To Version sub tabs will be shown in the Bursting Result tab of the Publish tab for the bursting result. The following list tells which tab will be displayed in the Publish > Bursting Result tab of the Schedule dialog for which recipient address specified in bursting schema.
Recipient E-mail FTP Sub tab in the Publish tab To E-mail To FTP

Disk JReport Server Version JReport Server User/Group/Role - User Private Folder

To Disk To Version To Version

JReport Server User/Group/Role - User E-mail To E-mail

When scheduling a bursting report, specifying the destination is suppressed in the Publish tab since the recipient addresses have been included in the bursting schema. However, you are allowed to give a file name to the subset of report result instead of using the default name.

Default name for bursting result files


Sometimes you may not want to specify a file name for each bursting result when defining recipients. The bursting system will give it a name as generated by the system. The default name format is: ReportName + "_" + BurstingKey + suffix (result format type). When there are multiple bursting key columns, connect each one by the character "_". Converting to String When a bursting key is of one of the following data types, it will be converted into String so as to make a valid result file name:
q

Integer, Float, Character: Same as Java, these data types are transferred to string directly. Date and Time: All data and time formats will be transferred to a date format: yyyy-MM-dd hh:mm: ss. Currency: Currency will be transferred to the number without the currency mark ($ or others).

Name length In the JReport Server resource system, the resource name only supports up to 64-character length. If a bursting result file name is longer than that, the system will trim it down automatically. In order to avoid using the same name in the same path, an index will be appended to the result name, for example: report1_USA_Maryland1.pdf, report1_USA_Maryland2.pdf. Notes:
q

All bursting sub results will apply the security information of the bursting task submitter. When running a report containing both normal and bursting report tabs: For direct running: When running it to DHTML format, only the normal report tabs are opened. When running it to other formats, if the default focused report tab is a normal report, it will be run directly; otherwise if the default focused report tab is a bursting report which cannot be run, a warning message will be displayed asking the end user to select a normal report tab to run using advanced run. For advanced running: It is allowed to only choose among the normal report tabs.

Scheduling a bursting report to generate non-bursting result

Besides generating bursting result for a bursting report, you can also generate non-bursting result for the report without applying any bursting definition, which is based on full data without data splitting. To generate non-bursting result, select the Non-bursting result option in the General tab of the Schedule dialog. Then a tab named Non-bursting Result appears in the Publish tab, and all these sub tabs - To Version, To Disk, To E-mail, To Printer, To Fax, and To FTP - are available in this tab for the non-bursting result.

Scheduling a customized task using User Task


In order to meet the requested requirement to run tasks defined outside of JReport on JReport Server, and to just use JReport Server's schedule function, JReport has provided a task named User Task. With this task, you can implement a customized task with the schedule properties. You can also submit the user task from a web page, or by calling the JReport Server API methods. To schedule a customized task using User Task: 1. Create a task class that implements the UserTask interface and add the path of the class file to the class path. You can find the interface in the [Link] package available in <install_root> \help\server\en\api. JReport provides a demo class [Link] in <install_root>\help\server\en\samples for your reference. 2. Create a task properties file defining the formats of exporting the task. For example, the content of the properties file is: [Link]=result_rtf [Link]=true [Link]=true [Link]=true [Link]=true [Link]=result_html

3. Submit the task either from a server web page or by calling Server API methods. The task can then be run by the server.
r

To submit the customized task from a server web page: a. On the JReport Console > Reports page, browse to the desired report, put the mouse pointer over the report row and click the Schedule button Schedule dialog is then displayed. on the floating toolbar. The

b. Specify the settings in the General, Publish, Conditions, and Duration tabs as required. Here the Publish tab settings should be switched to those of User Task by clicking the link on the right bottom of the tab. Then, the name of the task class file you have defined that implements the UserTask interface and the task properties that define the export formats must be provided. You can either input the task properties manually or import them from the task properties file that you have created. c. Upon finishing, click Finish to submit the task.
r

To submit the customized task by API methods: a. Set the user task class name to the property value of APIConst.TAG_TASK_CLASS. b. Define the user task properties with the property APIConst.TAG_USER_TASK_PROP with the formats as follows: jrs.user_task_prop= [Link]=result_rtf&[Link]=true&jrs. text=true&[Link]=true&[Link]=true&[Link]=result_html. Since the jrs.user_task_prop is used to transfer multiple user task properties, the values set to this property must be formatted to be separated with "&" character.

c. Set a display name for the class with the property APIConst. TAG_USER_TASK_DISPLAY_NAME. d. Except for the above properties, define the other schedule properties as you do with a default task, see [Link] in <install_root>\help\server\en\samples for reference. Then following the API demo you can submit a customized task on the server. Click My Tasks on the system toolbar. When the task is being performed, you can see a record of it in the Running tab and on completion it will be put into the Completed tab. Note: You can either schedule to use the Default Task or the User Task at one time. If you specify to schedule a report as a default task, you will not be able to schedule it as a user task, and vice versa.

Recording scheduled tasks


JReport Server records every scheduled task. Click My Tasks on the system toolbar of the JReport Console page, then the following tabs will be displayed: Scheduled, Running, and Completed. The tasks are recorded in different tables according to their executing status. A task is placed in the Scheduled table as soon as it is submitted by the user. It will go to the Running table when it is running, and when it is finished by JReport Server, it will then go to the Completed table.

Related topics:
q

Managing tasks

Viewing scheduled report results


When a scheduled task is finished, you can view the results of the scheduled report as required. To view the results, first of all you need to know the corresponding results' location. To get the location information: 1. On the JReport Console page, click My Tasks on the system toolbar, then click the Completed tab, where all the successfully scheduled tasks are recorded. 2. Locate the task in the tab and click the name of the task in the Schedule Name column. 3. In the Result Details table, the location information of the scheduled results are available in the Details column.

Viewing results scheduled to version


To view report results that are scheduled to version, you can choose whether to view via the JReport Console page or via URL.

Viewing via the JReport Console page


One way to view results that are scheduled to version on the JReport Console page is via the scheduled task records. To do this: 1. Click My Tasks on the system toolbar, then click the Completed tab. 2. In the tab, locate the right task and click the name of the task in the Schedule Name column. 3. In the Result Details table, the links to different result formats are available for viewing in the To Version row. And another way to achieve the same purpose is via the server resource tree which to some extent varies with the archive location type specified in the Publish > To Version tab:
q

If the archive location has been set to Built-in Version Folder: 1. On the JReport Console > Reports page, browse to the row that the original report is in. 2. Do either of the following:
s

Select the report row and click Tools > Version on the task bar of the Reports page. Select the report row, right-click in the row and select Version from the shortcut menu. Put the mouse pointer over the report row and click the Version button toolbar. on the floating

3. In the Report Result Versions tab, the scheduled results of different format types are listed in the Result column. Click the format links or action buttons to view the results.
q

If the archive location has been set to My Reports Folder or Public Reports Folder, which requires providing a path and a name for the scheduled result in the server resource tree:

1. On the JReport Console > Reports page, browse to the row that the result is in. 2. Put the mouse pointer over the result row and click the Version button on the floating toolbar (or you can use one of the other two methods shown in the above procedure to display the version table). 3. In the Result Versions tab, the scheduled results of different format types are listed in the Result column. Click the format links or action buttons to view the results. Tip: The unviewed version results are highlighted in bold. You can cancel the highlighting by setting the property [Link].mark_unviewed to false in the [Link] file in <install_root>\bin.

Viewing via URL


For the report results that are scheduled to version, you can also view them via URL. One important thing in the URL method is that you need to know the file name of the result that you want to view. To get this information, you can take the steps explained at the beginning of the document. Using command jrs.view_ver_rst See the example: [Link] [Link]=jrs.view_ver_rst& jrs.hist_file=1%5cJReport_System_User327406359%[Link]&jrs. result_type=1. See details about the usage of the command jrs.view_ver_rst. Using [Link] For example: [Link] rst_version=2&jrs.ver_suff=.html& [Link]=%2fSampleReports%[Link]&type=rstfile&[Link]=% 2fSampleReports%[Link] Notes:
q

To view RSD version results using JSP, you should use [Link] instead of [Link]. For example: [Link] Banded_Link.cls&type=rstfile&[Link]=/SampleReports/Banded_Link.cls

When viewing a scheduled DHTML report result with cached report bursting via URL, you should add jrs.is_pls_result=true in the URL, for example: [Link] jrs.rst_version=1&jrs.is_pls_result=true&[Link]=/SampleReports/PLS. cls&type=drstfile&[Link]=/SampleReports/[Link]

Viewing results scheduled to disk


When scheduling a page report to disk,
q

If you choose Publish to Server Disk Path, you are required to provide a disk file path and file name

with correct format type as the suffix for each report tab in the report. After scheduling succeeds, you can find the corresponding result files available at the specified location on the computer where JReport Server is installed.
q

If you choose Publish to Server Resource Tree, you are required to provide a path following the server resource tree and file name with correct format type as the suffix for each report tab in the report. For example,
r

To follow the My Reports folder path, start with "/USERFOLDERPATH/admin/". Example: /USERFOLDERPATH/admin/[Link]

To follow the Public Reports folder, start with "/". Example: /SampleReports/[Link].

If the specified folder which is the parent folder of the result file has a real path, the generated result file will be saved to the real path; if the folder doesn't have a real path, the generated result will be saved to <server_install_root>/jreports/, which is the mapped disk path of the root node "/" in the specified path.

Viewing results scheduled to e-mail/printer/fax/FTP


When a report is scheduled to e-mail, printer, fax, or FTP, you can view the scheduled results if the specified addresses or locations are available to you.

Importing and exporting scheduled tasks


In JReport Server, you can export a scheduled task to a script file which will then be saved on your own disk as a script file. In addition, you can import a script file from the disk file to generate a scheduled task. To export a scheduled task to a script file and save it in the disk: 1. On the JReport Console page, click My Tasks on the system toolbar. 2. In the Scheduled tab, select the rows that one or more scheduled tasks are in. 3. Click Tools > Export to Script on the task bar of the My Tasks page (if only one task is selected, you can also right-click in the task row and select Export to Script from the shortcut menu, or put the mouse pointer over the task row and click the Export to Script button toolbar), then modify the script text in the Edit Script box as required. 4. Click OK to export the specified scheduled task to a script file. 5. Specify the directory and name for this script file in the File download dialog. To import a script file from your disk: 1. On the JReport Console page, click My Tasks on the system toolbar, then select the Scheduled tab. 2. Click New Schedule on the task bar of the My Tasks page. 3. In the New Schedule dialog, check the option Import Script to Create Schedule. 4. Click the Browse button to select a script file from your disk file, then click OK to import the specified script file and modify the script text in the Edit Script box as required. 5. Click OK to generate a scheduled task. Note: If you just updated from an older version of JReport Server, there may be some old scripts saved in your server. In order to use these old scripts, you can click the Import old script from server link in the Import Script page to select an old script to import it to generate a scheduled task. To use this link, you must logon JReport Server as an administrator role. on the floating

Adding TaskListener
When viewing or scheduling a report, JReport Server enables you to call your Java application before or after the process. In JReport Server, a TaskListener interface has been provided in the package [Link] for receiving task events before or after running. You can specify one Java class to implement this interface for a task event. When the event of this task occurs, the corresponding methods in the listener will be invoked. The interface contains two methods: beforeRun and afterRun, enabling you to set your Java application call before or after the process of viewing a report or setting up a schedule. Your applications will return true or false. For true, JReport Server will go on running. While for false, JReport Server will stop there. Below is an example illustrating how to add TaskListener when setting up a schedule on a report. 1. Develop your Java class to implement the interface. Here [Link] is used, which is available in <install_root>\help\server\en\samples. 2. Compile [Link] to generate the class file. 3. Edit the batch file [Link] in <install_root>\bin, which is used to start JReport Server. Assuming that TestTaskListener has been saved in c:\JReport\Server\tasklistener, add the path of the class file (c:\JReport\Server\tasklistener) to the ADDCLASSPATH variable in [Link]. 4. Start JReport Server and set up a schedule on a report, check Add TaskListerner to be Invoked in the General tab of the Schedule dialog, then input the class name. In this example, input TastListener, and then submit the task. 5. In this example, the class returns True. Print out the task and schedule properties before and after running the task. You will then get task and schedule information in the command window before and after the task is run. You can also define properties of your own and transmit them through ServerInfo. To do this, use APIConst.TAG_USERDEFINED_PROPERTY_PREFIX as the prefix for the properties. For example, if you want to transmit the properties host_name, host_ip and hosp_protocol, you will need to insert the properties, before calling the method runTask, into the properties named prop, as follows: [Link](APIConst. TAG_USERDEFINED_PROPERTY_PREFIX+"host_name", "host"); [Link](APIConst. TAG_USERDEFINED_PROPERTY_PREFIX+"host_ip", "[Link]"); [Link](APIConst. TAG_USERDEFINED_PROPERTY_PREFIX+"host_protocol"+ "TCP/IP");

You can get the value of the properties listed above through the server info object, serverInfo, in the method beforeRun or afterRun of the TaskListener class. See the example below:

host_name=[Link]().get(APIConst.TAG_USERDEFINED_ PROPERTY_PREFIX+"host_name"); host_ip=[Link]().get(APIConst.TAG_USERDEFINED_ PROPERTY_PREFIX+"host_ip"); host_protocol=[Link]().get(APIConst.TAG_USERDEFINED_ PROPERTY_PREFIX+"host_protocol");

Note: All properties without the prefix APIConst.TAG_USERDEFINED_PROPERTY_PREFIX will be denied and discarded by JReport Server.

Using JSPs to print reports


JReport Server provides the following demo JSPs which enable you to print a report without any view in the client side, and they are contained in the zip file [Link] in <install_root>\help\server \en\samples.
q

[Link] Provides frames to load [Link] and [Link]. [Link] Shows how to set parameters for printing the demo report [Link] by using the ViewerApplet. This JSP calls [Link]. If you want to print the other reports, you can follow this JSP file as an example to write your own JSP. In your own JSP, you should modify the values of "cat" and "rptName". String cat = "/SampleReports/[Link]"; //[Link](APIConst. TAG_CATALOG); String rptName = "/SampleReports/[Link]"; //[Link] (APIConst.TAG_REPORT);

[Link] Shows how to print reports by using the ViewerApplet. The example JSP [Link] calls this JSP.

Before running the JSPs, you should unzip and copy them to <intall_root>\public_html\jinfonet. Then, start JReport Server and access [Link] using the URL [Link] jinfonet/[Link]. The following page appears:

PrintInCurrentFrame Set to call [Link] and load applet of JReport Viewer Frame. PrintInHiddenFrame Set to call [Link] without loading applet of JReport Viewer Frame. Reset Reset the previous options. View View this report. Interactive If checked, you could specify the print setup in the Print dialog.

Background If checked, the print job will run in the background. UseJDK11 If checked, you will use instance PrintJob of JDK11 to print the report. Wait If checked, you have to wait until the print job is finished. SeparateLargePage If checked, the large page will be separated into several pages automatically. NotifyComplete This parameter is used with the parameter wait. After the print job is finished, a box will pop up to note you, and you could do any other work instead of keep on waiting. Printer Specify the printer to implement the print job.

JReport Viewer - Interactive Reports (Dynamic HTML Reports)


With JReport Server, you can obtain report results in different formats, such as HTML, PDF, and Excel. For the HTML format, there are two viewing modes - pure HTML or Dynamic HTML. JReport Viewer provides a dynamic report view at the client side. You can change options which enable the results to be displayed to your requirements. Interactive information empowers you to slice and dice your business data, to dynamically change your view of data, and to analyze the data to glean useful business information. In short, interactive information enables you to customize your view of business information. With JReport, any report can be made interactive, extending the "life" of the report by allowing you to easily sort, navigate, and filter data via JReport Viewer. This wide range of functionality, including the ability to drill down on data, enables you to quickly derive value from your business intelligence data. JReport Viewer provides support for many features, such as Filter, Sort, Drill-to, Drill-down, Drill-up, Navigation (TOC), Search, and save the results. JReport Viewer also supports a web design feature, allowing you to create reports using report oriented data structures, save your report, and even save your custom modifications to existing reports. This chapter covers the following topics to help you better understand how JReport Viewer makes reports interactive and how you will benefit:
q

JReport Viewer window elements Viewing reports in JReport Viewer General operations Ad hoc reporting DHTML based reporting Analytic reporting Applying a style Working with reports via URL Tuning JReport Viewer performance

JReport Viewer window elements


The main page of JReport Viewer consists of the user information bar, menus, toolbar, page report bar, Toolbox, Resource View panel, TOC Browser, and report area. The options for browsing or controlling a DHTML report are as follows:
Toolbar/ Menu File Button Tool Name New Page Report Tab Description Creates a new report tab to the current page report based on an existing business/report cube. Creates a new page report containing a report tab based on an existing business/ report cube. Opens the Open Report Tabs dialog for you to open/close report tabs in current report.

New Page Report

Open

Rename Report Opens the Rename Report Tab Tab dialog to give the open report tab a new name. Close Report Tab Closes the current report tab if there is more than one report tab open in the report; or prompts you to close the report if there is only one report tab. Deletes the current report tab if there is more than one report tab open in the report. This command is disabled when the last page of the current report tab does not display if Format Page on Demand in the Configure DHTML Profile > Properties > Advanced tab is selected. Saves the report as a report version. Saves a copy of the report. Exports the report result to disk or version in various formats. Shows the Page Properties dialog for you to specify the page layout settings for the report result. Shows the Printable Version dialog for you to print the current report result to a PDF/ HTML file. Closes the current report. Undoes the last operation.

Delete Report Tab

Save Save As Export

Page Setup

Printable Version

Exit Edit Undo

Redo Search View Toolbar

Reverses the operation of Undo. Shows the Search dialog for you to find specific text. Shows or hides toolbars.

User Shows or hides the User Information Bar Information Bar, which displays the user name, catalog name and report name. Toolbox Shows or hides the Toolbox panel which allows you to insert a component into the report. Shows or hides the Resource View panel, with which you can add cube elements to your report and create dynamic resources to use them in your report. Shows or hides the TOC Browser, with which you can navigate the report data. Shows or hides editing marks (dashed outlines for objects and report body). If the option is unselected, the editing mark will not be shown when a report object receives focus, and report objects cannot be moved or resized. Provides a submenu for you to turn the report pages. Runs the report using previously provided parameters. The Refresh operation fetches the data again. Shows the Zoom dialog for you to set a zoom ratio for the report page. Shows the Options dialog for you to set the skin and unit for JReport web, and to customize toolbars. Shows grids in the report area. Snaps an object to grids when you move it by dragging and dropping in the report area. If this option is enabled, aligning objects will be made easier. To temporarily override the setting, press the ALT key as you move an object. Inserts a label into the report. Inserts an image into the report.

Resource View

TOC Browser

Editing Marks

Turn To Refresh

Zoom

Options

Show Grids Snap to Grids

Insert

Label Image

Banded Object Table Crosstab Chart Parameter Control Parameter Form Control Filter Control Navigation Control Special Fields Report Query Filter

Inserts a banded object into the report. Inserts a table into the report. Inserts a crosstab into the report. Inserts a chart into the report. Inserts a parameter control into the report. Inserts a parameter form control into the report. Inserts a filter control into the report. Inserts a navigation control into the report. Inserts special fields into the report. Applies a filter to the business/report cube used by certain component. Filters the report records according to the filter criteria you specify. Sorts the report records or groups in ascending or descending order on the fields you select. Converts a crosstab into a chart. Converts a chart into a crosstab. Rotates a table to switch its appearance between the horizontal and vertical layout modes.

Filter

Sort

To Chart To Crosstab Rotate Table

Rotate Crosstab Rotates a crosstab to exchange the columns and rows in the crosstab in order to create a different view of the crosstab. Merge Split Merges selected tabular cells into one. Splits a tabular cell into the specified number of rows and columns. Allows you to specify the maximum number of records retrieved by all components in the report. Allows you to apply dynamic formulas to control object properties. Allows you to apply a style to the report. Opens JReport Viewer User's Guide.

Max Records

Use Dynamic Formula in Property Style Help User's Guide

Jinfonet Software Home Page Technical Support About JReport Web Standard Toolbar New Report Tab Open

Connects to Jinfonet Software Home Page. Accesses Jinfonet Technical Support. Shows product information about JReport Web. Creates a new report tab based on an existing business/report cube. Brings out the Open Report Tabs dialog for you to open/ close report tabs in current report. Saves the report as a report version. Saves a copy of the report. Exports the report result to disk or version in various formats. Shows the Printable Version dialog for you to print the current report result to a PDF/ HTML file. Undoes the last operation. Reverses the operation of Undo. Deletes the selected object. Shows the Toolbox panel for you to insert a component into the report. Click it again to hide the Toolbox. Shows the Resource View panel, with which you can add cube elements to your report and create dynamic resources to use them in your report. Click it again to hide the Resource View panel. Shows the Filter dialog, with which you can filter the report records according to the filter criteria you specify. Shows the Sort dialog, with which you can sort the report records or groups in ascending or descending order on the fields you select. Shows the Search dialog for you to find specific text. Enables you to enlarge or reduce the size of the report. Rotates a crosstab or rotates a table.

Save Save As Export

Printable Version

Undo Redo Delete View Toolbar Toolbox

Resource View

Filter

Sort

Search Zoom Analysis Toolbar Rotate

Chart Type

Lists all available chart types for you to change the type of a selected chart. Allows you to apply a style to the report. Changes the face and size of the selected font. Available only when a label or field is selected. Makes the selected font in bold, italic or underlined style. Available only when a label or field is selected. Makes the selected font left, center or right aligned. Available only when a label or field is selected. Allows you to specify the number of records retrieved by all components in the report. Displays the current page number. You can also input a page number in the page box and press Enter on the keyboard to go to that page. Goes to the first page of the current report tab. Goes to the previous page. Goes to the next page. Goes to the last page. Goes to the selected report tab or to the selected report tab level. If a report contains several reports tab, you can use this list to switch among the report tabs. Or, after you perform some going or drilling actions on a report tab, the structure of the report tab will be displayed in the list in a hierarchical view, with which you can return to any level of the report tab easily.

Style Font format buttons Font Face, Font Size

Bold, Italic, Underlined

Left, Center, Right

Page navigation buttons

Max Records

Page Number

First Previous Next End Go To dropdown list Go To

More Commands

When the JReport Viewer window is not maximized in Interactive View mode, the button will be displayed on the toolbar, by clicking which you can get all the other toolbar commands the small window hasn't enough space for.

Shortcut Menu

Filter

Provides submenu items for filtering the data in a banded object/table or removing the filtering. Provides submenu items for sorting records on the selected field in ascending/ descending order, or removing the sorting. Drills data to a lower dimension according to predefined hierarchies. Enables you to obtain a different view of data by switching among dimensions.

Sort

Drill Down

Drill To

Drill to By Value Allows you to filter data based on dimensions while also obtaining a more detailed view of the data. Drill Up Drills data to a higher dimension according to predefined hierarchies. Goes to any group to show its record information. Goes up one group level to show the records of a higherlevel group. Goes down one group level to show the records of a child group. Goes to the details of a group. Enables you to add conditional format to the currently selected field. Shows the Search dialog for you to search the report result for some text. Applies a filter to the business/report cube used by the specified data component. Re-fetches data of the specified data component. Shows a dialog for you to define the object's properties.

Go To Go Up

Go Down

Go to Detail Conditional Formatting Search

Query Filter

Refresh Properties

Notes:
q

To simplify the toolbars, when you run a report in JReport Viewer, only some basic toolbar commands are displayed by default. To access more report and analysis commands, click the Interactive View link on the toolbar. However, when you create a new report in JReport Viewer, you will be shown the full menu and toolbar commands. The shortcut menu contents vary with the objects you right-click. The above table only lists some typical shortcut menu items. The following sections will guide you to use the shortcut menu for any object you may right-click.

Viewing reports in JReport Viewer


You can view reports in JReport Viewer either from the user interface or from URLs. Furthermore, you can simultaneously open multiple DHTML reports in respective windows or frames.
q

Viewing from the user interface Viewing by typing URLs Opening multiple reports in one session

Viewing from the user interface


To view a report in JReport Viewer from the user interface, follow the steps below: 1. Start JReport Server and log onto the JReport Console page. 2. Click Reports on the system toolbar, then browse to the folder that contains your report. 3. Use one of the following three methods to display the Advanced Run dialog:
r

Select the report row, then on the task bar of the Reports page, click Run > Advanced Run. Select the report row, right-click in the row and select Advanced Run from the shortcut menu. Put the mouse pointer over the report row, then click the Advanced Run button floating toolbar. on the

4. In the General tab, select any report tab in the report, specify parameter values if any, then click the Format tab, select DHTML from the Select Format drop-down list and click Finish. 5. The report processing page appears, on which you can choose to cancel the running of the report, or to make the report run in background mode. Click Cancel on this page if you decide to cancel, Background if you want the report to run in background mode, or just wait for processing to complete for viewing and interacting with the report. Notes:
q

If you are sure that the viewing format of the last-time focused report is DHTML, you can also click the report name directly to run it in JReport Viewer. Then if the report contains parameters, a dialog will prompt you to assign values to the parameters. When you cancel a report from running, you can choose whether to cancel the running query used by the report in the database at the same time by configuring the [Link] file. For details, refer to Canceling running query.

Running a DHTML report in background mode


When you run a report in DHTML format, if the report contains a large amount of data, you need to wait several minutes before the report results are displayed, and during this period, you have to remain on the report processing page, or choose to cancel the run. Now JReport enables you to switch running reports to background mode. To make a report running in DHTML to run in background mode, on the report processing page, click the Background button. You can also specify to run DHTML reports automatically in background mode after a specified time period by setting preferences. To do this: 1. On the JReport Administration page, click Profile on the system toolbar and then select Configure DHTML Profile from the drop-down menu. Or on the JReport Console page, click Profile on the system toolbar, then click Configure DHTML Profile on the task bar of the Profile page.

2. Click the Properties > Advanced tab. 3. Check Background Mode Timeout and specify the time allowed for a DHTML report to run in foreground mode. 4. Save the settings, then when a report runs in DHTML format and the results have not yet been generated after the specified time, it will be automatically switched to run in background mode. Reports running in background mode are listed in the Background Tasks table of the My Tasks page, which shows detailed running information of the reports, such as report path and name, catalog path and name, running format, time when the task is started/completed, and so on. Also, you can control the status of the reports running in background mode according to your requirements. For example, you can choose to delete, stop, or restart tasks (for details, see Managing tasks in the task tables). When a report completes running in background, you can open it from the Background Tasks table, and once the report is opened, the task will automatically be removed from the table.

Viewing by typing URLs


You can use DHTML servlet or JSPs to run a DHTML report.

Using DHTML servlet


You can call the servlet jrdhtml via URLs to run a report to the DHTML format. For example:
q

[Link] cls? [Link] cls?[Link]=/SampleReports/[Link]&[Link]=/[Link]/ [Link]

Using JSPs
You can use three JSPs to run a report to the DHTML format. They are two Server JSPs, [Link] and [Link], and a DHTML JSP [Link]. The image below illustrates the relationship between these JSPs that are used to run the DHTML reports:

[Link] This is the normal method of accessing reports using URLs. If the report has parameters and the parameters provided in the URL fail to include all necessary parameters, the Enter Parameter Values dialog will be shown for you to specify parameters, otherwise it will directly go to [Link]. Then it will be redirected to [Link] when result type is set to the DHTML format, or else will run to the specified format if the result type is set to other format. The following is an example of running a report to the DHTML format using [Link]: [Link]

2fSampleReports%[Link]&[Link]=%2fSampleReports%2fSampleReports. cat&jrs.result_type=8 [Link] The [Link] functions the same as [Link] when the report has no parameter. When it has parameters, the report runs with the default parameters if no parameter is specified, or else it runs with the parameters specified in the URL. To run a report to the DHTML format using [Link], specify the DHTML format as the result type. See the following example: [Link] 2fSampleReports%[Link]&[Link]=%2fSampleReports%2fSampleReports. cat&jrs.result_type=8 [Link] If you want to include the DHTML JSPs into your own application without other server JSPs, you can use this method. However, you must specify the report parameter values in the URL if there are parameters used by the report. For example: [Link] cat&[Link]=%2fSampleReports%[Link] Tip: When you run a report in DHTML using URL, if you want JReport to automatically refresh the report data at certain intervals, you can set the URL as follows: [Link] [Link]&[Link]=/USERFOLDERPATH/admin/AutoRefresh/[Link]&jrs. auto_refresh_data=true&jrs.auto_refresh_data_time=10

Opening multiple reports in one session


You can open multiple reports in JReport Viewer in one session. This means that each time you run a DHTML report, it will open in a new window. Also, when working in the embedded mode, you can assign frames to the reports, so that more than one DHTML report can be viewed in one window at the same time. In order to illustrate how to view multiple frames in one window, a demo has been provided for you. Follow the steps below: 1. Go to <install_root>\help\server\en\samples to find [Link]. 2. Extract [Link] to <intall_root>\public_html and a folder named MultipleReports will be added in <intall_root>\public_html. 3. Access JReport Server using [Link]

General operations
After having opened a report in JReport Viewer, you can do the following general operations:
q

Managing report tabs A page report can include one or more report tabs. The Go To drop-down list on the toolbar panel or the tabs across the top of the report lists the display names of all the open report tabs in the current report. Clicking the display name of an inactive report tab will make it active. You can manage report tabs in a page report easily as follows:
r

Opening and closing a report tab In a page report, a report tab can be shown or not. To close (hide) the active report tab, click Menu > File > Close Report Tab . If there are one or more report tabs open other than the active report tab, the close action will hide the active report tab; in the case that the active report tab is the only report tab open, the close action will prompt you whether or not to close the report. To open (show) a hidden report tab, click Menu > File > Open (or the Open button on the Standard toolbar) to display the Open Report Tabs dialog, in which the report tabs open in the current report are marked with a check symbol. Check the report tabs you want to open, uncheck the ones you want to close, and then click OK.

Renaming a report tab To rename a report tab, first activate it, then click Menu > File > Rename Report Tab. In the Rename Current Report Tab dialog, specify a new display name for the report tab. Deleting a report tab To delete a report tab, first activate it, then click Menu > File > Delete Report Tab. The only report tab open cannot be deleted. Note: A JReport Live license for JReport Server is required in order to delete report tabs. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license.

Tip: If the administrator has specified to switch report tabs using tabs in the DHTML preferences page, you can easily activate a report tab in a report by clicking the tab representing the report tab on the report tab bar, and closing, renaming and deleting a report tab can also be accomplished by rightclicking the report tab and choosing the corresponding command from the shortcut menu.

q Turning the report pages a report tab includes more than one page, to turn between the report pages, you can

Click the First Page button

, Previous Page button

, Next Page button

, or Last

Page button

on the View toolbar. and press Enter to go to that page.

Input a number into the page box

Click Menu > View > Turn To and then click the corresponding command on the submenu. Use the scroll bar or mouse wheel to scroll up/down the report tab.

Refreshing the report result fetch the data of the current report again, you can click Menu > View > Refresh.
q q

Undoing/redoing actions or

u can undo or redo some actions by clicking Menu > Edit > Undo or Redo (or the Undo button on the Standard toolbar).

do button
q

Configuring JReport Viewer features e JReport Administration page provides default settings for you to use JReport Viewer features, and ntrols whether the settings on the JReport Console page can be configured. A user playing the dministrator" role may change the settings in the JReport Administration page so as to enable or disable me features. Then you can configure JReport Viewer preferences on the JReport Console page, that is, u can decide whether or not to enable the features which have been enabled on the JReport ministration page. After you have made changes to JReport Viewer settings on the JReport Console page d saved them, JReport Viewer features available for you will be consistent with your new settings on the eport Console page. For details, see Configure DHTML Profile.

q Setting JReport Viewer options eport Viewer allows you to set the skin and customize toolbars. To do this:

1. Click Menu > View > Options (or right-click anywhere on the toolbar area and select Options from the shortcut menu). 2. In the Option tab, set the skin of JReport Viewer user interface. 3. In the Customize tab,
r

To modify a toolbar, select it in the Current Toolbar box, remove those unnecessary items from the Selected Tools box, and add required tools from the Available Tools box. Click order of the tools on the toolbar. or to adjust the

To add a toolbar, click to show the New Toolbar Name dialog, then specify the toolbar name, click OK to return to the Options dialog, and set the tools for the new toolbar. To delete a toolbar, select it and click .

4. To load the default settings, including the skin, and the three built-in toolbars, namely Standard, View, and Analysis, click the Restore Defaults button. 5. Click OK to apply the settings. Tip: To close a toolbar, right-click anywhere on the toolbar area, then on the shortcut menu, select the item corresponding to the toolbar name. You can also do this to open an invisible toolbar, such as a newly-created one. The open/close toolbar operation can also be achieved by clicking the corresponding item on the Toolbar submenu of the View menu.

q Showing/hiding user information e User Information bar shows the current user name, catalog path and name, and report path and name. u can click Menu > View > User Information Bar to show or hide the bar.

Tip: Administrators can make this bar open by default. To do this, log onto the JReport Administration page, click Profile on the system toolbar and select Configure DHTML Profile from the drop-down menu. Go to the Properties > Default tab, and then check the User Information Bar option.

q Showing/hiding editing marks JReport Viewer, you can use editing marks (dashed outlines of objects) for purposes such as aligning, ving and resizing. By default, the editing marks are shown only when you create a new blank report in eport Viewer. You can click Menu > View > Editing Marks to switch the status of the editing marks as quired.

Tuning report page magnification

on the View u can zoom in or out the report page by selecting a magnification from the Zoom list olbar. You can also click Menu > View > Zoom to show the Zoom dialog, and then specify the gnification.
q

Asking for help any time, you can click Menu > Help > User's Guide to open the index page of JReport Viewer User's ide. Furthermore, you can click the Help button in any dialog to show the help about the dialog. You can o use the Help menu to open the User's Guide and access Jinfonet Software website for more information.
q

Setting up the page set up the report page, click Menu > File > Page Setup. In the Page Properties dialog, specify the page pe, the orientation, and the margins as required.

q Printing the report result u can print the report result to a PDF/HTML file. To do this, click Menu > File > Printable Version (or

e Printable Version button on the Standard toolbar). In the Printable Version dialog, specify the tings as required and then click OK. The PDF/HTML result file will be opened in an associated program h which you can print the result to a printer.

q Exiting the report you want to close the current report and release the resources, just click Menu > File > Exit (or the Exit

tton which is always on the upper right corner of the JReport Viewer window, or the close button of e browser window). Closing the only report tab open will also prompt you whether or not to close the port. In case that you have modified the report without saving it, JReport Viewer will prompt you to save e report. If you have changed the sort and/or filter criteria, you can check Sort and/or Filter in this dialog save these changes with the report. Click Yes to save the report and close the report.

Ad hoc reporting
Ad hoc reporting allows a business analyst or end user to create a new report, add new objects to an existing report, modify report objects, and save the report or report result. These tasks are performed in the JReport Server environment and do not require use of JReport Designer. This section describes the following ad hoc reporting tasks:
q

Creating a report tab Adding report objects Applying web controls Making simple modifications to report objects Saving the report Exporting the report result

Creating a report tab


In JReport Viewer, you can create a new report tab based on a predefined business/report cube to the current page report. You can also create a new page report containing one report tab and then add report tabs to it. However, the reports created on business/report cubes in JReport Viewer cannot be edited in JReport Designer any further. To create a report tab: 1. In a JReport Viewer window, click Menu > File > New Page Report Tab (or the button the Standard toolbar) to display the New Report Tab dialog. on

If you click Menu > File > New Page Report, the New Page Report dialog will appear for you to create a page report with the first report tab in it. 2. Specify the title of the report tab as required in the Report Title text box. 3. In the Choose Report Layout box, select the required layout with which you want to create the report tab. 4. Click OK to create the report tab.
r

If Blank is selected as the layout, a report tab which is blank will be created. You can then use the Toolbox and the Resource View panels to add objects and cube elements to the report tab. If you select the layout as Banded, Table, Chart, or Crosstab, the corresponding report wizard will then be displayed. Specify the settings according to your requirements.

Also, on the JReport Console > Reports page, you can directly create a new page report (containing a report tab) in a folder into which one or more catalogs containing some business/report cubes have been published. To do this: 1. Open the folder and select the catalog for the new page report from the Catalog drop-down list. 2. On the task bar of the Reports page, click New Report > Report. 3. In the Select Report Type dialog, check the option Page Report and click Ok. 4. In the New Page Report dialog, create the page report containing a report tab as required. Notes:
q

A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license. Before you can create a report tab in JReport Viewer, you need to first make sure that the catalog corresponding to the current page report contains one or more business/report cubes and that the Pop-up Blocker is not enabled on your web browser. You may want to place a hyperlink directly in your application to create a new report. To do this, simply create a URL to your JReport Server and provide the catalog and user name; for example, [Link] 2fSampleReports%[Link] will create a new report using the embedded sample report catalog.

The following topics show in detail how to create a report tab from particular layouts:
q

Creating a banded report Creating a table report Creating a chart report Creating a crosstab report

Creating a banded report


A banded object is a kind of component that can present grouped data and detailed data, and is composed of several banded panels with which you can easily organize data fields and other elements. To create a banded report, follow the steps below: 1. Take steps 1 and 2 in Creating a report tab. 2. Select Banded as the layout and click OK to display the Banded Wizard. 3. In the Data screen, select the business/report cube in the current catalog, on which the banded object will be built. 4. In the Display screen, add the required fields from the Resources box to be displayed in the banded object. Modify the display name of any added field if necessary. 5. In the Group screen, add the dimension objects as the grouping criteria, then specify the sorting direction of each group in the Sort column. 6. To add summaries, go to the Summary screen. Select the group to which the summary will be applied, then add a measure object as the summary field.

7. In the Query Filter screen, specify the filter you want to apply to the business/report cube. 8. In the Style screen, apply a style to the banded object. 9. Click Finish to create the report. See also Banded Wizard for details about options in the wizard. Note: If there is only one cube in the current catalog, this cube will be used to create the report by default, and the Data screen will be hidden from the wizard. This is the same case when there is only one style available to be applied to the report.

Creating a table report


Tables give you great control over how to present data, including placing fields, grouping them, and sorting them. A table is composed of row and columns, and each contains several cells. With such a structure a table is a good way to show any two-dimensional dataset. To create a table report, follow the steps below: 1. Take steps 1 and 2 in Creating a report tab. 2. Select Table as the layout and click OK to display the Table Wizard. 3. In the Data screen, select the business/report cube in the current catalog, on which the table will be built. 4. In the Display screen, add the required fields from the Resources box to be displayed in the table. Modify the display name of any added field if necessary. 5. In the Group screen, add the dimension objects as the grouping criteria, then specify the sorting direction of each group in the Sort column. 6. To add summaries, go to the Summary screen. Select the group to which the summary will be applied, then add a measure object as the summary field.

7. In the Query Filter screen, specify the filter you want to apply to the business/report cube. 8. In the Style screen, apply a style to the table. 9. Click Finish to create the report. See also Table Wizard for details about options in the wizard. Note: If there is only one cube in the current catalog, this cube will be used to create the report by default, and the Data screen will be hidden from the wizard. This is the same case when there is only one style available to be applied to the report.

Creating a chart report


A chart organizes and graphically presents data in a way that makes it easy for end users to see comparisons, trends, and patterns in data. It represents the report data in a visually straightforward form. A chart is based on the chart platform. On the platform, the chart paper, the legend, and labels make up the chart. You can create a chart that contains only simple DBFields, or a complicated chart that contains DBFields, groups, summaries, and even formulas. Normally, DBFields, summaries, and formulas in a report are represented in a chart using chart data markers, and groups are used to produce category names and data series names. DBFields can also be used as category names. For details about the chart types JReport supports, see Chart types in the JReport Designer User's Guide. For how charts present data, see How data is represented in a chart in the JReport Designer User's Guide. For the elements that compose a chart, see Chart elements in the JReport Designer User's Guide. To create a chart report, follow the steps below: 1. Take steps 1 and 2 in Creating a report tab. 2. Select Chart as the layout and click OK to display the Chart Wizard. 3. In the Data screen, select the business/report cube in the current catalog, on which the chart will be built. 4. In the Type screen, specify the chart type as required. A default chart type exists in the Chart Type Groups box. To replace it with another one, select a chart type from the Chart Type box. The thumbnails of the subtypes in this type will then be displayed in the Subtype box. Select the required subtype to replace the default chart type. If you want to create a combo chart, click <Add Combo Type> of Primary Axis or Secondary Axis in the Chart Type Groups box, and an additional subtype will be added. To replace the additional subtype, select it, then specify the required type and subtype respectively in the Chart Type and Sub Type boxes. To add more subtypes, repeat the procedures. To remove a subtype, select it and click .

5. In the Display screen, select a dimension object in the Resources box and add it to the Category or Series box, the data of which will be displayed on the corresponding axis. Select a subtype in the Show Values box, then add a measure object data of the subtype. To add an additional value to a subtype: a. Select the subtype in the Show Values box. b. In the Resources box, expand the Additional Values node, then select Constant Value/ Average Value. c. Click beside the Show Values box. The Edit Additional Value dialog appears. or an additional value as the

d. In the Name text box, specify the display name for the constant/average value. e. Input the constant value with numeric type in the Value text box, or select a field based on which the average value will be calculated from the Based On drop-down list. f. Click OK, and the defined constant/average value will be added to the subtype. If you want to further modify a constant/average value, select the value in the Show Values box, then click . In the Edit Additional Value dialog, edit the value as required.

You can add more than one measure object or additional value to a subtype. Each added subtype shall have at least one measure object or additional value. 6. If you want to define the sort order and Select N condition on the category/series axis of the chart, click the Order/Select N button below the Category/Series box, then define the condition in the Order/Select N dialog. To define a sort order and Select N condition on the category/series axis: a. In the Order box of the Order/Select N dialog, specify in which order values on the category/ series axis will be sorted.

b. In the Select N box, specify the Select N condition to All, Top or Bottom. If All is selected, all category/series values will be shown in the chart; if Top or Bottom is selected, the text field

next to it will be enabled and you can specify an integer here, which means that the first or last N category/series values will be shown in the chart. c. Check the Based On checkbox and specify values for the two drop-down lists that follow according to your requirement. If Based On is unchecked, the order of the first or last N category/series values will be based on what you specify in the Order box of the dialog; if you check it, the order will be based on values of the summary field and the sort direction you specify in the drop-down lists next to the Based On checkbox. d. If you have selected Top or Bottom from the Select N drop-down list, you can check the Other checkbox and the type a character string in the next text field, so that the category/ series values beyond the first or last N range will be merged into the group with the name as that character string. e. Click OK to accept the settings. 7. In the Query Filter screen, specify the filter you want to apply to the business/report cube. 8. In the Style screen, apply a style to the chart. 9. Click Finish to create the report. See also Chart Wizard for details about options in the wizard. Note: If there is only one cube in the current catalog, this cube will be used to create the report by default, and the Data screen will be hidden from the wizard. This is the same case when there is only one style available to be applied to the report.

Creating a crosstab report


A crosstab summarizes data and presents the summaries in a compact row and column format. To create a crosstab report, follow the steps below: 1. Take steps 1 and 2 in Creating a report tab. 2. Select Crosstab as the layout and click OK to display the Crosstab Wizard. 3. In the Data screen, select the business/report cube in the current catalog, on which the crosstab will be built. 4. In the Display screen, select a dimension object and click or to add it to the Columns

or Rows box as a group field. Select a measure object and click to add it to the Summaries box as an aggregate field. Repeat this to add more group/aggregate fields. 5. In the Display Name column, edit the display names of the added group fields or aggregate fields if required. These will label the rows, columns and summaries when the report is displayed. By default these are blank and no labels will be created. 6. In the Sort column, specify the sorting manner for the group fields. 7. If you want to remove any group/aggregate field, select it and click group/aggregate fields, select a group/aggregate field and click or . To adjust the order of the .

8. In the Query Filter screen, specify the filter you want to apply to the business/report cube. 9. In the Style screen, apply a style to the crosstab. 10. Click Finish to create the report. See also Crosstab Wizard for details about options in the wizard. Note: If there is only one cube in the current catalog, this cube will be used to create the report by default, and the Data screen will be hidden from the wizard. This is the same case when there is only one style available to be applied to the report.

Adding report objects


For a newly-created or an existing report, if the corresponding catalog contains business/report cubes, then you can add labels, images, banded objects, tables, crosstabs, charts, special fields and web controls to the report. Object placement Objects can be placed within banded objects, tables, tabulars, as well as onto an empty area of a report. The following table lists the report areas that are valid targets for the various objects, listed on the left.
Report Layout Area Object Banded object Chart Crosstab Table Dimension object Detail information object Measure object Formula Label Special field Image Web control Page Header/ Footer Y Y Y Y Y Y Report Header/ Footer N Y Y Y Y Y Report Body Y Y Y Y Y Y Banded Detail Y Y Y Y Y Y Banded Page Header/ Footer Y Y Y Y Y Y Banded Header/ Footer Y Y Y Y Y Y Banded Group Header/ Footer Y Y Y Y Y Y Table Cell N N N N Y Y Tabular Cell Y Y Y Y Y Y

N Y Y Y Y Y

N Y N N N Y

Y Y Y Y Y Y

N Y Y Y Y Y

N Y Y Y Y Y

Y Y Y Y Y Y

Y Y Y Y Y Y

N Y Y Y Y N

N Y Y Y Y Y

To add an object into a report: 1. Click Menu > Insert, then click the command corresponding to the object you want to add. 2. Point to the destination where you want the object to be added, and then click the mouse button.
r

If you specify to add a label, a label will be inserted there. Edit the text of the label and format it according to your requirements. If you specify to add an image, the Insert Image dialog will be displayed. Specify the source of the image as required (for details, see Insert Image dialog). If you specify to add a banded object, table, crosstab, or chart, the corresponding report wizard will be displayed. Specify the settings in the wizard according to your requirements (for details, see the specific topic in Creating a report tab). If you specify to add a special field, the special field will be inserted there (for details about the usage of each special field, see Special fields in the JReport Designer User's Guide).

If you specify to add a parameter control, parameter form control, or filter control, the corresponding insert control dialog will be displayed. For how to specify the settings in the dialog and the usage of the web control, see Applying web controls. If you specify to add a navigation control, a navigation control will be inserted there. For the usage of the navigation control, see Applying web controls.

Alternatively, you can also use the Toolbox panel to add objects other than special fields into a report by dragging them from the panel to the destination. However, in order to use the Toolbox panel to add components, you should make sure that this ad hoc feature is enabled in the specified DHTML feature profile. This setting can only be made by administrators. Note: A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license.

Applying web controls


In JReport Viewer, these four types of web controls can be applied: parameter control, parameter form control, filter control, and navigation control. This section describes each of the web controls and how to use them. Note: A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license.

Using parameter control to specify a parameter to a report


A parameter control is a web control that is bound with a parameter used by the current report. By specifying values to the parameter in a parameter control, you can pass the parameter values to JReport and run the report with the specified values. Parameter controls do not support inserting cascading parameters. If you want to do this, use parameter form controls instead. To insert a parameter control and use it to specify a parameter to a report: 1. Do either of the following:
r

Click Menu > Insert > Parameter Control, then point to the destination where you want to add the parameter control and click the mouse button. Drag Parameter Control from the Toolbox panel to the destination in the report.

The Insert Parameter Control dialog is displayed.

2. Select the parameter you would like to add to the parameter control, then click OK. 3. A parameter control will be added into the report. There are the following ways to specify parameter values according to the appearance of the parameter control which varies with the type and properties of the selected parameter:
r

Typing in the parameter values if the text field is editable. Selecting a parameter value from a drop-down list. Using the calendar button Time, or DateTime type. to specify a value using the calendar if the parameter is of Date,

Selecting or unselecting the checkbox to specify a Yes/No value. Using the button to specify multiple values for the parameter in the Enter Values dialog.

4. Once the value in the parameter control changes, the report will rerun with the new parameter value. Note: If the specified parameter is no longer used in the report, the parameter control will become invalid.

Using parameter form control to run reports


A parameter form control is a web control that is bound with the parameters used by the current report or other reports. By specifying values to the parameters in a parameter form control, you can make the reports run with the specified parameter values. To insert a parameter form control and use it to run report: 1. Do either of the following:
r

Click Menu > Insert > Parameter Form Control, then point to the destination where you want to add the parameter form control and click the mouse button. Drag Parameter Form Control from the Toolbox panel to the destination in the report.

The Insert Parameter Form Control dialog is displayed.

2. Specify the target reports to run using the parameter form control.
r

To run the current report, select Current Report, then specify the parameters used to run the report from the Select Parameters box. To run other reports, select Others, then select the reports you want to run. All the parameters used by the selected reports are displayed in the Parameter Information box. If all the selected reports contain no parameters, you cannot finish the dialog.

3. Specify whether to include the Submit button in the parameter form control. If Submit is included, it is used to submit the parameter values you specified in the parameter form control. If Submit is not included, once you change the values of a parameter in the parameter form control, the new values will be applied automatically.

4. Click OK in the dialog to save the changes. The parameter form control is now inserted in the report. It lists the selected parameters for the current report or lists all parameters used by the specified reports. 5. In the parameter form control, specify values of the listed parameters. 6. Click the Submit button if present to run the current report or the specified reports. If there is no Submit button, the change of values in the parameter form control will trigger report rerunning. Note: If you save or publish a report containing a parameter form control to another directory, the reports that you bind the parameter form control with will not be saved or published along with the report.

Using filter control to filter report data


A filter control is used to filter one or more data components, which refer to tables, banded objects, charts, and crosstabs, in a report using the same data source. To insert a filter control and use it to filter report data: 1. Do either of the following:
r

Click Menu > Insert > Filter Control, then point to the destination where you want to add the filter control and click the mouse button. Drag Filter Control from the Toolbox panel to the destination in the report.

The Insert Filter Control dialog is displayed.

2. Specify the fields of the same type on which the filter control is based from the resource list in the Select Fields box. 3. Select the data components you want to apply the filter control to from the Apply To drop-down list. 4. When done, click OK. The filter control is inserted in the report. It lists all values of the specified fields. You can select one or more values to apply. After inserting filter controls in the report, you can also insert a navigation control for undoing/redoing the value selection in the filter controls. For details about the usage of navigation control, see Using navigation control to undo/redo value selection in filter controls.

Managing a filter control


After right-clicking the title bar of a filter control, these options are available for managing the filter control.
q

Properties Opens the Filter Control Properties dialog for editing the properties of the filter control. Search Displays the quick search toolbar right above the filter control which enables you to search values in the filter control. You can also click the button quick search toolbar. on the title bar of the filter control to launch the

The following are details about the usage of the quick search toolbar:
r

Text field Type in the text you want to search for in the text field and the matched text will be highlighted among the field values. X Closes the quick search toolbar. You can also click outside of the quick search toolbar to achieve this.

Lists the advanced options.


s

Highlight All Specifies whether to highlight all matched text. Match Case Specifies whether to search for text that meets the case of the typed text. Match Whole Word Specifies whether to search for text that matches a whole word and ignore partial word matches.

Highlights the next matched text.

Highlights the previous matched text. Clear

Cancels the selection of values in the filter control. You can also use the button cancel the selection. This operation can be undone/redone.
q

on the title bar to

Sort Sorts the values in the filter control in the ascending or descending order. Delete Removes the filter control from the report and the filter you created with the filter control will be removed from the report too. You can also use the close button on the title bar to remove the filter control. Hide Hides the filter control.

Cascading relationship between filter controls


When there are filter controls that apply to the same data components, and when these controls' fields have cascading relationship, the cascading relationship will be revealed when you select values in the controls. For example, there is a filter control based on the field Country, a filter control on City, and another on State. The first two share one table while the third shares nothing with the other two. In this case, Country and City values will show cascading relationship, but State values will not participate. You select USA in the Country filter control, the values in the City filter control will change as follows if the control has scroll bar: the cities belong to USA are displayed in the upper area of the filter control, and the other cities are put in the lower area and grayed out. For the case that the City filter control has no scroll bar: all the values remain their positions and the values not belonging to USA are grayed out. In both cases all the values are selectable. But the State values remain as before, since the selection of them will not affect the data components that the Country and City filter controls control.

Using navigation control to undo/redo value selection in filter controls


A navigation control can be considered as an accessorial control for filter controls and is used to deal with the value selection operations in all the filter controls in the same report. To insert a navigation control into a report, do either of the following:
q

Click Menu > Insert > Navigation Control, then point to the destination where you want to add the navigation control and click the mouse button. Drag Navigation Control from the Toolbox panel to the destination in the report.

A navigation control is a combination of three buttons:


q

Back Goes back to the previous value selection status and refreshes the report data accordingly.

Clear Removes all the value selection histories and all the filter conditions based on the selections, and refreshes the report data accordingly. Forward Goes forward to the next value selection status and refreshes the report data accordingly.

Making simple modifications to report objects


By virtue of JReport Viewer's powerful ad hoc functions, you can make simple modifications to report objects at runtime while viewing the report in DHTML. Note: Except for showing/hiding objects, a JReport Live license for JReport Server is required in order to use all the other features introduced in this article. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license.

Moving an object
A table, banded object, chart, crosstab, tabular, or image, can be easily moved to a new position. What you need to do is click anywhere in the object, then drag the icon appearing at its upper left corner to the destination. After JReport Viewer has finished processing, the object will be redrawn in the new location. For other objects, select it and move it to the new position. Notes:
q

Before you can move any object in a report, you need to first make sure that the JReport Viewer window is in the Interactive View mode. For reports designed in JReport Designer, only the objects whose Position property value is absolute, and the DBFields or labels which have been defined as a cube element can be moved in JReport Viewer.

Resizing an object
To resize an object, click anywhere in the object, when the icon appears at its upper left corner, click the icon to select the object, then you will see that it is surrounded by a rectangle with three resizing handles. Point to a handle, when the mouse pointer turns to a double-headed arrow, you can drag the handle to resize the object. To resize a panel in a banded object, select it and drag the resizing handle to the desired position. To adjust the width/height of a column/row in a table, point to the right/lower boundary of the column/ row, when the mouse pointer becomes a horizontal/vertical double-headed arrow, drag the handle and the width/height of the column/row will change. This will also resize all cells in the column or row. For a crosstab, you can resize its rows and columns the same as you do with a table. For a tabular, point to the boundary between two cells and the mouse pointer will become a doubleheaded arrow, you can then drag the boundary to adjust the size of the related cells. To change the width and height of a field, click any value of this field to select it, then drag the right or lower resizing handle on its borders to a new position, and the width or height of the field will change. You can also do this for any label. Notes:
q

When resizing table rows:

If you resize the table header, only the height of the header will be changed. However, when you resize any row except the header, the height of all rows in the table will be changed at the same time. If there are some groups in a table and the height of one group row is changed, the other group rows will not be resized. When resizing crosstab columns/rows:

If you resize the horizontal/vertical header of a crosstab, other rows/columns will not be affected. If you resize the total column/row of a crosstab, other columns/rows will not be affected.

Hiding/showing an object
To hide a table, banded object, chart, crosstab, or tabular, click on the object, when the icon appears at its upper left corner, right-click on the icon and then select Hide from the shortcut menu. For other objects such as text boxes, drop-down lists, fields, and labels, right-click it and then select Hide to hide it. To show a hidden object, right-click the object containing it, then on the shortcut menu, select the object name from the Show submenu.

Splitting and merging cells in a tabular


Adjacent cells in a tabular which can form a rectangle may be merged into one cell. To merge adjacent cells, select them one by one while holding the Ctrl key, then click Menu > Report > Merge, and these cells will be merged into one cell. To split a cell: 1. Select the cell and click Menu > Report > Split. 2. In the Split dialog, specify the number of rows and columns. 3. Click OK and the cell will be split.

Modifying object properties


JReport Viewer allows you to modify object properties with the corresponding properties dialog.
q

To format the properties of any object in a report, right-click on the object and select Properties from the shortcut menu. If it is a table, crosstab, chart, banded object, or tabular, click anywhere on it, when the icon appears at its upper left corner, right-click on the icon and click Properties on the shortcut menu. In the corresponding properties dialog, specify the settings as required. For a table, you can also right-click any field or cell in it and select Table from the shortcut menu to show the Table Properties dialog. You can right-click a group header/footer panel in a banded object, and then select Group to show the Group Properties dialog in order to define the group properties. If you want to format the properties of the report, right-click the blank part of the report, select Report from the shortcut menu, then in the Report Properties dialog, configure the properties as required.

To set up report page properties, click Menu > File > Page Setup, then in the Page Properties dialog, specify the settings according to your requirements.

Tip: If you just want to modify the text related properties for a field or label, for example, you want to change the text alignment or make the text bold, you can achieve it by simply selecting the field or label, then clicking the corresponding buttons on the toolbar. For detailed explanation about options in the properties dialogs, refer to the specific topics in JReport Viewer dialogs.

Deleting an object
An object can be removed from the report if it is no longer required. However, objects that are in a subreport cannot be deleted.
q

To delete a table, banded object, chart, crosstab, tabular, or image, click on the object, when the icon appears at its upper left corner, right-click on the icon and select Delete from the shortcut menu, or you can drag the icon outside the report page. Then, a message box will prompt, asking for your confirmation. Click OK in the message box so as to remove the component. For a field, you can drag any value of the field outside the report page to remove it. You can also drag any label outside the report page to remove it. Right-clicking and then selecting Delete is another way to achieve this.

Saving the report


You can save your report in a JReport Viewer window. To do this, click Menu > File > Save (or the on the Standard toolbar). The Save Report Template dialog appears. The Sort and Save button Filter options in this dialog signify whether or not to include the sort and filter criteria when saving. Specify the options as required, then click OK, and the report will be saved as a report version. If the report is newly created and has not yet been saved, the Save As dialog will be displayed.

1. In the Report Name box, enter the name of the report as required. Select a file format from the format drop-down list. 2. From the Folder drop-down list, specify where the report will be saved: Public Reports or My Reports. 3. From the Directory drop-down list, further specify the directory in which the report will be saved. 4. Optionally, input some text in the Description box as a description for the report. 5. Click the Advanced button to set the advanced settings for the report if required. a. From the Catalog drop-down list, select the catalog for the report. b. Specify the relationship between the saved report and the catalog used to run it (activated only when Select Catalog Linked Model is checked in the Profile > Configure DHTML Profile > Properties > Advanced tab):
s

Set Original Catalog as Linked Catalog into Saved Page Report If checked, the saved report will be linked with the catalog and the saved report will run with the catalog no matter whether the two are in the same directory. If later the catalog is updated, the saved report will run with the latest version of the catalog. Set Catalog Copy to Public Reports/My Reports If checked, the catalog will be copied to the directory where the report is saved and the saved report will run with the copied catalog.

c. If you want to save the report together with the sort and filter criteria, check Save Sort Criteria and Save Filter Criteria correspondingly. With the criteria saved, JReport Viewer will automatically apply them to the report the next time it is opened. 6. Click OK to save the report. To save a copy of a report, click Menu > File > Save As (or the Save As button toolbar) to show the Save As dialog, and then do as above. Notes:
q

on the Standard

You will not be able to save the report to some locations if you do not have the required permissions. You need to have Write access to the directory. If one of the report tabs in a report contains subreports, when you save the report, changes you have made on the subreports will not be saved along with the primary report. To find a newly saved report version, browse to select the row that the report is in on the JReport Console > Reports page, click Tools > Version on the task bar, and then click the Report Versions tab.

Exporting the report result


When you are satisfied with the result of the active report, you may want to export it as a result version or as a local file to other formats. The following topics describe exporting report results in detail:
q

Exporting the result from a JReport Viewer window Exporting the result by using a JavaScript function Customizing buttons for one-step exporting Controlling user access to different export formats Customizing warning messages

Note: If the report you are going to export is linked to another report, in the exported results, the link will no longer be available.

Exporting the result from a JReport Viewer window


You can export the report result from a JReport Viewer window to other formats by taking the following steps: 1. Click Menu > File > Export (or the Export button dialog. on the Standard toolbar) to display the Export

2. From the Select Report Result Format drop-down list, select the format in which to export the result:

HTML, PDF, Excel, Text, RTF, XML, PostScript, or DHTML Result. 3. Specify the destination of the result:
r

Save to Version System: The result will be saved as a result version in JReport Server's versioning system. Save to File System: The web browser will prompt you to save the result file to a specified folder. If selected, you need to provide a name for the result file in the File Name field. View Report Result: The result will be directly opened in the web browser if the format is supported by a plug-in of the web browser; otherwise it will prompt you to save the result file.

4. In the File Name field, specify the name of the exported result file. 5. To specify the additional setting of the selected format, click More Options. 6. From the Style Group drop-down list, select the style group you want to apply to the exported report result. If No Style is selected, the style group property predefined for the specified export format in JReport Designer will be applied to export the report result to that format. 7. Set the other properties for the selected format as required (for details about properties of each format, see Export dialog). 8. Click OK to confirm.

Exporting the result by using a JavaScript function


JReport Server provides you with a JavaScript function which allows you to open the report result or export it in a specified format. You can find this function in the file [Link] in <server_install_root> \public_html\javascript\dhtml, as shown below: function user_oneStepExport(type, options) The following explains this function's two arguments, type and options, in detail. type - Specifies the export format.
q

HTML = 0 PDF = 2 PS = 3 RTF = 4 TEXT = 5 EXCEL = 6 XML = 7

options - Specifies the values of the options of each format. It is a string array whose member is of the format "key=value". The options and their usage are listed as follows:
Key HTML to_ver to_open to_local browser Specifies whether or not to save the result to version. Specifies whether or not to export and open the result file. Specifies whether or not to save the result to a local file. Specifies the web browser type. true, false true, false true, false 0 - IE or Chrome 1 - Firefox imagetype Specifies the type of the images in the result file. 0 - Decided by JReport 1 - GIF 2 - JPG overflow Specifies the overflow type. 0 - VISIBLE 1 - HIDDEN 2 - VERFLOWCOUNT resolution title applet Specifies the HTML resolution. Specifies the title for the HTML file. Specifies whether or not to export chart in Java applet format. Any integer between 1 and 4294967296 Any string true, false 96 "" true 0 0 false false false 0 Description Available Value Default Value

css multi hyperlink pagenumber drilldown no_margin absolute PDF to_ver to_open to_local no_margin simulate standard content drilldown encrypt compress ratio compatibility

Specifies whether or not to embed the cascading style sheet in the exported HTML files. Specifies whether or not to generate an HTML file for each page of the report result. Specifies whether or not to contain hyperlinks in the HTML file. Specifies whether or not to contain page numbers in the HTML file.

true, false true, false true, false true, false

false false false false false false false

Specifies whether or not to include the drilled-down true, false file in the exported HTML file. Specifies whether or not to remove the original margins. true, false

Specifies whether or not to make the font size fixed true, false in the web browser. Specifies whether or not to save the result to version. Specifies whether or not to export and open the result file. Specifies whether or not to save the result to a local file. Specifies whether or not to remove the margin. Specifies whether or not the mode is to be Simulated Printing Mode. Specifies whether or not to set the mode as Standard Mode. Specifies whether or not to contain the TOC in the exported PDF file. true, false true, false true, false true, false true, false true, false true, false

false false false false true false false false false false 20 1

Specifies whether or not to include the drilled-down true, false file in the exported PDF file. Specifies whether or not to encrypt the report result. Specifies whether or not to compress the images in the report. Specifies the percentage with which to compress the images in the report. Specifies the encryption compatibility. true, false true, false Any integer between 1 to 100 0 - Acrobat 3.0 and later 1 - Acrobat 5.0 and later

doc_psw permi_pasw printing

Specifies the password for opening the PDF file when encrypt=true. Specifies the password for printing and editing the PDF file when encrypt=true. Specifies the PDF printing mode.

Any string Any string 0 - Prevents users from printing the file 4 - Allows low resolutionprinting 2052 - Allows high-resolution printing

"" "" 0

changes

Defines which editing actions are allowed in the PDF file.

0 - Prevents users from making any changes to the file 1024 - Allows inserting, deleting, and rotating pages 256 - Allows users to fill in form fields and adding digital signatures. 32 - Aallows users to fill in form fields and add digital signatures and comments 40 - Allows users to do anything except extracting pages 2108 - Allows all

enable_copy enable_access PostScript to_ver to_open to_local no_margin RTF to_version to_open to_local rtf_flow no_margin Text to_ver to_open to_local repeat

Specifies whether or not to allow users to copy the file contents. Specifies whether or not to let visually impaired users read the document with window readers. Specifies whether or not to save the result to version. Specifies whether or not to export and open the result file. Specifies whether or not to save the result to a local file. Specifies whether or not to remove the margins in the PS file. Specifies whether or not to save the result to version. Specifies whether or not to export and open the result file. Specifies whether or not to save the result to a local file. Specifies whether or not to apply a flow layout when exporting the report to RTF. Specifies whether or not to remove the margins in the RTF file. Specifies whether or not to save the result to version. Specifies whether or not to export and open the result file. Specifies whether or not to save the result to a local file. Specifies whether or not to replace a field value of a record with that of its previous record if the field value is null. Specifies whether or not to compress the clearance between columns. Specifies whether or not to use Windows end-ofline characters. Specifies whether or not to generate the report result to a standard text file.

true, false true, false

false true

true, false true, false true, false true, false

false false false false

true, false true, false true, false true, false true, false

false false false false false

true, false true, false true, false true, false

false false false false

compress win_linebreak normal

true, false true, false true, false

false true true

quote_mark head_foot delimiter width height Excel to_ver to_open to_local wrap

Specifies whether or not to mark the fields in the exported file with quotation marks. Specifies whether or not to contain all headers and footers in the report. Specifies the delimiter. Specifies the user-defined character width. Specifies the user-defined character height. Specifies whether or not to save the result to version. Specifies whether or not to export and open the result file. Specifies whether or not to save the result to a local file. Specifies the word-wrap setting.

true, false true, false Any single character An integer An integer true, false true, false true, false 0 - All Keep Existing 1 - All Disabled 2 - All Enabled

false true

false false false 0

new_layout shapes excel_2000 advanced header footer gridline XML to_ver to_open to_local only_data

Specifies whether or not to use the new layout mode. Specifies whether or not to include the shapes in the exported file. Specifies whether or not to export the result in Excel 2000 format. Specifies whether or not to apply the advanced options. Specifies the page header text. Specifies the page footer text. Specifies whether or not to print gridlines when printing the exported Excel file. Specifies whether or not to save the result to version. Specifies whether or not to export and open the result file. Specifies whether or not to save the result to a local file. Specifies whether or not to only contain the database column information in the exported XML file. Specifies the name of an existing schema file with its full path with which to generate the XML file.

true, false true, false true, false true, false Any string Any string true, false

true false false false

false

true, false true, false true, false true, false

false false false false

schema

An existing schema file with its full path.

Notes:
q

The three options to_ver, to_open, and to_local are mutually exclusive, that is, only one of them should be true, and the rest false. If you set two or three of them to true, JReport will only accept the first true and treat the rest as false. If you set all three to false, JReport will consider to_open as true. In the string array options, the members are separated by commas (","). You can arrange the members in any order, and omit those keys where you want to use the default value. For example, you can define a variable html_options: var html_options = ["imagetype=1", "resolution=120", "hyperlink=true",

"no_margin=false", "title=hello world"]; Then, you can use user_oneStepExport(0, html_options) to obtain a URL for exporting the report result in HTML format.
q

JReport also provides the function user_downloadReport(type, options) whose usage is similar to user_oneStepExport.

Customizing buttons for one-step exporting


Seven buttons are provided for one-step exporting. They are Export to PDF, Export to Excel, Export to RTF, Export to HTML, Export to Text, Export to PS, and Export to XML. By default, the buttons are invisible on the toolbar area. You have to add them to the toolbar area by modifying the [Link] file in <install_root>\public_html\dhtmljsp. Use the following two API functions to control the buttons:
q

public void customizeToolbar(String SessionId, String RptSetId, String toolbarname, int[] buttonId); public void customizeToolbar(String SessionId, String RptSetId, String toolbarname, int[] buttonId, boolean isVisible);

Explanation of these parameters:


q

SessionId - session ID, which can be retrieved by [Link](request). RptSetId - report ID, which can be retrieved by [Link](request). toolbarname - toolbar name, such as "Standard", "Analysis", "View", or user-defined ones. buttonId[] - toolbar button ID. It is an integer array, so you need define an integer array variant. For example: int[] mybuttonid ={DHTMLConstant.TOOLBAR_EXPORTTOPDF, DHTMLConstant. TOOLBAR_EXPORTTOXLS, TMLConstant.BTN_EXPORT_TO_RTF} The array elements available for one-step exporting are:
r

DHTMLConstant.TOOLBAR_EXPORTTOPDF DHTMLConstant.TOOLBAR_EXPORTTOXLS DHTMLConstant.TOOLBAR_EXPORTTORTF DHTMLConstant.TOOLBAR_EXPORTTOHTML DHTMLConstant.TOOLBAR_EXPORTTOTEXT DHTMLConstant.TOOLBAR_EXPORTTOPS DHTMLConstant.TOOLBAR_EXPORTTOXML

isVisible - whether or not to show the buttons defined with buttonID[]. true -- show, false -- hide. This parameter can be absent, and then the value is true.

For example, if you want to add the Export to HTML button to the Export toolbar, then: 1. Open the file [Link]. 2. Add the code int[] temparray = {DHTMLConstant.TOOLBAR_EXPORTTOHTML}; [Link](SessionID, RptSetId, "Export", temparray, true); before //<!-- Tool Bar -->

if([Link](SessionID, RptSetId, DHTMLConstant. FEATURE_TOOLBAR)){ 3. Start JReport Server. 4. Run a report in the DHTML format, and you will see a new button Export to HTML is displayed on the Export toolbar. To add more than one button to the toolbar area, for example, adding Export to HTML and Export to PDF buttons to the Export toolbar: 1. Open the file [Link]. 2. Add the code int[] temparray = {DHTMLConstant.TOOLBAR_EXPORTTOHTML, DHTMLConstant. TOOLBAR_EXPORTTOPDF}; [Link](SessionID, RptSetId, "Export", temparray, true); before //<!-- Tool Bar --> if([Link](SessionID, RptSetId, DHTMLConstant. FEATURE_TOOLBAR)){ 3. Start JReport Server. 4. Run a report in the DHTML format, and you will see the buttons Export to HTML and Export to PDF are displayed on the Export toolbar. 5. Click the added button on the toolbar of the report page, the report will be exported to the corresponding format, using the default values of the format options.

Controlling user access to different export formats


JReport introduces an access control ability which can restrict different users to export report result to different formats.

How to realize the access control ability


You can restrict the report result formats for users by passing values to a variable. That is the global variable enableTypes in both customize_panel.jsp and save_result.jsp files in <install_root> \public_html\dhtmljsp folder. The value of enableTypes should be Integer, and JReport gives you the following integers to represent the corresponding report result types:
Report Result Format HTML PDF Excel Text RTF XML PostScript Int. Value 0 1 2 3 4 5 6

You can specify a value or an array to enableTypes using the integers in the above table. Or you can also use the integers which are not mentioned above, but if you do so, the Int. values will be ignored, and do not function. That is to say, if you pass the array {1,2,5,9,-2} to enableTypes, 9 and -2 will be ignored and {1,2,5} will work, so PDF, EXCEL, XML formats can be in use.

Example
Assume that there are two users, user1 and user2. When user1 logs on, run a DHTML report, he can only export the report result as PDF and HTML formats. While user2 can export the report result as RTF and XML formats when logging on. To realize it, you can use the following codes in customize_panel.jsp or save_result.jsp file: int[] enableTypes=null; String UserName=null; UserName=[Link](request); if([Link]("user1")) enableTypes=new int[]{1,0}; if([Link]("user2")) enableTypes=new int[]{4,5};

Customizing warning messages


You can customize the warning messages when exporting the report result to XML through JReport Viewer. With this function, you can specify what you want to show as a warning message. The custom warning messages are supported across web browsers. To customize the warning messages, you need to customize the jsp files using either of the following two methods: Method 1 1. Open the save_result.jsp file in the <install_root>\public_html\dhtmljsp folder with your favorite editor. 2. Specify the value of customMsgForXML in the save_result.jsp to whatever you want. The value cannot be "" or null. 3. Run a report in JReport Viewer, click Menu > File > Export to display the Export dialog. 4. Select XML from the Select Report Result Format drop-down list, and if necessary, modify other properties as required, then click OK. 5. A warning message shows as you have defined. Method 2 You can also export the report result via the Export panel instead of clicking Menu > File > Export. By default, the panel is hidden. So, the following is another way to create custom warning messages: 1. Open the customize_panel.jsp file in the <install_root>\public_html\dhtmljsp folder with your favorite editor. 2. Set the class of panelDIV to visibleMargin to show the Export panel on web browser. 3. Specify the value of customMsgForXML in customize_panel.jsp. 4. Run a report in JReport Viewer, and the Export panel together with the report shows. 5. Select XML from the Select Report Result Format drop-down list, and if necessary, modify other properties as required, then click OK. 6. A warning message shows as you have defined. For example, using method2, when you need to export the report result as XML, and if you want to show "This is IE Browser" while browser is IE, you need to set panelDIV in customize_panel.jsp file to visibleMargin as follows: <div id="<%=DHTMLConstant.DHTML_PREFIX%>panelDIV" class="visibleMargin"> And then customize CustomMsgForXML in the same jsp file as follows: String browserName=[Link]("User-Agent"); String customMsgForXML ="This is "+browserName; Access JReport Server via IE, run a report in JReport Viewer, select XML from the Select Report Result Format drop-down list in the Export panel, and click OK. Then a pop-up box will show you "This is IE

Browser".

DHTML based reporting


DHTML based reporting enables enterprise-wide information delivery. With JReport Viewer, organizations can harness the power of the Internet, giving users across the enterprise the ability to access and generate reports from their own web browsers. The DHTML based reporting function of JReport empowers you to perform the following operations:
q

Filtering report data Sorting report data Searching for text in a report

Filtering report data


In JReport Viewer, data is cached in a data buffer. You can set a series of conditions and apply them to a DHTML server to filter the data buffer and reproduce the report result. There are these methods you can use to set the filter conditions: using the Filter dialog, using filter controls, using the shortcut menu, and using labels.

Using the Filter dialog


To set the filtering conditions using the Filter dialog: 1. Click Menu > Report > Filter, or the Filter button on the Analysis toolbar to show the Filter dialog.

2. Select the component on which the filtering will be based from the Apply to drop-down list. 3. Define the filter as required. There are the basic and advanced modes of the dialog for you to define either simple or complex filter expressions.
r

To define a filter using simple expressions: a. Make sure the dialog is in the basic mode. b. From the field drop-down list, select the field on which the filter will be based. c. From the operator drop-down list, set the operator with which to compose the filter expression. d. Type the values of how to filter the field in the value text box, or select one or more values from the drop-down list. e. If you want to add another condition line, from the logic operator drop-down list,
s

To add a condition line of the AND relationship with the current line, select AND, then define the expression as required. To add a condition line of the OR relationship with the current line, select OR, then define the expression as required. on its left.

Repeat this to add more filter expressions if required. To delete a condition line, click
r

To define a filter using complex expressions: a. Switch the dialog to the advanced mode. b. From the field drop-down list, select the field on which the filter will be based. c. From the operator drop-down list, set the operator with which to compose the filter expression. d. Type the values of how to filter the field in the value text box, or select one or more values from the drop-down list. e. To add another condition line, click the Add Condition button and define the expression as required. Then, click the logic button until you get the required logic to specify the relationship between the two filter expressions. The logic can be AND, OR, AND NOT, or OR NOT. f. Repeat the above steps to add more filter expressions if necessary. To group some conditions, select them and click the Group button, then the selected conditions will be added in one group and work as one line of filter expression. Conditions and groups together can be further grouped. To take any condition or group in a group out, select it and click Ungroup. It is the equivalent of adding parenthesis in a logic expression. To adjust the priority of a condition line or a group, select it and click the Up or Down button. To delete a condition line or a group, select it and click the Delete button.

4. Click OK to make the filter take effect and return to the report.

Using filter controls


A filter control is a web control used to filter one or more data containers, which refer to tables, banded objects, charts, and crosstabs, in a report using the same data source. A filter control can do filtering based on one field. For details, see Using filter control to filter report data.

Using the shortcut menu


You can also use filter-related commands on the shortcut menu to filter the data in a banded object or table. To do this, point to any value of the field by which you want to filter data, then right-click to show the shortcut menu. You will see the Filter item which provides a submenu containing the following commands:
q

Remove Filter This command is enabled after you have applied filtering on the field to the banded object or table. Clicking this item will remove all filters on this field. Top N Shows the Top N dialog with which you can filter data to display records that meet the Top N condition. For example, if you input 3 in the Top N dialog for a certain field, then only the records with the field value equal to one of the first three field values will be displayed.

Bottom N Shows the Bottom N dialog with which you can filter data to display records that meet the Bottom N condition. For example, if you input 3 in the Bottom N dialog for a certain field, then only the records with the field value equal to one of the last three field values will be displayed.

Field values "Field values" is not the name for a command on the Filter submenu, but represents some items which are the values of the field you have right-clicked. Selecting any field value listed here will make the banded object or table only display records with the field value equal to the selected one. More This command is enabled if the Filter submenu cannot list all field values. When it is enabled, clicking it will show the Select Values dialog. You can select one value in this dialog and apply the setting, after which the banded object or table will only display records with the field value equal to that value.

Using labels
You can also use a label to control the filter condition in a banded object or table. This feature needs to be enabled at report design time. 1. In JReport Designer, select a label in a banded object/table, and then set its Filterable property to true. 2. Set the field by which you want to filter records as the value of the label's Bind Column property. 3. Save the report and publish it to JReport Server. is beside the label. Click it to show the 4. Run the report in JReport Viewer, and you can find that a button Filter list, which contains All, Top N, Bottom N, Custom Filter, the field values, and More (if there are too many distinct values for the field), then click the corresponding item to filter the records. After applying a filter on the field decided by the Bind Column property, the button will be affixed with a check mark, and you can still click it to show the Filter list, in which the All item can help you remove the filters on the field. Notes:
q

You can also filter records by using the shortcut menu for a label in the same way as for a field value, provided you have set its Bind Column property value to a field. When using the shortcut menu for a field value or label to filter, all the items (Remove Filter, Top N, Bottom N, and More) will be showed by default. If you want to disable some of the items, you should set the field's Filter Options property when designing the report in JReport Designer. For details, see Setting filter options for a field in the JReport Designer User's Guide. For filtering the data using shortcut menu or labels, you may notice that the corresponding filter expressions

will appear in the Filter dialog if you open this dialog.


q

JReport allows you to define the display names for fields to be shown in the Filter dialog. For detailed information, see Customizing the field display names in the JReport Designer User's Guide.

Sorting report data


You can sort the records in a banded object or table, and the groups in a certain group level of the banded object or table if you have defined one or more group levels. If you want the data of other types of cube elements to be sorted, you should put the cube element into a banded object or table and make the data of the cube element inherit from the banded object or table.
q

Sorting records: Changing the order of records in the whole banded object or table, or in each group if there exists one or more group levels. The sorting scope is the whole banded object or table. Sorting groups at a group level: Changing the order of groups at the specified group level, that is, the groups will be sorted by value of the first record in each group on the related field. The sorting scope is the group level.

You can achieve the above by using the Sort dialog, shortcut menu, or labels.

Using the Sort dialog


To set the sort conditions in the Sort dialog: 1. Click Menu > Report > Sort (or the Sort button Sort dialog. on the Analysis toolbar) to bring up the

2. From the Sort in Scope drop-down list, select a banded object/table or a group field on which the sort condition will be based. 3. From the field drop-down list, select the field on which to sort the data, then set the sort order to Ascend or Descend. 4. If you select a banded object/table in Step 2, you can click to add a new row of sorting

condition if required. Click or to move a row up or down so as to set the sorting priority, to delete the corresponding sorting condition if it is unwanted. If what you select in the Sort in Scope drop-down list is a group field, then only one sort condition can be composed. To retrieve the opening status of this dialog, click the Reset button. 5. Click OK to accept the settings and to reload the result.

Using the shortcut menu


To sort data on a certain field using shortcut menu: 1. Point to any value of a detail field or group field by which to sort the data in the banded object/ table, and then right-click. 2. Choose the command Sort > Ascend or Sort > Descend from the shortcut menu. If what you right-click in Step 1 is a detail field value, the sorting will affect the order of detail records in the banded object or table; if it is a group field value, the order of groups in the group level represented by the group field will be rearranged. To remove the sort condition on a field, click Sort > No Sort.

Using labels
You can use a label to control the sorting order for a certain field. This feature needs to be enabled at report design time. 1. In JReport Designer, select a label in a banded object/table, and then set the Sortable property of the label to true. 2. Set the field by which you want to sort records as the value of the label's Bind Column property. 3. Save the report and publish it to JReport Server. 4. Run the report in JReport Viewer, and you can click beside the label to sort the data. This button will change after you have clicked it, and you can further click it to switch the sorting direction among ascend, descend, and no sort. Notes:
q

You cannot sort the data by a global type formula. You can also conduct sorting by using the shortcut menu for a label in the same way as for a field value, provided you have set its Bind Column property. For sorting the data using shortcut menu or labels, you may notice that the corresponding sort

expressions will appear in the Sort dialog if you open this dialog.
q

If you use the shortcut menu to sort the report data by a field and then sort by another field, the later sort condition will replace the former one. JReport allows you to define display names for fields to be showed in the Sort dialog. For detailed information, see Customizing the field display names in the JReport Designer User's Guide. You can right-click an object in a banded object and select the Reset item from the shortcut menu to reproduce the data of the banded object using the data cached in the data buffer. This will clear all sort and filter conditions except for those predefined in JReport Designer. Administrators can customize the buffer size for sorting of each report in the Configuration page of JReport Server so as to improve performance.

Searching for text in a report


You can use the Search dialog to find text in the values of a certain field or in the whole report content. on the Standard To show this dialog, click Menu > Edit > Search, click the Search button toolbar, or right-click a field value or label (or object such as text box) and click Search on the shortcut menu.

To find text in the values of a particular field: 1. Make sure the Search in Whole Report option in the Search dialog is NOT checked. 2. Select the field from the Select Field drop-down list. 3. Set the range with which to search for the value from the Value Range drop-down list. 4. Select the field value you want to search for from the Value drop-down list. Note: If All is selected in the Value Range drop-down list, the only item in the Value dropdown list will be All and you cannot change the value, in which case, when you submit the search, JReport will search for all the values of the selected field.

Specify whether or not to match case, whether or not to match whole word, whether or not to

highlight all the matching values and the searching direction.


q

Click the Search button. To find text in the report content: 1. In the Search dialog, check the Search in Whole Report checkbox. 2. Type the string you want to search for in the Value box. 3. Set the other options such as the searching direction. 4. Click the Search button.

Notes:
q

Finding text in the values of a particular field is not supported on crosstabs and charts. If you check Highlight All in the Search dialog, to clear the highlighting in the search result, uncheck the option and submit the search again, or refresh the report. If you have not selected the Search in Whole Report option, you will not be able to search special fields for strings. JReport allows you to define display names for fields to be shown in the Search dialog. For detailed information, see Customizing the field display names in the JReport Designer User's Guide.

Analytic reporting
JReport Viewer provides you with a convenient and powerful tool to analyze your business information. By providing secure web access to business data and making the data interactive, JReport Viewer facilitates data analysis. JReport Viewer enhances the utility of production reports by making them interactive - allowing you to define your view of data to make it more useful. Through a user-friendly web GUI, report contents can be easily navigated, drilled, and viewed in detail. JReport Viewer uses the Resource View panel to provide a business-oriented view of databases. This view shields end users from having to understand database connectivity and SQL syntax while allowing IT professionals to maintain control of business data and to ensure its integrity. Using the Resource View panel, JReport Viewer dynamically builds SQL statements to retrieve data and automatically generate multidimensional data cubes. These cubes contain the underlying data structure which makes data analysis possible. The following topics describe the analytic reporting features:
q

An introduction to business/report cubes Applying filters to business/report cubes Using cube elements Using dynamic resources Drilling through the report data Manipulating data components Adding conditional formats to fields Converting between components Navigating through the report data

Note: A component created in JReport Designer is based on a dataset, while that created in JReport Viewer is based on a business/report cube. For the former, if you want to do analytic actions in JReport Viewer, such as adding a cube element, converting the component type, drilling it, or changing chart definition, JReport Viewer will need to convert its fields to cube elements (for details, see Converting query-based components to report cube-based in the JReport Designer User's Guide). When conversion conditions are fulfilled, when you perform analytic actions in JReport Viewer, you will be prompted with the Convert Data Fields dialog to confirm the conversion. However, if the report tab level property Automatic Cube Initialization has been set to true when the report is designed in JReport Designer, the data fields will be automatically converted to cube elements when the report is opened in JReport Viewer.

An introduction to business/report cubes


A business/report cube, which is needed for creating multidimensional data cubes, contains database connections and relationships between cube elements. The business/report cube shields report end users from having to understand the physical structure of a data source, and enables them to build reports and analyze data based on a set of cube elements they can understand. It also enables IT professionals to maintain control of the business data and ensure its integrity, while presenting end users with an intuitive view of the underlying data structures. To make use of a business/report cube, you need to first define it at report design time in JReport Designer. For additional information, see Business/Report Cubes in the JReport Designer User's Guide. A business/report cube may contain category objects and cube elements (dimension objects, measure objects, and detail information objects). You can insert these cube elements or remove them to change the report result when you view reports in DHTML format.
q

Category objects Category objects contain a collection of cube elements. A business/report cube may contain more than one category. In the Resource View panel, the icon indicates that an object is a category. Categories are only for categorizing cube elements, and they cannot be inserted into a report. The category is often used for indicating the name of the underlying DBMS table. Dimension objects Dimension objects are cube elements that will become the basis for analysis in a report. They characteristically return text or date values. In the Resource View panel, the icon indicates that an object is a dimension object. A dimension object can be inserted wherever a group field can be inserted into. It can be inserted as a column or row field in a crosstab, or as a group field or detail field in a banded object or a table, or displayed as category/series field in a chart.

Measure objects Measure objects are numeric cube elements that are calculated dynamically at run time. The icon indicates that an object is a measure object. A measure object can be inserted wherever a summary can be inserted. For instance, it can be inserted into the group header or footer panel in a table or banded object, or into a crosstab as an aggregate field. A measure object can also be used as a detail field in a banded object or table although it will display the same aggregate value for every detail line. JReport Viewer will calculate the summary values based on the group level the measure object has been inserted into.

Detail Information objects indicates that an object is a Detail Information objects provide additional information. The icon detail information object. It can be inserted wherever a DBField can be inserted. For example, you can insert a detail information object into a table or banded object as a detail field.

Applying filters to business/report cubes


When creating reports in JReport Viewer, you can choose to apply some filter to the specified business/ report cube to narrow down the data scope of the business/report cube. Filters for business/report cubes are defined into two categories in JReport Viewer: predefined filters and user defined filters. As the name suggests, predefined filters are defined on business/report cubes in advance in JReport Designer, and user defined filters are created on business/report cubes while they are used in JReport Viewer. Filters can be applied to business/report cubes in JReport Viewer in the following ways:

Applying a filter to a business/report cube while creating a report


1. In a JReport Viewer window, click Menu > File > New Page Report to display the New Page Report dialog. 2. Specify the title of the report as required in the Report Title text box. 3. In the Choose Report Layout box, select the layout as Banded, Crosstab, Table or Chart and then click OK. 4. In the corresponding report wizard, select the required business/report cube for the report, and the fields you want to display in the report. 5. Click the Query Filter screen. All the predefined filters of the selected business/report cube are listed in the Query Filter dropdown list. Choose the one you want to apply. If you want to further edit the filter, click the Edit button and then redefine the filter as required. The edited filter will then be saved as a user defined filter to the business/report cube. If you prefer to define a filter on your own, select User Defined from the Query Filter drop-down list, then define the filter according to your requirements. There are the basic and advanced modes of the screen for you to define either simple or complex filter expressions. See Filtering report data for details about how to define a filter. 6. Click Finish in the report wizard and the specified filter will be applied to the business/report cube, so that your report will get data that meets the filter condition only.

Applying a filter to a business/report cube while inserting a data component


1. In a JReport Viewer window, do either of the following:
r

Click Menu > Insert > Banded Object/Table/Crosstab/Chart, point to the destination, and then click the mouse button. Drag Banded Object, Table, Crosstab, or Chart from the Toolbox panel to the destination.

2. In the corresponding report wizard, select the required business/report cube for the component, and the fields you want to display in the component.

3. In the Query Filter screen, specify the filter you want to apply to the business/report cube from the Query Filter drop-down list, or define a filter according to your requirement. 4. Click Finish to create the component and the specified filter will be applied to the business/report cube.

Applying a filter to a business/report cube after a report is built


1. Select the component in a report which was created on a business/report cube by clicking anywhere in it, and then clicking the icon at the upper left corner of the component. 2. Click Menu > Report > Query Filter, or right-click the component and select Query Filter from the shortcut menu to display the Query Filter dialog. 3. From the Query Filter drop-down list, select the filter you want to apply to the business/report cube used by the component, or define a filter according to your requirement. 4. Click OK to apply the filter to the business/report cube. Notes:
q

A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license. Business/report cube filters are defined on the component level in JReport Viewer, which means each time you create a component, you can apply a filter to the business/report cube it applies to and it will not affect other components based on the same business/report cube. In JReport Viewer, you cannot edit the predefined filters that have been created on a business/report cube at the Designer side. You can just edit the condition based on a predefined filter and then the edited filter will be saved as a user defined filter.

Using cube elements


After a report has been built and published to JReport Server, you can open it in JReport Viewer and use the Resource View panel to analyze data of the report by dragging cube elements from the panel to the component (banded object, table or crosstab) in the report, provided that the data objects used by the component can be converted to corresponding cube elements (see the note in Analytic reporting for details). Tip: To display the Resource View panel, click Menu > View > Resource View or the Resource View button on the View toolbar. You can use the search bar at the top of the panel to search for any desired resource in a fast and convenient way. The following examples show how to analyze reports using cube elements. These examples are based on the WorldWideSalesRC report cube in Data Source 1 of the SampleReports catalog. The report cube contains thirteen dimension objects (City, Country, Customer Name, Region, State, Territory, Sales Month, Sales Quarter, Sales Year, Category, Product ID, Product Name, and Product Type), eleven detail information objects (Address 1, Country, Customer Name, CustomerCityStateZip, Phone, Cost, Discount, Order Date, Quantity, Total, and Unite Price), and three measure objects (Total Cost, Total Quantity, and Total Sales). Total calculates the value of the formula ("Unit Price" * Quantity - "Unit Price" * Quantity * Discount/100), Total Sales defines an aggregate function Sum on the formula Total, Total Cost is Sum on Cost, and Total Quantity is Sum on Quantity.
q

Example 1: Analyzing a banded report Example 2: Analyzing a crosstab report Example 3: Analyzing a table report

Example 1: Analyzing a banded report


1. In JReport Viewer, design a banded report titled Sales in China on WorldWideSalesRC, which shows the fields Product ID, Country, Product Name, Unit Price, Quantity, and Discount, and applies the ClassicBlue style.

First, we will apply a filter to the banded object to narrow down data scope. 2. Click the Filter button on the Analysis toolbar. In the Filter dialog, define the filter as COUNTRY = 'China'.

We want to further sort the banded object by Product Name ascending. 3. Right-click any of the Product Name values and select Sort > Ascend from the shortcut menu.

4. As the banded header panel holds no data, we can hide it by right-clicking it and selecting Hide from the shortcut menu. Now the report shows as follows:

Next, we will add the Total field to the banded object and group by the City field. 5. Click the Resource View button shown in the panel. on the View toolbar, then resources of the report cube the banded object uses will be

6. From the Resource View panel, drag the detail information object Total in the Orders Detail category to the detail panel of the banded object.

7. Drag the dimension object City in the Customers category to the banded page header panel, when a blue line appears, release the mouse button.

8. Finally, drag the measure object Total Sales in the Orders Detail category to the group footer panel.

9. We can now analyze the data in various ways. For example, if we want to see the sales by category instead of city, right-click on any of the City fields and select Drill To > Category from the shortcut menu, then we can see the same report with an entirely different view of the data.

Example 2: Analyzing a crosstab report


1. Design a crosstab report on WorldWideSalesRC showing product sales information with Product Type (Ascend) as the column field, Category (Ascend) as the row field, and Total Cost as the aggregate field. Apply the ClassicBlue style to the crosstab.

First, we want to replace the product type information with region information, and display the total sales of each product category in each region. 2. Remove Product Type from the crosstab by pointing to the header Product Type (Decaf or Regular), then dragging it outside the report page. A message box will prompt you whether or not to remove the field. Click OK to confirm, and we can see that the crosstab no longer contains the Product Type information. 3. Click the Resource View button in the panel. on the View toolbar, then resources of the report cube the crosstab uses will be shown

4. Drag the dimension object Region in the Customers category from the Resource View panel to the crosstab until a blue line appears indicating the group level of the dimension.

5. Drag the measure object Total Sales in the Orders Detail category to the aggregate area of the crosstab.

Now the total sales of each product category in each region is displayed.

6. Then we would like to see the territory information for the EMEA region. Click in the EMEA header and we will drill down to the next lower level based on the hierarchy defined in the report cube which in this case is Territory.

Using the same way, we can further drill down to the country, then the city levels which have been defined in the hierarchy to get detailed sales information in each city. For more details about drilling, refer to Automatic drilling.

Example 3: Analyzing a table report


For a table, you can analyze its data in the same way as for a banded object. Furthermore, JReport Viewer provides some analysis methods specific for tables. 1. Design a table report on WorldWideSalesRC, which shows the fields Product Type, Country, Product Name, Unit Price, Quantity and Discount, and applies the ClassicBlue style. 2. Add a filter COUNTRY = 'China' AND PRODUCT TYPE = 'Decaf' to the table (see Example 1 for details on filtering). The table displays as follows:

For a table, we can insert a column (or row for horizontal table) at a specific position. So next, we will insert the dimension object City into the table. 3. Click the Resource View button the panel. on the View toolbar, then resources of the report cube the table uses will be shown in

4. Drag City in the Customers category from the Resource View panel to the boundary between the first column (Product Type) and the second column (Country) in the table until a blue line appears.

The report result will be regenerated.

Note: When you add a column to a table, if the width of the table exceeds the defined page size, you will be prompted whether to allow JReport to adjust the page size automatically so as to place the column. Click Yes in the message box to have the page size adjusted, or No to make the columns in the table compressed. Also, If you do not want to display the message in future, check Don't prompt the message again in the message box, or uncheck Always Prompt Whether to Adjust Page Size Automatically in the Profile > Configure DHTML Profile > Properties > Default Properties tab. If you choose not to show the message box again, when the table width exceeds the defined page size, JReport will always adjust the page size automatically. Next, we want to show the total information and remove the product name information. This can be done with a single drag-anddrop. 5. Drag the detail information object Total in the Orders Detail category to the header Product Name until the label Product Name is highlighted in a blue background.

Now, the total value for each record will be generated.

As a table column can contain more than one field, next, we will add the measure object Total Sales to the Total column. 6. Drag Total Sales from the Resource View panel to any value in the Total column.

The report result will be regenerated.

Here 182,298.76 is the sum of all total values. In this way, the title for the added field will not be automatically created. At last, we want to change the order of the Total and Discount columns in the table. 7. Drag the label Total to the right of the Discount column, when a blue line appears along the right boundary of the Discount column, release the mouse button.

We can see that order of the columns changes.

Notes:
q

A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license. When you are using a report cube, the records will be fetched based on the query which contains the report cube in JReport Designer; while for a business cube, there is no predefined query and you will fetch records from the data source using dynamic SQL. To use the Resource View panel so as to add cube elements to the report, you should make sure that this ad hoc feature is enabled in the specified DHTML feature profile. This setting can only be made by administrators.

Using dynamic resources


When you drag cube elements from the Resource View panel to analyze data of a report, sometimes you may find that the cube elements that have been predefined in the business/report cube cannot meet your requirements, in which case, you can create some dynamic resources and use them in the report to get the desired data. Then when you save the report, the dynamic resources will be saved along with the report as its resources. Dynamic resources in JReport Viewer include formulas and measures.

Creating and using dynamic formulas


You should have some knowledge of the formula syntax before you can successfully compose a formula with no errors. To learn the formula syntax, refer to Formula syntax in the JReport Designer User's Guide. To create a dynamic formula: 1. In the Resource View panel, expand the Dynamic Resources > Formulas node, then click <Add Formula> to display the Formula Editor window.

2. Enter a name for the formula in Formula Name text field. 3. Compose the formula by selecting the required fields, functions and operators from the Fields, Functions and Operators boxes. You can also write the formula by yourself in the editing box. For details about the functions and operators, refer to Built-in functions and Operators in the JReport Designer User's Guide.

4. Click the Check button

to check whether or not the syntax of your formula is correct.

5. When done, click the OK button to create the formula. Once a dynamic formula has been created, you can then drag it from the Resource View panel to the desired position in the report as a detail information object for data analyzing. The formulas can also be used to control object properties if you are an advanced user and provided that the Use Dynamic Formula in Property is checked on the Report menu. Also, if you want to further edit an existing formula or remove any formula that is not required, right-click the formula and then click the corresponding command on the shortcut menu. However, if the formula has been used in the report or referenced by another formula, it cannot be deleted.

Creating and using dynamic measure objects


In JReport Viewer, you can also create dynamic measure objects by mapping them to the available resources which include dimension objects, detail information objects in the current business/report cube and the dynamic formulas that have been created in the report. To create a dynamic measure object: 1. In the Resource View panel, expand the Dynamic Resources > Measures node, then click <Add Measure>. The Add Measure dialog is then displayed.

2. In the Measure Name text field, specify the display name of the measure. 3. Click the chooser button mapped. next to the Mapping Name text field to specify the mapping name of the field to which the measure object is

4. From the Aggregate drop-down list, specify the aggregate function for the measure object. 5. When done, click OK to create the measure object. You can also create a dynamic measure object on a dynamic formula. To do this: 1. In the Resource View panel, right-click the formula in the Dynamic Resources > Formulas node, then select Create Measure from the shortcut menu. 2. In the Add Measure dialog, specify the display name of the measure object and the aggregate function as required. 3. When done, click OK. Once a dynamic measure object has been created, you can then drag it from the Resource View panel to the desired position in the report so as the get the desired data. And if you want to edit any dynamic measure object or delete it, right-click the measure object and click Edit or Delete on the shortcut menu (a measure object that has been used in the report cannot be deleted). Notes:
q

A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license. Currently, global variables and user defined formula (UDF) functions are not supported in dynamic formulas, and you can only save a dynamic formula with no errors into a report. When formulas reference display names or mapping names, the names should not contain any of below characters if the names are not quoted by double-quotation marks "": "~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "+", "=", "{", "}", "[", "]", "|", "\\", ":", ";", "\", " ' ", "<", ",", ">", ".", "?", "/"

Examples:
r

Expression @Customer#; will cause a syntax error. But @"Customer#" is ok. If a field has the display name [Link], when adding it to a formula, quote it as "[Link]" or "Category"."Measure". Dynamic resources are report tab level resources, which means they are only available to the report tab for which they are created.

Now in JReport, the display names of objects in a category in a business/report cube cannot be duplicated. When you choose to create a dynamic formula/measure object on an object which was created in a previous version and it has the same display name as another object, you will be prompted with a message asking you to give a new name for the object in JReport Designer first.

Drilling through the report data


In a DHTML report, you can choose to show certain groups of records according to your requirements, and switch among the groups to see the data you want. Moreover, you can define some methods to view specific data. This section presents three kinds of drilling in JReport Viewer. They are:
q

Automatic drilling User defined drilling Going

Automatic drilling
Automatic drilling enables you to switch from the current dimension to another dimension by using system-defined commands on the shortcut menu, and it is divided into four kinds:
q

Drill-to It enables you to obtain a different view of data by switching among dimensions. Drill-to-by-value It enables you to filter data based on a drill-to action so as to obtain a more detailed view of the data. Drill-down It enables you to drill data to lower dimensions according to predefined hierarchies. Drill-up It enables you to drill data to higher dimensions according to predefined hierarchies.

Drilling actions are performed on crosstabs, and grouped tables and banded objects, whose data are based on business/report cube or if on query, data fields of which can be converted to corresponding cube elements (see the note in Analytic reporting for details). After drilling, the new component can be analyzed in the same way as the original one. Assume you have created a crosstab report on the report cube WorldWideSalesRC in Data Source 1 of the SampleReports catalog showing product sales information with Region as the column field, Sales Year as the row field, and Total Sales as the summary field, and applied the default style to the crosstab. The crosstab shows as follows:

We will now take the crosstab as an instance to illustrate the automatic drilling functions.

Drill-to
1. Right-click any value of Region, APAC for example, and choose Drill To from the shortcut menu. The list of dimensions available for Drill To will appear on the submenu.

2. Click Product Type on the submenu, then in the regenerated result, we can see that Sales Year remains the dimension for rows and Product Type becomes the dimension for columns.

3. Repeat Steps 1 and 2 to drill the data to other dimensions. Row field can also be drilled freely. 4. To go back to the original report, right-click any value of Product Type, choose Drill To > Region from the shortcut menu.

Drill-to-by-value
1. Go back to the original report in the above example. 2. Right-click the value APAC of the Region dimension, and point to Drill to By Value on the shortcut menu. A submenu for the command is displayed, which lists the same items as those of Drill To. 3. Click Product Type too and the result will be regenerated.

We can see that the result is different from that of drill-to. This is because that, for the drill-to-byvalue action, the dimension of columns changes to Product Type by the Region value APAC. That

is, on the basis of the drill-to action, a filtering action where Region = APAC is further performed, and thus the result of drill-to-by-value is generated. In addition, when a drill-to-by-value action is performed, the Drill Filter panel will be displayed on the left of the JReport Viewer window, which shows the dimension and the value the filter is based on.

4. To go back to the original report, first delete the drill filter in the Drill Filter panel by clicking X next to the dimension name, then right-click any value of Product Type and click Drill To > Region from the shortcut menu.

Drill-down
Drill-down actions are based on predefined business/report cube hierarchies. The report cube WorldWideSalesRC contains a hierarchy Geography, which allows you to drill a dimension (corresponding to a high level) down to the one-level-lower dimension. 1. Go back to the original report in the above example, right-click the value APAC, on the shortcut menu, point to Drill Down, and we can see that Territory is listed as the submenu item.

2. Click Territory to see the result. It displays the data about territories in the Asia Pacific region.

3. The one-level-lower dimension for Territory defined in the hierarchy is Country. Now click Asia directly and JReport will also drill it down to Country.

After these two drill-down actions, we can see two filters are added in the Drill Filter panel, Region = APAC and Territory = Asia.

This is because, when you perform a drill-down action, a filter will be created based on the value you click on. In this example, we first click on the APAC region, so JReport drills this region onelevel down to display territories in APAC, and thus the filter Region = APAC is created. If you want all data in the one-level-lower dimension to be displayed when you drill down a dimension, you can remove the corresponding filter from the Drill Filter panel.

Drill-up
Drill-up actions allow you to drill a dimension (corresponding to a low level) up to the one-level-higher dimension. 1. Based on the report result after drill-down, right-click any value of Country, China for example, on the shortcut menu, point to Drill Up, and we can see that Territory is listed as the submenu item.

2. Click Territory to see the result. The dimension is drilled one level up. Territory is now the dimension for columns.

3. The one-level-higher dimension for Territory defined in the hierarchy is Region. Now right-click any value of Territory, Asia for example, on the shortcut menu, point to Drill Up and click Region, JReport will drill it up to Region.

Notes:
q

A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license. For banded object and table, you can right-click its group header/footer to show the shortcut menu so as to use the automatic drilling functions, you can also right-click field values in the group header/ footer to achieve this. For dimension objects that not used as group fields in a banded object or table, automatic drilling doesn't take effect. JReport allows you to define display names for items to be shown on the drill-related menu items. For detailed information, see Customizing the field display names in the JReport Designer User's Guide.

User defined drilling


Besides automatic drilling, JReport provides you with custom drilling functions including support for linking to another report and for linking to a detail report, making the analysis of a report more diverse and useful.

Linking to another report


A link to another report can be bound to a field, a label, an image, or a shape map area in JReport Designer. This is useful for viewing some information related to the current report, especially with viewing a report for comparison. To use a link in JReport Viewer: 1. Develop a page report in which a report tab contains an object which is linked to another report in JReport Designer. 2. Publish the report to JReport Server. 3. Run the report in DHTML format with JReport Viewer. 4. Click the trigger object in the report, or right-click the object and then select Link Report from the shortcut menu. 5. The linked report will then be shown.

Linking to a detail report


In most cases, your reports will be related to each other, instead of being isolated. Each report may have a particular emphasis on one or more aspects. In some circumstances, you may want to set up certain relationships among your reports so that you can browse from one report to another through the relationship "channels" that you create. Such an inter-report relationship network can be achieved by setting up "Anchor" and "Filter" conditions between two reports. You can use one report to hold comprehensive report data, and another to show detailed information on a specific topic. JReport reports can be joined together to compose a master/detail report group. Normally, a master report holds more comprehensive data, while detail reports hold related detail information. A detail report can be the master report of another report. In this way, by setting up more and more pairs of master/detail reports, many reports can be joined together, and a report chain is formed. To use master/detail reports in JReport Viewer: 1. Develop the page reports with master/detail relationship in JReport Designer. 2. Publish the reports to JReport Server. 3. Run the report which contains the master report in DHTML format on JReport Server. 4. Click the trigger object in the master report, or right-click the object and then select Detail Report from the shortcut menu.

5. You may be prompted to provide encoding and DB security information before the report result is produced. Click OK if you want to run a detail report using the same encoding and DB security settings as that of the master report. 6. The detail report will show only the records in conformity to the anchor and filter conditions. Notes:
q

In JReport Designer, you may find that the user defined drilling feature can provide more functions, such as assigning values to parameters of the link report or detail report automatically and passing style information to the link report. For detailed information, see Linking reports in the JReport Designer User's Guide. To make the detail report show only the records related to a trigger field value in the master report, you should specify the Target Frame option as Same Frame when you set up the master/detail relationship in JReport Designer. If you select Server Setting, you should further make sure that the Pop Up New Window for Links option has not been checked in the Profile > Configure DHTML Profile > Properties > Default tab. Otherwise, the detail report will be opened in a new web browser window with no relationship to the master report. A "link path", which tracks the linking (user defined drilling) actions, will be displayed in the Go To drop-down list on the navigation bar after you have drilled to the link report or detail report if it is opened in the current window. Clicking an item in the list will switch to the corresponding report.

Going
In a DHTML report, you can select to show certain groups of records in a banded object according to your requirements. You can also switch among the groups to see the data you want. This action is called going, which divides into go-to, go-up, go-down, and go-todetail, as indicated in the diagram.

Go-to The go-to action allows you to switch the data presented in a banded object from any group to any other group. Go-up Go-up means to jump up one group level to show the records of a particular group. Go-down Go-down means to jump down one group level to show the records of a particular group. Go-to-detail Go-to-detail allows you to concentrate on the details of a group.

Going actions are available only for banded objects that contain groups, and fields in which have not been converted to cube elements of a report cube. Going actions do not apply to banded objects created in JReport Viewer. After a going action has been performed, the data presented in the banded object will be re-loaded from the data buffer, showing only the records in the selected group, and the new report created by going can also be viewed, printed, and exported to other format in the same way as the original report. In addition, a "going path", which tracks the going action, will be displayed in the Go To drop-down list on the navigation bar, with which you can easily return to the original report. The following describes the use of the going actions based on Banded_Link.cls in the SampleReports folder of Public Reports, which contains a banded report.

Go-to
1. Run Banded_Link.cls.

2. Point to the region APAC, right-click and select Go To > APAC > Vietnam from the shortcut menu.

Then only the data about Vietnam is displayed.

3. To return to the original status, right-click any value and then click Go To > ROOT on the shortcut menu; or from the Go To dropdown list on the navigation bar, select Product Sales by Country. You may notice that the result is not dependent on what you right-clicked, in other words, you can right-click any field value in the banded object or even the blank part of a group header/footer panel or detail panel, in order to perform a go-to action.

Go-up
For a go-up action, you need to right-click a group header/footer panel or any object in the panel, at the same time, you should make sure that this group level is lower than some other group levels. 1. Undo the go-up action in the above example. 2. Point to any country, for example China, right-click and select Go Up > LATAM from the shortcut menu.

Then only the data about LATAM is displayed.

At Step 2, you may find that items listed on the Go Up submenu are regions of the Region group level which is one level higher than the current group level - Country. That is, the go-up action allows you to focus your attention on the groups of a higher level than what you right-click.

Go-down
For a go-down action, you need to right-click a group header/footer panel or any object in the panel, at the same time, you should make sure that this group level is higher than some other group levels. 1. Undo the go-up action in the above example. 2. Point to APAC, right-click and select Go Down > Singapore from the shortcut menu.

Then data about Singapore is displayed.

At Step 2, you may find that items listed on the Go Down submenu are countries of the Region group level which is one level higher than the group level of Country, and only countries in the Asia Pacific (APAC) region are displayed. That is, the go-down action allows you to focus your attention on the groups of a lower level than what you right-click, and only those lower-level groups which are related with the higher-level group value you right-click will be concerned.

Go-to-detail
If a banded object contains group information, then a field, label, image or shape map in a group header/footer panel of the banded object can be used to obtain information of that group, and a chart in a banded object also has the similar function. The go-to-detail action should be predefined at report design time. You can refer to Obtaining detailed information from a banded object in the JReport Designer User's Guide for more information. 1. Undo the go-down action in the above example. 2. Point to LATAM, right-click and select Go to Detail from the shortcut menu. Then only the data about this region is displayed.

Manipulating data components


You can manipulate data components, which refer to crosstabs, tables, banded objects and charts, in JReport Viewer as shown below. However, most of the manipulations require selecting the component first. To select a component, click anywhere in the component, when the icon appears at its upper left corner, click the icon. Note: When manipulating data components, a JReport Live license for JReport Server is required in order to use the features involving report cube/business cube or changes of report template. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license.

Setting the number of records retrieved by data components


You can set the number of records that can be retrieved by all data components in a report. To do this, select a value to your liking (All or first 50 to name a few) from the Max Records combo box on the Analysis toolbar. You can also directly input a positive integer here and press Enter to retrieve the corresponding records. Alternatively, you can click Menu > Report > Max Records to show the Max Records dialog, and then achieve the same goal. If you are making a lot of changes to the report, it may be faster to limit the number of records to 1 page while you make the changes then change it back to All to view the final result.

Manipulating a crosstab
q

Changing the dimension index in a crosstab The dimension index in a crosstab can be modified, namely, you can move a dimension to a higher or lower level. This operation can be performed on crosstab's containing two or more dimensions. To do this, you can simply drag a dimension object (row/column header) to the required destination till a blue line appears. You can also drag a column header to a row level and vice versa. Rotating a crosstab Columns and rows in a crosstab can be exchanged. This operation is called rotating a crosstab. To rotate a crosstab, first select it, and then do one of the following:
r

Click Menu > Report > Rotate Crosstab. Click the Rotate button Right-click the icon on the Analysis toolbar.

of the crosstab and select Rotate from the shortcut menu.

Expanding/Collapsing a crosstab For a crosstab, if it has more than one row/column group level, you can specify whether or not to enable the crosstab to be expanded in JReport Viewer, and set the default expanding/collapsing state of groups in outer levels. For details, see Expanding/Collapsing a crosstab in the JReport Designer User's Guide. Adjusting the width of crosstab fields according to the contents When the contents in the field of a crosstab need more space to completely display, you can adjust

the width of the field according to its contents. To achieve it, first select the field, then right-click on it and select Auto Fit from the shortcut menu.

Manipulating a table
q

Adjusting order of columns in a table The order of columns in a table can be easily adjusted. To do this, drag a column header to the left or right boundary of another column header, when a blue line appears along the column boundary, release the mouse button, and you will see the order change. The above description is for a vertical table. With regard to a horizontal table, you can do the same actions on its row headers.

Adjusting grouping order in a table A table may contain several group levels. The order of the group levels can also be adjusted. To do this, drag a group field value to the required position until a blue line appears. Hiding/Deleting table columns A table column (for a horizontal table, the "column" corresponds to a field row) can be hidden or removed. To do this, select the cell of the column in the table header and right-click, then select Hide Column or Remove Column from the shortcut menu, and the column will be hidden or removed from the table. Showing table columns of the You can specify which columns will be shown in a table. To do this, right-click the icon table, then on the shortcut menu, check the names of the columns you want to show from the Show Column sub menu. Adjusting the width of table columns according to contents When the contents in cells of a table column need more space to completely display, you can adjust the width of the table column according to the contents. To do this, right-click the cell of the column in the table header, then select Auto Fit from the shortcut menu. Changing group direction You can make the group headers that are placed horizontally in a table to be displayed vertically. To do this, right-click the group header row and select Vertical to Detail from the shortcut menu. In addition, if the first column of a table is group column, you can specify to place the group column horizontally in a table. To do this, right-click the cell of the group column in the table header, and select Horizontal to Detail from the shortcut menu. Rotating a table You can rotate a table to switch its appearance between the horizontal and vertical layout modes by doing one of the following:
r

Click Menu> Report > Rotate Table. Click the Rotate button Right-click the icon on the Analysis toolbar.

of the table and select Rotate from the shortcut menu.

Inserting table columns You can insert a new column in a table and it could be a common column, detail column, summary column, or group column.
r

To insert a common column into a table:

1. Right-click any cell in the table header, or right-click the icon 2. On the shortcut menu, click Insert > Common Column.
r

of the table.

To insert a detail or summary column into a table: of the table, then select 1. Right-click any cell in the table header, or right-click the icon Insert > Detail Column/Summary Column from the shortcut menu. 2. In the corresponding insert column dialog, specify the resource you want to use for the new column, then click OK.

To insert a group column into a table: 1. Right-click any cell in the table header, or right-click the icon Insert > Group Column from the shortcut menu. of the table, then select

2. In the Insert Group Column dialog, select the dimension object you want to use for the new group column from the Resources box and click to add it as the group by field, then specify the sorting direction of the group in the Sort column. 3. Specify the positions of the group by fields: Group Above, Group Left Above, or Group Left. 4. Repeat the above steps to add more groups if required. 5. Click OK to insert the columns. The next time when you open the Insert Group Column dialog to add more group columns, all the added group by fields will be listed in the dialog. You can choose to remove or edit them if required. Note: If you right-click any cell in the table header and use its shortcut menu to insert a common, detail or summary column, the column will be inserted before the column in which the cell you click on is, however, if you use the table shortcut menu to insert the column,
r

If it is a common column, the column will be inserted as the last column in the table. If it is a detail/summary column, the column will be inserted after the last detail/summary column, or as the last column in the table when there is no detail/summary column.

Converting table columns You can convert a group column into a detail column, and vice versa.
r

To convert a group column into a detail column, select the cell of the group column in the table header, right-click and select Convert to Detail from the shortcut menu, then the conversion is done. To convert a detail column into a group column: 1. Select the cell of the detail column you want to convert in the table header, right-click and select Convert to Group from the shortcut menu. 2. In the Select Group Position dialog, specify the position for the newly converted group by field. 3. Click OK to save the changes.

Aggregating on a detail column You can summarize the data in a detail column if required. To do this: 1. Select the cell of the detail column in the table header, right-click it and select Aggregate On

from the shortcut menu. 2. In the Aggregate On dialog, specify a function from the Function drop-down list to summarize the field in the detail column. 3. When done, click OK.
s

If the table has groups, the aggregation will be created for each group in every group level and the whole table at the same time. If the table has no groups, the aggregation will be created based on the whole table.

When you finish aggregating on a detail column, you will find a dynamic measure object is created which is given a default name Function_DetailFieldName in the Dynamic Resource > Measures list in the Resources View panel and you can use it again in the current report if required. Note: If a table is created in JReport Designer, you can add, convert columns in the table, or aggregate on its detail columns in JReport Viewer only when data fields used by the table can be converted to corresponding cube elements. See the note in Analytic reporting for details.

Manipulating a banded object


q

Hiding/Showing a panel in a banded object of the banded A panel in a banded object can be hidden or shown. To do this, right-click the icon object, then on the shortcut menu, click the item which indicates the panel name from the Show sub menu. For a panel which is shown, the item is with a check mark, and vice versa. This operation is also applicable for hiding/showing a row in a table. Hiding/Showing DBFields and labels in a banded object The DBFields and their corresponding labels in a banded object can be hidden or shown. To do this, right-click the icon of the banded object, then on the shortcut menu, click the fields and labels you want to show from the Show Field sub menu. For a field or label that is shown, it will be marked with a check mark, and vise verse. Expanding/Collapsing a group panel in a banded object Group panels in a banded object can also be expanded or collapsed. For details, see Managing the data of a banded object in the JReport Designer User's Guide.

Manipulating a chart
q

Modifying the definition of a chart You can modify the definition of a chart, including the chart type, data display, and style. To do this: 1. Right-click the icon of the chart or any part of the chart other than the legend and label to show a shortcut menu, and then select Format Chart from the shortcut menu to display the Chart Definition dialog. Note: In the event that the chart is built in JReport Designer, the Format Chart command will be available only when JReport Viewer can convert data fields used by the chart to corresponding cube elements. See the note in Analytic reporting for details.

In the Chart Type tab of the Chart Definition dialog, specify the type for the chart. In the Display tab, change the dimension and measure object used by the chart.

In the Style tab, modify the style for the chart as required. If there is only one style available, this style will be applied to the chart by default and the Style tab will be hidden from the dialog. Upon finishing, click OK to apply the modifications. For details about how to modify the chart definition with the Chart Definition dialog, see Creating a chart report. In addition, if you only want to change the chart type, no matter whether the chart is originally created in JReport Designer or JReport Viewer, you can achieve it by doing one of the following:
r

Right-click the chart and on the shortcut menu, select the required type from the Chart Type submenu, which lists all the chart types and subtypes (the current one and the inapplicable subtypes are grayed out). Select the chart, click the Chat Type button suitable subtype from the drop-down menu. on the Analysis toolbar, and then select a

Formatting chart elements The elements (platform, paper, legend and label) in a chart can be formatted to suit your requirement.
r

To format the platform/paper of a chart, right-click the icon or any part of the chart except for the legend and label and select Format Platform/Format Paper from the shortcut menu. In the displayed format dialog, specify the settings as required. For details about the settings, refer to Format Platform dialog and Format Paper dialog. To format the legend/label of a chart, right-click the legend/label and select Format Legend/ Format Label from the shortcut menu. In the displayed format dialog, set the properties according to your requirement. For details about the properties, see Format Legend dialog and Format Label dialog.

Adding conditional formats to fields


You can add some conditional formats to a field, which refer to the DBField, parameter field, formula field, summary field, and the special field Page Number or User Name, then when the specified condition is fulfilled, the defined format will be applied to the field values for highlighting. To add conditional formats to a field, 1. Right-click the field and select Conditional Formatting from the shortcut menu to access the Conditional Formatting dialog.

2. Click the button

to open the Edit Conditions dialog to define the condition as required.

There are the basic and advanced modes of the dialog for you to define either simple or complex condition expressions. See Filtering report data for details about how to define a condition. 3. When done, click OK to save the condition. The newly added condition will then be displayed and highlighted in the Condition box in the Conditional Formatting dialog. 4. In the Format box, set the format which will be applied to values of the field when the specified condition is fulfilled, for example, the font face, font size, font color, etc. 5. Repeat the above steps to add more conditions and define the format for each condition as required. To edit a condition, select the condition in the Condition box, then click edit the condition expressions as required. . In the Edit Conditions dialog,

To remove a condition and the corresponding format, select the condition in the Condition box and click

To adjust the priority of a condition, select the condition in the Condition box and then click 6. Click OK to apply the conditional formats to the field.

or

See also Conditional Formatting dialog and Edit Conditions dialog for details about options in the dialogs.

Converting between components


Converting between components enables you to view and analyze data from different aspects with different focuses. In JReport Viewer, you can convert a crosstab into a chart and vice versa, however, if a crosstab/chart is designed in JReport Designer, to enable the conversion, you need to make sure that data objects used by the crosstab/chart can be converted to corresponding cube elements (see the note in Analytic reporting for details). Note: A JReport Live license for JReport Server is required in order to use this feature. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license.

Converting a crosstab into a chart


To convert a crosstab into a chart: 1. Click anywhere in the crosstab, when the icon select the crosstab, then do any of following:
r

appears at its upper left corner, click the icon to

Right-click the icon

and select To Chart from the shortcut menu.

Click Menu > Report > To Chart.

2. The Convert Data Fields dialog may appear for your confirmation on converting data fields of the crosstab to cube elements of a business/report cube. Click OK to confirm, and the To Chart dialog will be displayed. 3. In the Chart Type tab, specify a suitable type for the chart. With a certain type specified, you can further define the chart as a combo chart by clicking <Add Combo Type> in the Chart Type Groups box. 4. In the Display tab, the Resources box lists all the cube elements used in the selected crosstab including dimension and measure objects. The chart can only be defined based on the cube elements listed. Add a dimension object to the Series box, and measure objects from the Resources box to the Category box, and so to the Show Values box respectively.

5. In the Style tab, set the style for the chart as required. If the crosstab is in a table or banded object, by default, the chart converted from the crosstab will take on the style of the table or banded object. If you want to apply another style to the chart, uncheck the Inherit Style option and choose the desired style in the Style box. However, when there is only one style available, this style will be applied to the chart by default and the Style tab will be hidden from the dialog. 6. Click the OK button to finish the conversion.

Converting a chart into a crosstab


To convert a chart into a crosstab: 1. Click anywhere in the chart, when the icon appears at its upper left corner, click the icon to

select the chart, then do any of following:


r

Right-click the icon or any part of the chart except for the legend and label, then click To Crosstab on the shortcut menu. Click Menu > Report > To Crosstab.

2. The Convert Data Fields dialog may appear for your confirmation on converting data fields of the chart to cube elements of a business/report cube. Click OK to confirm, and the To Crosstab dialog will be displayed. 3. In the Display tab, select a dimension object in the Resources box and click to add it as a

and click to add it as an group field to the Columns or Rows box; select a measure object aggregate field to the Aggregates box. Repeat these to add more aggregate fields. In the Display Name column, you can edit the display name of a group field or aggregate field, and the Sort columns allow you to specify a sorting manner on a group field. If you want to remove any group/aggregate field, select it and click . or .

To adjust the order of group/aggregate fields, select a group/aggregate field and click 4. In the Style tab, apply a style to the crosstab as required.

If the chart is in a table or banded object, by default, the crosstab converted from the chart will take on the style of the table or banded object. If you want to apply another style to the crosstab, uncheck the Inherit Style option and choose the desired style in the Style box. However, when there is only one style available, this style will be applied to the crosstab by default and the Style tab will be hidden from the dialog. 5. Click OK to finish the conversion. Note: Additional values are supported only in chart. If you convert a chart with additional values into crosstab, the additional values are not converted together with the chart.

Navigating through the report data


You can use the TOC Browser to navigate through a report. To show the TOC Browser, click Menu > View > TOC Browser. In the TOC Browser, expand the Report node, select a component or a node with the group value that you want to browse to. The page that contains the component or the matching data will then be shown. The table of contents on the TOC Browser is organized into a tree structure. The root node represents the report tab that you are currently viewing. The component names indicate components in the report tab. The group values show hierarchical groups. TOC in JReport Designer Just like a report, the format of the TOC is designed in JReport Designer. In the root node in the Report Inspector of JReport Designer, there is an object named TOC. You can modify its properties to customize your TOC style. TOC Anchor Besides the groups, you can also add your own nodes to the TOC Browser. Most components in JReport Designer hold a property called TOC Anchor which holds a Boolean value. If the TOC Anchor property value is true, a node for this object will then be added to the TOC tree. When you click such a node, JReport Viewer will turn to the page that contains this component. Some objects, such as group panels, summaries, subreports, and cube elements hold a true value for the TOC Anchor property by default, which means that by default they will appear in the TOC Browser. Moreover, you can type a string or even a formula as the Anchor Display Value property for a component holding a true TOC Anchor property, so that your input for that object can be displayed in the TOC Browser instead of the default value.

Applying a style
A style can be applied to a report in order to change its appearance and characteristics. You can create and set up your own styles in JReport Designer. When you publish your reports to JReport Server, you can include these custom styles with the published reports. When you run a report, the style feature will be enabled and you can select a style to apply to the report. After applying a style, the banded objects, crosstabs, charts, and tables in the report will take a uniform appearance. By default, the style feature is enabled in JReport Viewer. In order to apply a style to a report, click Menu > Report > Style and select the required one from the submenu, or select the required style from the style drop-down list on the toolbar. You can also right-click a table, crosstab, chart, or banded object in the report and select Apply Style from the shortcut menu to select the required style in the Apply Style dialog. However, if there is only one style available to the report, this style will be applied to the report by default, in which case, you will find that all these style related commands are hidden. Reference: See also the chapter Styles in the JReport Designer User's Guide for more information about how to work with styles at report design time.

Working with reports via URL


Besides working on interfaces, most of the JReport Viewer operations such as filter, sort, search, save and so on, can also be accomplished via URL. When using URLs to access JReport Viewer, you should follow the specifications described in this section. The URL in DHTML is: [Link]
q

http The web service protocol. localhost The host address. 8888 The port. dhtml?sessionid=XXXXXXX&rptsetid=XXXXXXX&rptname=XXXXXXX& The path. ? URL separator. = URL separator. & URL separator. op The key of operation in DHTML.

There are some methods in the file [Link] located in <intall_root>\public_html\javascript\dhtml. These methods are the tools you can use to generate URLs. The result of each of these functions will be a URL.
Parameter Key Description Download Report Operation code Export report type Example Note op ty op=51&ty=2
q

Value

51 2/3/4/5/6/7 means PDF/PostScript/RTF/TEXT/EXCEL/XML respectively.

The order begins with 2. A file of HTML type cannot be downloaded.

Prototype Exit Prototype Navigate Page Operation code Example Note Prototype

function user_downloadReport(type) function user_exit (popwin) op 24 1...n

Page number pn op=24&pn=2 function function function function op

The page number begins with 1 and is less than total page number. user_firstPage() user_lastPage() user_nextPage() user_prevPage() 25

One Step Filter Operation code

The column name Operator of filter condition The column value Logic of filter condition Instance name of the column Example Note Prototype Operation code The column name The column value Whether or not to search content only

col operator

Mapping the name of a column in JReport. eq/gt/geq/lt/leq/neq, means "equal to/greater than or equal to/greater than/less than/less than or equal to/unequal to" respectively.

value logic AND/OR/END, means "and/or/end" respectively.

comp

component instance name

op=25&col=CusID&operator=eq&value=1&logic=OR&col=CusName&operator=0&value=ZhangKe&logic=2&comp=convert_sectionObject The value is case-sensitive. function user_oneStepfilter(columns, operators, values, logics, instanceName) op column value isContent 128 Mapping the name of a column in JReport. the value to search for true/false

One Step Search

Whether or isMatchCase not to match case The search direction isUp

true/false

true/false

Whether or isWholeWord true/false not to match whole word op=128&column=CusID&value=1&isContent=true&isMatchCase=false&isUp=false&isWholeWord=false Example Prototype One Step Sort Operation code The column name The column sort order Instance name of the column Example Note Prototype Open Report JSP page Action /dhtmljsp/[Link] [Link] jrs.try_vw path/name op col ord comp 12 Mapping the name of a column in JReport. true/false component instance name function user_oneStepSearch(value, isContent, colName, isUp, matchcase, isWholeWord)

op=12&col=CusID&ord=true&col=CusName&ord=false&comp=convert_sectionObject The value is case-sensitive. function user_oneStepSort(columns, sorts, instanceName)

Report name [Link] Catalog path [Link] Result type Example Note

jrs.result_type int [Link] =&[Link].try_vw&[Link]=%2fSampleReports%[Link]


q

The path delimiter is "/". If you encounter problems, you can replace it with "%2f". The version number can be none, as with the example.

Open RSD File JSP page Result path Result name /dhtmljsp/[Link] [Link] [Link] path/name path/name

Result version number Example Note

jrs.rst_version

int

[Link]
q

The path delimiter is "/". If you encounter problems, you can replace it with "%2f". The version number cannot be none.

Redo Operation code Example Prototype Refresh Operation code Example Prototype Reset Operation code Example Prototype Save Report Operation code Example Prototype Search Next Operation code Example Prototype Show Help Dialog ID Example Note Prototype Prototype HELP_OP 182 [Link] The URL gets the body of a window, you should put it as xxx in [Link]("xxx", ..) function user_showHelp(helpId) function function function function function function function function function function function function function op op=84 function user_undo() op val op=50&val=250 50 0~400 user_showUserPanel() user_showTOC() user_showDHTMLView() user_showToolbox() user_showSortDialog() user_showFilterDialog() user_showNewRptDialog() user_showOpenRptDialog() user_showSaveAsDialog() user_showPageSetupDialog() user_showSaveResultDialog() user_showPageSetupDialog() user_showPrintDialog() 84 op op=34 function user_showSaveResultDialog() 34 op op=82 function user_saveRpt() 82 op op=76 function user_reset() 76 op op=83 function user_refresh() 83 op op=85 function user_redo() 85

Show Export to Dialog

Show Panel or Dialog

Undo Operation code Example Prototype Zoom Operation code Proportion Example Note

val must be an integer between 0 and 400

Prototype

function user_zoom(value)

Tuning JReport Viewer performance


JReport provides you with methods for adjusting DHTML performance. You can limit the number of DHTML reports open simultaneously by setting the DHTML preferences on the JReport Administration page. Furthermore, you can modify a property file to control the Action Task Manager, which can improve DHTML service performance.

Limiting the number of simultaneously open reports


Whether or not an open DHTML report interacts with the server, it holds many resources. As a result, opening many reports will decrease server performance. Thus, JReport allows the administrators to specify the maximum number of DHTML reports that can be open at the same time so as to prevent large numbers of DHTML reports from being open simultaneously and to improve the server performance. To set the maximum number of DHTML reports that can be open at the same time: 1. On the JReport Administration page, click Profile on the system toolbar and then select Configure DHTML Profile from the drop-down menu. 2. Click the Properties > Advanced tab. 3. Check the Maximum Number of Open Reports option and type the number to your requirement in the text box. 4. Click OK upon finishing. If the number of open reports exceeds the limit, an error page will be displayed prompting you to close one before opening a new one. Note: The Maximum Number of Open Reports option works together with the maximum number of concurrent reports allowed by your product license. Of these two values, whichever is smaller will be used as the real maximum number of open reports allowed. For example, if the value of the Maximum Number of Open Reports option is 10, and the number that the license allows is 20, 10 will be used as the maximum number of DHTML reports that can be opened simultaneously; however, 10 non-DHTML reports may use the remaining licenses.

Action Task Manager


Some DHTML operations require a large amount of memory and CPU processing power. The Action Task Manager improves DHTML service performance by preventing a large number of actions from being run simultaneously. The Action Task Manager coordinates DHTML actions through two fixed-size tables:
q

Concurrent Processing Table - This registers the requests that are currently being processed by the DHTML service. Waiting Requests Queue - This registers the requests that are waiting for being processed by the DHTML service.

Note: Only certain operations that consume considerable hardware resources need to be prevented from being run at the same time. You can define which kind of requests need to be queued before being processed.

When a new DHTML request reaches the server, it will be processed according to the following flow: 1. The DHTML service determines whether the requested operation is a restricted action. If it is, the Action Task Manager will take over the request. Otherwise, it will be processed directly, without being managed by the Action Task Manager. 2. If the Concurrent Processing Table is full, the restricted request will be assigned to the Waiting Requests Queue. If the queue is full, the DHTML service will refuse the request and return a warning message. 3. After the request has been processed, it will be de-registered from the Concurrent Processing table. The DHTML service will then automatically continue to process the requests in the Waiting Requests Queue. By using the property file [Link] provided in JReport Viewer, you can balance the server load by adjusting table sizes and specify which kind of requests are managed by the Action Task Manager.

[Link]
The [Link] file is located at <install_root>\bin. It allows you to control three major options for the Action Task Manager:
q

Specifying the size of the Concurrent Processing Table

Use [Link]=[integer] to set the maximum number of requests that can be processed simultaneously. The value of this property can be equal to or larger than 0. Use 0 (default) to disable the request queue feature.
q

Specifying the size of the Waiting Requests Queue table Use [Link]=[integer] to set the maximum number of to-be-handled requests that the queue can contain. The value of this property can be equal to or larger than 0. 0 means no requests will be stored in the queue. A request will either be handled by the DHTML service or be rejected when the maximum limit of the Concurrent Processing table has been reached.

Specifying the actions that can be applied for the DHTML Request Queue feature These are listed below: [Link]=false [Link]=true [Link]=true [Link]=true [Link]=true [Link]=false [Link]=true [Link]=true [Link]=true [Link]=true # # # # # # # # # # Action: Action: Action: Action: Action: Action: Action: Action: Action: Action: DHTML report initialization Undo Redo Drilling Drilling up Refreshing Filtering Sorting Searching Finishing creating a new report

These properties will only work when the queue feature has been enabled by setting [Link]. [Link]>0. True - The action will be handled by the Action Task Manager. False - The action will not be handled by the Action Task Manager, but be directly processed by the DHTML service without being queued.

Web Reports
JReport provides the web reporting solution for faster and simpler design and creation of reports using a web browser. Web reports are viewed using a new interactive viewer called JReport Studio. JReport Studio provides a much nicer end user experience with many powerful features for interfacing with a report such as changing parameters without re-running the report. In addition, JReport Studio still supports exporting the report to all supported output formats. The data sources that can be used to create web reports are business views that are resources built on top of queries. Business views are created and managed in JReport Designer (for details, see Business Views in the JReport Designer User's Guide). In JReport Server, web reports are created via the JReport Studio Wizard using a browser and are opened and edited via JReport Studio. Using JReport Studio Wizard, it is easy to create complex reports with multiple components in a tabular style layout. Web reports also allow for company logo and titles to be placed on the top of the page for more formal presentation. A web report template contains only one report and uses .wls as the file suffix. Web reports are stored in the JReport Server resource system and follow the server resource and version management rules such as archive policy and permission setting. JReport Designer supports creating, opening, and editing of web reports (for details, see Web Reports in the JReport Designer User's Guide). JReport Designer also allows for web reports created on JReport Server to be downloaded to Designer and further edited. This chapter covers the following topics to help you better interact with web reports
q

Why web reports and when to choose them Components supported in web reports JReport Studio window elements Creating web reports via wizard Editing web reports in JReport Studio Running web reports on server

Notes:
q

A JReport Live license for JReport Server is required in order to use web reports and all the related functions. If you do not have a Live license please contact your Jinfonet Software account manager to obtain a license. JReport Studio Wizard and JReport Studio support Internet Explorer 8, Firefox 3.5, Google Chrome 5, and higher versions.

Why web reports and when to choose them


JReport Studio displays web reports (which are also called web layout reports) that are aimed at easier and faster report creation and design, faster report execution, easier customization, and better presentation style using a newer Rich Internet Application (RIA) Web 2.0 interface. Web reports also support agile development techniques such as continuous integration by allowing report templates to be updated by both JReport Studio and JReport Designer.
q

Fewer functions Web reports (.wls) support a subset of functions of JReport page reports (.cls). The basic and essential functions not only guarantee a good report presentation, but also make the report design experience easier for a new user of JReport. Single report solution Only one report in a web report speeds up the report running process as compared to a multiplereport page report. Tabular style layout The creation of a page report using the Standard Report Wizard can only create one data component (table, crosstab, chart, or banded object) using the wizard. The JReport Studio Wizard provides a tabular style layout in which you can place a table, crosstab or chart in each tabular cell so as to achieve a holistic layout with multiple components from the very beginning. Predefined report templates Web reports allow you to choose a starting template so you can predefine the template to include standard features such as company logo, company name, privacy notices or any standard items and styles you want your users to start with. Fast report rendering At runtime, JReport Studio provides much higher performance when viewed from a browser compared to viewing a page report using JReport Viewer. Using JReport Viewer, all of the user action requests must be sent to JReport Server which renders the new page on the server and updates the browser view. Using JReport Studio, many of the actions which require only a change in rendering the view are done locally on the client in the browser. By using JReport Studio, JReport Engine is structured so that as much of the processing as possible is completed on the client side allowing much higher salability for JReport Server allowing the server to handle more simultaneous users. Oriented toward presentation rather than analysis Unlike page reports, web reports do not support slicing and dicing data since the data source for web reports has been designed with no hierarchical relationship between the data objects. Create web reports if you do not want to analyze report data such as drilling down and drilling up, but look forward to an excellent Web 2.0 presentation. Creation and edition in both JReport Server and Designer Web reports created using the JReport Studio Wizard can be downloaded from JReport Server and edited in JReport Designer and web reports can be created in JReport Designer and published to server just like .cls reports. However, page reports created using the Standard Report Wizard can only be edited in the server. Designer can view these reports but not modify them and publish them. Also, JReport Designer can be used to create web reports which can be run in JReport Studio on the server and saved as a template to use in JReport Studio. JReport Designer cannot directly create the temple but can create the report and then using JReport Studio, save the report as a template (.

wslt).
q

Standard banded objects not supported Page reports support standard banded objects which are not supported by web reports.

Components supported in web reports


Components are the objects that you can place in a report. JReport provides a full set of components that allow you to present and control the report data and presentation in a wide variety of ways. Web reports support the following report components:
q

Labels A label is an object that contains a string. It is typically a brief description used to identify a field or other value nearby. Images An image is a digital representation of a picture. The following image types are suppported in web reports: .gif, .jpg, and .png. DBFields DBFields, or database fields, are fields directly from columns in the database or other data source such as XML or Java objects. Formulas Formulas are calculated from DBFields, other formulas, summaries, and parameters, so they can present information which is not available directly from the database fields. Summaries A summary is a special kind of formula. A summary generates a count, average, sum, standard deviation or other transformation of a set of data values. A summary applies to a defined group of data. Summaries are required to provide the data values for charts as well as totals for table reports. Parameters A parameter in JReport is a variable whose value is determined at runtime. The runtime parameters help you dynamically control your report results such as filtering data. Special fields Special fields are defined by JReport and allow you to easily obtain system information and reportrelated data and add it to your report. All special fields are supported to insert into web reports in JReport Designer. However, due to the characteristics of JReport Studio, only these can be rendered and edited in JReport Studio: User Name, Modified Date, and Modified Time. Web controls Web controls are report components designed to be similar to the kinds of controls found on web pages. Currently, the following four web controls are supported in web reports: parameter control, parameter form control, filter control, and navigation control. Multimedia objects Multimedia objects include Flash, Real Media, and Windows Media objects. Tabular A tabular is a component designed to lay out other components. There is one and only one tabular in a web report. Tables A table gives you great control over how to present data, including placing fields, grouping them, and sorting them. It is composed of rows and columns, and each contains several cells. With such a

structure a table is a good way to show any two-dimensional dataset.


q

Crosstabs A crosstab summarizes data and presents the summaries in a compact row and column format. Charts A chart organizes and graphically presents data in a way that makes it easy for end users to see comparisons, trends, and patterns in data. It represents the report data in a visually straightforward form. Currently, these types of chart are supported in web reports:
r

Clustered Bar 2-D Stacked Bar 2-D 100% Stacked Bar 2-D Clustered Bench 2-D Stacked Bench 2-D 100% Stacked Bench 2-D Line 2-D Stacked Line 2-D 100% Stacked Line 2-D Area 2-D Stacked Area 2-D 100% Stacked Area 2-D Clustered Pie Clustered Donut Gauge Dial 2-D Bullet 2-D

For details about each type, see Chart types in the JReport Designer User's Guide. For how charts present data, see How data is represented in a chart in the JReport Designer User's Guide. For the elements that compose a chart, see Chart elements in the JReport Designer User's Guide. Tip: In JReport, the components that can be bound with a data source are also referred to as data components. These components include tables, crosstabs and charts.

JReport Studio window elements


The main page of JReport Studio consists of the user information bar, menus, toolbar, left panels and report area. The options for browsing or controlling a web report are as follows:
Toolbar/Menu File Button Tool Name New Report Open Save Save As Description Creates a new web report based on an existing business view. Opens a report. Saves the changes of the current web report. Saves a copy of the web report or the report template in the current web report to server resources. Exports the report result to disk or version in various formats. Configures the report page settings. Prints the report result to a PDF/HTML file. Closes the current web report and exits JReport Studio releasing all of the resources. Undoes the last operation. Reverses the operation of Undo. Deletes the selected object. Opens the report wizard for you to edit the selected table, crosstab or chart. Filters the report records according to the filter criteria you specify. Converts a crosstab into a chart. Converts a chart into a crosstab. Rotates a crosstab to exchange the axes on the crosstab in order to create a different view of the crosstab. Defines properties of the report body. Shows the hidden components you specify. Applies a style to the selected components or the whole report. Shows or hides editing marks (dashed outlines for objects and report body). If the option is unselected, the editing mark will not be shown when a report object receives focus, and report objects cannot be moved or resized. Runs the report using previously provided parameters. The Refresh operation fetches the data again. Inserts a table into the report.

Export Page Setup Print Exit

Edit

Undo Redo Delete Wizard Filter To Chart To Crosstab Rotate Crosstab

Report Body Properties Unhide Components Style View Editing Marks

Refresh

Insert

Table

Crosstab Chart Parameter Control Parameter Form Control Filter Control Navigation Control Label Image Multimedia Object Format Font

Inserts a crosstab into the report. Inserts a chart into the report. Inserts a parameter control into the report. Inserts a parameter form control into the report. Inserts a filter control into the report. Inserts a navigation control into the report. Inserts a label into the report. Inserts an image into the report. Inserts a multimedia object into the report. Specifies the font format of the selected text. Available only when a label or field is selected. Merges the selected tabular cells into one. Splits the selected tabular cell into the specified number of rows and columns. Opens the JReport Studio User's Guide. Connects to JReport Home Page. Accesses Jinfonet Technical Support. Shows product information about JReport Web. Creates a new report based on an existing business view. Opens a report. Saves the changes of the current web report. Saves a copy of the web report or the report template in the current web report to server resources. Exports the report result to disk or version in various formats. Configures the report page settings. Prints the current report result to a PDF/HTML file. Runs the report using previously provided parameters. The Refresh operation fetches the data again. Undoes the last operation. Reverses the operation of Undo. Filters the report records according to the filter criteria you specify. Deletes the selected object. Rotates a crosstab to exchange the axes on the crosstab in order to create a different view of the crosstab.

Merge Split Help User's Guide JReport Home Page Technical Support About JReport Web Standard Toolbar New Report Open Save Save As

Export Page Setup Print Refresh

Undo Redo Filter Delete Rotate Crosstab

Swap Chart Groups

Specifies whether to switch data between the category and series axes, or between the category and value axes of a chart if there is no field on the series axes. Specifies the font format of the selected text. Available only when a label or field is selected. Changes the background color of the selected text. Available only when a label or field is selected. Makes the selected text left, center or right aligned. Available only when a label or field is selected. Merges the selected tabular cells into one. Splits the selected tabular cell into the specified number of rows and columns. Opens the Table Wizard for you to edit the table. Hides or shows the detail columns you specify. Specifies whether to add or remove the selected field as a group.

Quick Format Toolbar

Font

Background Color

Align

Merge Split Context Toolbar for Table Table Wizard Show/Hide Detail Add/Remove Group

Show/Hide Summary Specifies whether to show or hide the selected summary field. Hide Aggregate On Hides the selected column. Creates a new summary directly based on the field bound with the table detail column. Opens the Crosstab Wizard for you to edit the crosstab. Rotates a crosstab to exchange the axes on the crosstab in order to create a different view of the crosstab. Opens the Chart Wizard for you to edit the chart. Specifies whether to switch data between the category and series axes, or between the category and value axes if there is no field on the series axes. Lists all available chart types for you to change the type of the chart. Lists more options for you to specify the layout of the chart. Lists all the parameters used by the current report. It is available when the current report uses parameters. Lists all the available resources. Lists all the available components. Specifies the criteria to filter the data field. You can also remove or change existing filters. After you perform the go-to-by-value action, the panel is displayed showing the filter created by the action.

Context Toolbar for Crosstab

Crosstab Wizard Rotate Crosstab

Context Toolbar for Chart

Chart Wizard Swap Chart Groups

Chart Type Chart Options Panel Parameters

Resources Components Filter

Go to Filter

Shortcut Menu

Show Apply Style Delete Hide Properties Filter

Shows the selected fields. Applies a style to the selected component. Deletes the selected object. Hides the selected object. Defines properties of the selected object. Provides submenu items for filtering the data in the selected component or remove existing filters. Provides submenu items for sorting records on the selected field in ascending/descending order, or remove the sort. Goes to the detailed information of the selected summary. Edits the detail table to define the detail fields of the summary. Links the selected object to a report, URL or E-mail. Adds some conditional formatting to the currently selected field. Goes to any group to show its record information. Goes to any group with the current group value as a filter to show its record information.

Sort

Go to Detail Edit Detail Table Edit Link Conditional Formatting Go To Go to By Value

Note: The shortcut menu contents vary with the objects you right-click. The above table only lists some typical shortcut menu items. The following sections will guide you to use the shortcut menu for any object you may right-click.

Creating web reports via wizard


On the JReport Console > Reports page, you can directly create a new web report in a folder into which a catalog containing one or more business views have been published. To create a web report: 1. Open the folder and select the catalog for the new web report from the Catalog drop-down list, then click New Report on the task bar of the Reports page. 2. In the Select Report Type dialog, check the option Web Report and click OK. The JReport Studio Wizard is then displayed. 3. In the Page screen, choose a template for the report. Template1 allows for your company logo and report title to be added. Template2 allows for more such as company name and title and report sub title. Use to load your company logo. You can set the font properties for company titles

. Click the Page Setup link to set the page properties. If you are an and report titles using administrator with the privilege of publishing resources, you can also create a new template according to your requirement. 4. In the Layout screen, select the required layout with which you want to create the report. Then, in the edit layout area, select a tabular cell and select the component you want to display in the cell. Click the Align drop-down list to set the component to the left, center or right of the cell. Repeat this to add component to the other cells. If required, you can split the selected cell horizontally or vertically by clicking the Horizontal Split or Vertical Split button, merge adjacent cells by selecting them and clicking Merge. You can also resize the tabular cells by dragging the cell border. 5. In the Bind Data screen, define the specified components (for details about how to define a component, refer to the specific topic in Inserting components). You can use the Back and Next buttons to switch between the components. 6. In the Style screen, apply a style to the report. 7. Click Save to save the report to the server resource tree. For details, see Saving the report. 8. Click Run to open the report in JReport Studio. See also JReport Studio Wizard for details about options in the wizard.

Report templates
Web reports allow you to choose a starting template. If you are an administrator with the privilege of publishing resources, you can save report templates to include standard features such as a company logo, company name, privacy notices or any standard items and styles you want your users to start with. A report template stores information in the page header and page footer as a starting point for a web report.

Report templates can be saved using the JReport Studio Wizard or JReport Studio on the server, by administrator with the privilege of publishing resources. The saved report templates will be added into the templates directory on the server <install_root> \templates, and will be automatically loaded onto the Page screen of the JReport Studio Wizard for use. To create a report template from the JReport Studio Wizard: The JReport Studio Wizard provides sample templates for you to define your own templates based on. 1. In the Page screen of the JReport Studio Wizard, make use of Template1 and Template2 to customize your own report templates. Template1 allows for your company logo and report title to be added. Template2 allows for more such as company name and title and report sub title. Use to load your company logo. You can set the font properties for company titles and report titles using .

2. To save the report template from the JReport Studio Wizard, click the Save button. 3. In the Save As dialog, choose the file type of Web Report Template (*.wsld), and specify a name for the template in the File Name text field, or select an existing template to overwrite it. When done, click Save. 4. If you want to further format the template, open a report in JReport Studio that was created with the template you want to change, edit the page header and page footer, and then save the report template using the Save As option (Menu > File > Save As or the Save As button Standard toolbar). To create or edit a report template using JReport Desinger or JReport Studio: You can make use of JReport Desinger or JReport Studio on the server to create or edit your report template, by customizing desired information in the page header and page footer of a web report. Then save the report template using JReport Studio on the server via the Save As option (Menu > File > Save As or the Save As button on the Standard toolbar). on the

To rename or remove a report template: Go to the templates directory on your server <install_root>\templates, then rename or delete the template file (.wsld). For each template file, there is an image file (.[Link]) which is used to display in the templates box of the Page screen of the JReport Studio Wizard, as a representative of the template. You will need to rename or delete the image file when you rename or delete the template file.

Editing web reports in JReport Studio


JReport Studio is the web oriented page where you view and edit web reports. When a report is opened in JReport Studio, by default it is in the view mode which provides only viewing-oriented functions. If you want to edit the report, click the Edit Mode link on the toolbar to enter the edit mode. Pick a task from the following:
q

General operations in reports Inserting components Making simple modifications to components Manipulating data components Binding links to components Using dynamic resources Going through the report data Applying filters Using web controls Adding conditional formats to fields Applying parameters Sorting report data Applying CSS styles Saving the report Exporting/Printing the report result

General operations in reports


You can perform the following general operations in JReport Studio:
q

Opening another web report Click Menu > File > Open (or the Open button on the Standard toolbar) to display the Select a Report dialog, in which the web reports in the same folder as the current open report are listed. Select the web report you want to open from the default folder or from another folder, and then click OK.

Exiting JReport Studio If you want to close the current web report and release the resources, just click Menu > File > Exit (or the button X on the far right of the toolbar). Do not use the close button on the browser window as that may not release the resources used by the report. Undoing/Redoing actions You can undo or redo some actions. To do this, click Menu > Edit > Undo or Redo (or the Undo button or Redo button on the Standard toolbar).

Navigating component data via scroll bar For tables, crosstabs and charts, you can use the scroll bar to navigate their data if the tabular cell can not display all data of the component. Turning component pages In JReport Studio, if a table or a crosstab contains more than one page, a navigation bar specific for the component will be available right below the component. You can use the navigation bar to view the desired pages: click a number or input a number in the text box. Showing/Hiding editing marks You can use editing marks (dashed outlines of objects) for purposes such as aligning, moving and resizing. The editing marks are shown by default. To switch the status of the editing marks, click Menu > View > Editing Marks. Asking for help At any time, you can click Menu > Help > User's Guide to open the index page of JReport Studio User's Guide. Furthermore, you can click the Help button in any dialog to show the help document about the dialog. You can also use the Help menu to access Jinfonet Software website for more information.

Inserting components
You can insert components into a web report via the Insert menu or via the Components panel on the left of the JReport Studio window. The following table lists the report areas that are valid targets for the various components.
Report Layout Area Component Chart Crosstab Table Group object Detail object Aggregation object Formula Label Image Multimedia object Web control Page Header/ Footer Y Y Y Y Y N Y Y Y Y Y Report Body Y Y Y Y Y Y Y Y Y Y Y Tabular Cell Y Y Y Y Y N Y Y Y Y Y Table Cell N N N Y Y Y Y Y N N N

The following shows inserting a specific component in detail:

Inserting a table
1. Locate the place in the report where you want to insert the table. 2. Click Menu > Insert > Table, or drag Table from the Components panel to the destination. The Insert Table dialog is displayed.

3. Specify a title for the table in the Table Title text field, and if required, click title.

to set the font properties for the

4. From the Data Source drop-down list, select the business view in the current catalog, on which the table will be built. If required, click the Filter button to add some filter conditions to the business view to narrow down data displayed in the table. 5. Select the required table type: Group Above, Group Left, Group Left Above, or Summary Table. 6. In the Display tab, add the required fields from the Resources box to be displayed in the table. Specify the display name of any added field in the Label column if necessary. 7. In the Group tab, add the group objects as the grouping criteria, then specify the sorting manner of each or .

group in the Sort column. To adjust the order of the groups, select a group and click

8. To add summaries, go to the Summary tab. Select the group to which the summary will be applied, then add an aggregation object as the summary field.

9. Click OK to insert the table. See also Insert Table dialog for details about the options in the dialog.

Inserting a crosstab
1. Locate the place in the report where you want to insert the crosstab. 2. Click Menu > Insert > Crosstab, or drag Crosstab from the Components panel to the destination. The Insert Crosstab dialog is displayed.

3. Specify a title for the crosstab in the Crosstab Title text field, and if required, click for the title.

to set the font properties

4. From the Data Source drop-down list, select the business view in the current catalog, on which the crosstab will be built. If required, click the Filter button to add some filter conditions to the business view to narrow down data displayed in the crosstab. 5. From the Resources box, select a group object and click or to add it to the Columns or Rows box as a group field. Then, in the Label column, edit the display name of the group object if required. This will label the row/ column when the report is displayed. By default the Label column is blank and no label will be created for the row/ column. In the Sort column, specify the sorting manner for the group field.

6. Select an aggregation object or a detail object and click to add it to the Summaries box as an aggregate field. If a detail object is added, specify the aggregate function for it in the Aggregation column. In the Label column, edit the display name of the aggregate field as required. 7. Repeat this to add more group/aggregate fields. If you want to remove any field, select it and click the order of the fields, select a field and click 8. Click OK to insert the crosstab. See also Insert Crosstab dialog for details about the options in the dialog. or . . To adjust

Inserting a chart
1. Locate the place in the report where you want to insert the chart. 2. Click Menu > Insert > Chart, or drag Chart from the Components panel to the destination. The Insert Chart dialog is displayed.

3. Specify a title for the chart in the Chart Title text field, and if required, click title.

to set the font properties for the

4. From the Data Source drop-down list, select the business view in the current catalog, on which the chart will be built. If required, click the Filter button to add some filter conditions to the business view to narrow down data displayed in the chart. 5. To create a single chart, in the Primary Axis box, select the required chart type from the chart type drop-down list. To create a combo chart, click above the Primary Axis box and an additional chart type will be added. You can replace the additional chart type by selecting the required one from the chart type drop-down list. Repeat this to add more chart types. Check the Secondary Axis checkbox if you want to have the secondary axis (Y2) and define the chart types on the axis as required. To delete a type, select it and click . or additional

6. In the Primary Axis or Secondary Axis box, select a chart type and add an aggregation object value as the data of the type. To add an additional value to a chart type: a. Select the chart type in the Show Values box.

b. In the Resources box, expand the Additional Values node, then select Constant Value/Average Value. c. Click beside the Show Values box. The Edit Additional Value dialog appears.

d. In the Name text box, specify the display name for the constant/average value. e. Input the constant value with numeric type in the Value text box, or select a field based on which the average value will be calculated from the Based On drop-down list. f. Click OK, and the defined constant/average value will be added to the chart type. To modify a constant/average value, select the value in the Show Values box, then click Additional Value dialog, edit the value as required. . In the Edit

You can add more than one aggregation object or additional value to a chart type. Each added chart type shall have at least one aggregation object or additional value. in the Resources box and add it to the Category or Series text field, the data of which 7. Select a group object will be displayed on the corresponding axis. above the 8. If you want to define some sort order and Select N condition on the category or series field, click Category or Series text field, then define the order and condition in the Category/Series Options dialog. To define a sort order and Select N condition on the category/series field: a. In the Category/Series Order box of the Category/Series Options dialog, specify in which order values of the category/series field will be sorted.

b. In the Category/Series Selection box, specify the Select condition to All, Top N or Bottom N. If All is selected, all category/series values will be shown in the chart; if Top N or Bottom N is selected, the text field next to it will be enabled and you can specify an integer here, which means that the first or last N category/series values will be shown in the chart. c. Check the Based On checkbox and specify values for the two drop-down lists that follow according to your requirement. If Based On is unchecked, the order of the first or last N category/series values will be based on what you specify in the Category/Series Order box of the dialog; if you check it, the order will be based on values of the summary field and the sort direction you specify in the drop-down lists next to Based On. d. If you have selected Top N or Bottom N from the Select drop-down list, you can check the Remaining Categories/Series In checkbox and then type a character string in the text field, so that the category/series values beyond the first or last N range will be merged into the group with the name as that character string. e. If necessary, you can check Skip First, and then input a number M in the text field to the right, then the first M category/series values will be skipped and the Select N condition will begin with M+1. The skipped values will be merged into the Remaining Categories/Series group. f. Click OK to accept the settings. 9. Click OK to insert the chart. See also Insert Chart dialog for details about the options in the dialog.

Inserting a label
To insert a label into a report, locate the place in the report where you want to insert the label, then click Menu > Insert > Label, or drag Label from the Components panel to the destination. The label will then be inserted in the specified location.

Inserting an image
1. Locate the place in the report where you want to insert the image.

2. Click Menu > Insert > Image, or drag Image from the Components panel to the destination. The Insert Image dialog is displayed.

3. Specify the image you want to insert.


r

To use an image in the local file system, select Local File, then click Browse to find the image. To use an image on a website, select Web URL, then input the image URL or paste the URL in the Image URL text field. To use an image in the image library of the JReport Studio, select Library, then select the image in the My Images box.

4. Click OK to insert the image.

Inserting a multimedia object


1. Locate the place in the report where you want to insert the multimedia object. 2. Click Menu > Insert > Multimedia Object, or drag Multimedia Object from the Components panel to the destination. The Insert Multimedia dialog is displayed.

3. Choose from the three multimedia object types: Flash, Real Media file, or Windows Media File. 4. In the File Name/URL text field, specify the full path of the multimedia object you want to insert or use the Browse button to find it if it is on your local disk. Or you can provide a URL for loading it from a website. 5. The Plug-in page text field provides a default URL from which to download the player to play the inserted multimedia object on a web page. 6. In the Properties box, specify the properties for the multimedia object as required. 7. Click OK to insert the multimedia object. See also Insert Multimedia dialog for details about the options in the dialog.

Inserting a web control


You can insert the following web controls into a web report: parameter control, parameter form control, filter control, and navigation control. For details, see Using web controls.

Making simple modifications to components


This section introduces the general actions that you can perform on the report components.

Resizing a component and its elements


To resize a component, click anywhere in the component, then you will see it is surrounded by a rectangle with resizing handles. Point to a handle, when the mouse pointer turns to a double-headed arrow, you can drag the handle to resize the component. To adjust the width of a column in a table, point to the right boundary of the column, when the mouse pointer becomes a double-headed arrow, drag the handle to resize the column. To adjust the row height in a table, point to the lower boundary of a row, when the mouse pointer becomes a double-headed arrow, drag the handle to resize the row height. Then all the other rows of the same role will be resized too. For example, if a detail row is resized, all rows in the detail area will be resized. If a group row is resized, all rows of the group will be resized, while the other groups' rows keep unchanged. To resize the column or row in a crosstab, drag the right or lower boundary. Then all the columns or rows of the same role will change too. For a tabular, point to the boundary between two cells and the mouse pointer will become a doubleheaded arrow, you can then drag the boundary to adjust the size of the related cells.

Hiding/showing a component
To hide a component, click on the component, when the icon appears at its upper left corner, rightclick on the icon and then select Hide from the shortcut menu. To show the hidden components, click Menu > Edit > Unhide Components and then select the desired components to show from the drop-down list. Another way to show the component after hiding is Undo.

Editing a component
q

To edit a label, click in the text and update the content. You can also use the Quick Formats toolbar to format the font, border, alignment, and background color of a label. To edit a table, crosstab, or chart, use the corresponding report wizard. For details, see Manipulating data components. To edit an image or a multimedia, click on the component, when the icon appears at its upper left corner, right-click on the icon and click Edit on the shortcut menu and then modify the settings in the displayed dialog. For a tabular, you can edit it as follows:
r

Merging tabular cells Adjacent cells in a tabular which form a rectangle can be merged into one cell.

To merge adjacent cells, select them one by one while holding the Ctrl key, then click Menu > Format > Merge or click
r

on the toolbar, and these cells will be merged into one cell.

Splitting a tabular cell To split a tabular cell, select the cell and click Menu > Format > Split or click on the toolbar, then in the Split Cell dialog, specify the number of rows and columns and click OK.

Modifying component properties


JReport Studio allows you to modify object properties with the corresponding properties dialog.
q

To format the properties of any object in a report, right-click the object and then select Properties from the shortcut menu. In the corresponding properties dialog, specify the settings as required. If you want to format the properties of the report, click Menu > Edit > Report Body, then in the Report Body Properties dialog, configure the properties as required.

For detailed explanation about options in the properties dialogs, refer to the specific topics in JReport Studio dialogs.

Deleting a component
A component can be removed from the report if it is no longer required. To delete a component, click on the component, when the icon appears at its upper left corner, right-click on the icon and select Delete from the shortcut menu. Then, a message will prompt, asking for your confirmation. Click OK in the message box so as to remove the component. Note: In a web report, there must be one and only one tabular, so you cannot either insert another tabular or delete the current tabular.

Manipulating data components


You can manipulate data components, which refer to tables, crosstabs, and charts, in JReport Studio as shown below. Note that, most of the manipulations require selecting the component first. To select a component, click anywhere in the component, when the icon appears at its upper left corner, click the icon.

Manipulating a table
q

Adjusting order of columns in a table The order of columns in a table can be easily adjusted. To do this, first select a column by clicking on the column header, then drag it to the left or right boundary of another column, when a highlighted line appears along the column boundary, release the mouse button, and you will see the order changes. Adjusting the width of table columns according to contents When the contents in cells of a table column need more space to completely display, you can adjust the width of the table column according to the contents. To do this, select the column by clicking on the column header, then right-click the column and select Auto Fit from the shortcut menu. Changing the table definition 1. Select the table and do one of the following to display the Table Wizard:
s

Click Menu > Edit > Wizard. Click the Table Wizard button Right-click the icon on the Context toolbar.

of the table and select Table Wizard from the shortcut menu. to customize the font,

2. In the Table Title text field, edit the title of the table. You can click size, and style of the title.

3. If required, click the Filter button to apply some filter conditions to narrow down data displayed in the table. 4. In the Display tab, add or change the fields displayed in the table. 5. In the Group tab, modify the grouping criteria of the table. 6. Upon finishing, click OK to apply the modifications. For details about how to define a table, see Inserting a table.
q

Aggregating on a detail column You can summarize the data in a detail column. To do this: 1. Right-click the detail field and select Aggregate On from the shortcut menu. Or you can click the column header to select the column, then on the Context toolbar, click the Aggregate On button .

2. In the Aggregate On dialog, specify a function from the Function drop-down list to summarize the field in the detail column. 3. When done, click OK.
s

If the table has groups, the aggregation will be created for each group in every group level and for the whole table at the same time. If the table has no groups, the aggregation will be created based on the whole table.

When you finish aggregating on a detail column, you will find a dynamic aggregation is created which is given a default name Function_DetailFieldName in the Dynamic Resource > Aggregations list in the Resources panel and you can use it again in the current report if required.
q

Adding/Removing groups in a table You can add more groups into a table or remove the groups that are not required from a table.
r

To add a group into a table: Select the table, then on the Context toolbar, click the Add/Remove Group button and you will get a drop-down list of fields in the business view that can be used as group by fields. From the list you can select the field you would like to add into the table as a group. If there is no existing group in the table, the added group will be placed at the left-above position. If the table already contains groups, the new group will be added as the highest level group and follow the same position pattern as the closest existing group.

To remove a group from a table: Click the group column header to select the column, right-click and select Delete from the shortcut menu, then click Yes in the message dialog to confirm the removal. Or you can use the Add/ Remove Group button on the Context toolbar of the table: unselect the group you want to remove from the drop-down list, then click Yes in the message dialog.

Showing/Hiding detail columns To show/hide a detail column, select the table, then on the Context toolbar, click the Show/Hide Detail button column. . From the drop-down list, select/unselect the field name to show/hide its detail

You can also hide a detail column by first clicking its column header to select it and then clicking the Hide button shortcut menu.
q

on the Context toolbar, or right-clicking the column and selecting Hide from the

Showing/Hiding summaries To show/hide a summary from a table, first select the table and then do either of the following:
r

On the Context toolbar, click the Show/Hide Summary button select/unselect the summary field name to show/hide it.

. From the drop-down list,

Right-click the icon of the table, then on the shortcut menu, select/unselect the summary field name from the Show/Hide Summary sub menu to show/hide it.

Manipulating a crosstab

Changing the crosstab definition 1. Select the crosstab and then do one of the following to display the Crosstab Wizard:
s

Click Menu > Edit > Wizard. Click the Crosstab Wizard button Right-click the icon on the Context toolbar.

of the crosstab and select Crosstab Wizard from the shortcut menu. to customize

2. In the Crosstab Title text field, edit the title of the crosstab. You can click the font, size, and style of the title.

3. If required, click the Filter button to apply some filter conditions to narrow down data displayed in the crosstab. 4. Change the fields and summaries used by the crosstab. 5. Upon finishing, click OK to apply the modifications. For details about how to define a crosstab, see Inserting a crosstab.
q

Converting a crosstab into a chart 1. Select the chart and then do either of the following to display the To Chart dialog:
s

Click Menu > Edit > To Chart. Right-click the icon of the crosstab and select To Chart from the shortcut menu. to customize the font, size,

2. In the Title text field, input a title for the chart. You can click and style of the title.

3. The Resources box lists all the view elements used in the selected crosstab including group and aggregation objects. The chart can only be defined based on the view elements listed. Add a group object from the Resources box to the Category box, and so to the Series box, and to the Show Values box respectively.

aggregation objects

4. Click the OK button to finish the conversion.


q

Rotating a crosstab Columns and rows in a crosstab can be exchanged. This operation is called rotating a crosstab. To rotate a crosstab, first select it, and then do one of the following:
r

Click Menu > Edit > Rotate Crosstab. Click the Rotate Crosstab button Right-click the icon on the Context toolbar.

of the crosstab and select Rotate Crosstab from the shortcut menu.

Adjusting the width of crosstab fields according to the contents When the contents in the field of a crosstab need more space to completely display, you can adjust the width of the field according to its contents. To achieve it, right-click the field and select Auto Fit from the shortcut menu.

Manipulating a chart
q

Changing the chart definition 1. Select the chart and then do one of the following to display the Chart Wizard:
s

Click Menu > Edit > Wizard. Click the Chart Wizard button on the Context toolbar.

Right-click the icon of the chart or any part of the chart other than the legend and label, then select Chart Wizard from the shortcut menu. to customize the font,

2. In the Chart Title text field, edit the title of the chart. You can click size, and style of the title.

3. If required, click the Filter button to apply some filter conditions to narrow down data displayed in the chart. 4. Change the group and aggregation objects or the additional values used by the chart. 5. Upon finishing, click OK to apply the modifications. For details about how to define a chart, see Inserting a chart.
q

Formatting chart elements You can format the chart platform, paper, legend, X and Y axes, wall, floor, and gridlines using the corresponding format command on the shortcut menu of a chart. For details about the element properties, refer to the specific format dialog in JReport Studio dialogs. Sorting category/series labels You can sort the labels on the category or series axes of a chart in either descending or ascending alphabetical order. To do this, right-click the chart, then on the shortcut menu, select the required order from the Sort Category or Sort Series submenu. Swapping chart groups You can switch data between the category and series axes, or between the category and value axes of a chart if no field on the series axes. To swap the chart groups, first select the chart, then do either of the following:
r

Click the Swap Chart Groups button

on the Context toolbar.

Right-click the icon of the chart or any part of the chart other than the legend and label and select Swap Chart Groups from the shortcut menu. Converting a chart into a crosstab 1. Select the chart and then do either of the following to display the To Crosstab dialog:
s

Click Menu > Edit > To Crosstab. Right-click the icon of the chart or any part of the chart except for the legend and label and click To Crosstab on the shortcut menu. to customize the font,

2. In the Title text field, input a title for the crosstab. You can click

size, and style of the title. 3. Select a group object in the Resources box and click or to add it as a group field to

and click to add it as an the Columns or Rows box; select an aggregation object aggregate field to the Summaries box. Repeat these to add more aggregate fields. In the Label column, you can edit the label of a group field or aggregate field, and the Sort column allows you to specify a sorting manner on a group field. If you want to remove any group/aggregate field, select it and click . or .

To adjust the order of group/aggregate fields, select a group/aggregate field and click 4. Click OK to finish the conversion. Note: Additional values are supported only in chart. If you convert a chart with additional values into crosstab, the additional values are not converted together with the chart.
q

Changing chart type Select the chart, then on the Context toolbar, click the Chart Type button down menu, select the desired chart type and its subtype. . From the drop-

Changing legend position in a chart Chart legend can be placed at the top, bottom, left or right position in a chart. To change the legend position, select the chart, then on the Context toolbar, click the Chart Options button the drop-down menu, go to the Legend submenu and select the desired position. . From

Showing/Hiding labels on the X/Y axis Select the chart, then on the Context toolbar, click the Chart Options button . From the dropdown menu, go to the Label submenu, then select/unselect the desired labels to show/hide them.

Showing/Hiding X/Y gridlines Select the chart, then on the Context toolbar, click the Chart Options button . From the dropdown menu, go to the Gridlines submenu, then select/unselect the desired gridlines to show/hide them. When gridlines are shown, it is better to also have the wall shown so as to make the background gridlines more intuitive. To show the wall, follow the steps above, then on the Gridlines submenu, select Wall.

Binding links to components


You can bind links to labels, images, DBFields, formula fields, parameter fields, and multimedia objects. To bind a link to a component: 1. Right-click the component and select Edit Link on the shortcut menu. The Edit Link dialog appears. 2. Specify the link type to which the component will be linked by selecting the desired type and then set the related options for the type.
r

Link to Report If you create a link to a report, when viewing the result, you can view another report by clicking the component. Link to URL Enter the URL in the Hyperlink box if you want to create a link to a web page, then specify whether to open the URL in a new window. Link to E-mail Enter the E-mail address in the Hyperlink box.

3. When done, click OK to close this dialog. See also Edit Link dialog for additional information about options in the dialog.

Linking a report to another report


A report can be linked to another report, after which the trigger object in the primary report can be clicked in order to jump to the linked report to obtain information about the trigger object. In JReport Studio, it is very simple to set up the link relationship between two reports. 1. Create a new web report which will be used as the primary report. 2. In the report, select an object to be the trigger for loading the linked report. 3. Right-click the trigger object, click Edit Link on the shortcut menu. Link to Report is selected by default in the Edit Link dialog.

4. Click the Browse button to specify the target web report you want as the linked report. 5. The Target Report Parameters section lists the parameters of the linked report. You can assign fields of the primary report to the parameters. Then, when running the linked report from the link, the field values of the primary report will be assigned to the parameters automatically. 6. In the Target Component section, click be interlinked with the primary report. to specify which components in the linked report will

7. In the Conditions section, specify the link relationship for each target component. a. Select a component in the Target Component box, and then set link condition for it in the Conditions section.

b. Click

to add a condition row.

c. Select a field/formula from the drop-down list in the Main column. d. Choose an operator from the drop-down list in the OP column. The operator can be "=", "<>", "<", ">", "<=", ">=", or "IN". e. Specify the field/formula of the linked report from the drop-down list in the Target column. All fields in the linked report of the same value type as the selected main report field will be available. f. If necessary, you can specify more link conditions by specifying the main report field, the operator, and the corresponding field in the linked report. Note that the relationship among these link conditions is AND, which means that JReport will fetch linked report data which meets all of the conditions. g. Repeat the above steps to set link conditions for other target components. 8. Specifies whether to have the linked report loaded in a new window. 9. Click OK to apply the settings. Then, when the primary report is opened in HTML, PDF or Excel format, when you click the trigger object in the primary report, you will find that the linked report is displayed according to the specified link conditions. To go back to the original report, click on the toolbar. Click next to and you will get a drop-down list which lists the original report and the linked targets you have just visited within the link chain. The item checked on the drop-down list is the currently opened page. Select an unchecked item and you will be directed to that target. Notes:
q

When linking reports, you need to avoid link loops. For example, if you have linked report A to report B, then you cannot link report B back to report A again. The condition specified in the Conditions section is used for setting up the searching criteria between the two linked reports. That is, the pages containing the data that meet the condition in the linked report will be displayed after you click the link.

Using dynamic resources


When you add fields to a report, sometimes you may find that the view elements that have been predefined in the business view cannot meet your requirements, in which case, you can create some dynamic resources and use them in the report to get the desired data. Then when you save the report, the dynamic resources will be saved along with the report as its resources. Dynamic resources that can be used in web reports include formulas and aggregations.

Creating and using dynamic formulas


You should have some knowledge of the formula syntax before you can successfully compose a formula with no errors. To learn the formula syntax, refer to Formula syntax in the JReport Designer User's Guide. To create a dynamic formula: 1. In the Resources box of the report wizard, expand the Dynamic Resource > Formulas node, then click <Add Formula> to display the Formula Editor.

2. Enter a name for the formula in the Formula Name text field. 3. Compose the formula by selecting the required fields, functions and operators from the Fields, Functions and Operators boxes. You can also write the formula by yourself in the editing box.

For details about the functions and operators, refer to Built-in functions and Operators in the JReport Designer User's Guide. 4. Click the Check button to check whether or not the syntax of your formula is correct.

5. When done, click the OK button to create the formula. You can then use the formula in the report. Notes:
q

You can only save a formula with no errors into a report. Currently, global variables are not supported in dynamic formulas. When formulas reference display names or mapping names, the names should not contain any of the following characters if the names are not quoted by double-quotation marks "": "~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "+", "=", "{", "}", "[", "]", "|", "\\", ":", ";", "\", " ' ", "<", ",", ">", ".", "?", "/" Examples:
r

Expression @Customer#; will cause a syntax error. But @"Customer#" is ok. If a field has the display name [Link], when adding it to a formula, quote it as "[Link]" or "Category"."Aggregation".

Once a dynamic formula has been created, you can then drag it from the Resources panel to the desired position in the report as a detail object, or use it when working with the report wizard. Also, if you want to further edit an existing dynamic formula or remove any formula that is not required, right-click the formula and then click the corresponding command on the shortcut menu.

Creating and using dynamic aggregations


In JReport Studio, you can also create dynamic aggregations by mapping them to the available resources such as group objects, detail objects in the current business view and the dynamic formulas that have been created in the report. To create a dynamic aggregation: 1. In the Resources box of the report wizard, expand the Dynamic Resource > Aggregations node, then click <Add Aggregation>. The Add Aggregation dialog is then displayed.

2. Click the chooser button

next to the Resource Name text field to specify the field on which the dynamic aggregation is based.

3. From the Aggregate drop-down list, specify the aggregate function. 4. In the Aggregation Name text field, specify the display name of the dynamic aggregation. 5. When done, click OK to create the dynamic aggregation. You can then use the aggregation in the report Once a dynamic aggregation is created, you can then drag it from the Resources panel to the desired position in the report to see the desired data, or use it when working with the report wizard. And if you want to edit any dynamic aggregation or delete it, right-click the aggregation and click Edit or Delete on the shortcut menu.

Going through the report data


In a web report, you can choose to show certain groups of records according to your requirements, and switch among the groups to see the data you want. This section presents two kinds of going in web reports. They are:
q

Automatic going Going to detail

Automatic going
Automatic going enables you to switch from the current group to another group by using systemdefined commands on the shortcut menu, and it is divided into two kinds:
q

Go-to It enables you to obtain a different view of data by switching among groups. Go-to-by-value It enables you to filter data based on a go-to action so as to obtain a more detailed view of the data.

Automatic going actions are performed on tables and crosstabs. After a going action has been performed, the data presented in the component will be re-loaded from the data buffer, showing only the records in the selected group, and the new report created by going can also be viewed, printed, and exported to other format in the same way as the original report. Assume you have created a crosstab report on the business view WorldWideSalesBV in Data Source 1 of the SampleReports catalog showing product sales information with Product Type (ascending) as the column field, Category (ascending) as the row field, and Total Sales as the summary field, and applied the default style to the crosstab. The crosstab shows as follows:

We will now take the crosstab as an instance to illustrate the automatic going functions.

Go-to
1. Right-click any value of Product Type, Decaf for example, and choose Go To from the shortcut menu. The list of groups available for Go To will appear on the submenu.

2. Click Region on the submenu, then in the regenerated result, we can see that Category remains the group for rows and Region becomes the group for columns.

3. To return to the original status, right-click any value and then click Go To > Product Type on the shortcut menu.

Go-to-by-value
1. Go back to the original report in the above example. 2. Right-click the value Decaf of the Product Type group, and point to Go to By Value on the shortcut menu. A submenu for the command is displayed, which lists the same items as those of Go To. 3. Click Region too and the result will be regenerated.

We can see that the result is different from that of go-to. This is because that, for the go-to-byvalue action, the group of columns changes to Region by the Product Type value Decaf. That is, on the basis of the go-to action, a filtering action where Product Type = Decaf is further performed, and thus the result of go-to-by-value is generated. In addition, when a go-to-by-value action is performed, the Go to Filter panel will be displayed on the left of the JReport Studio window, which shows the group and the value the filter is based on.

4. To go back to the original report, first delete the filter in the Go to Filter panel, then right-click any value of Region, choose Go To from the shortcut menu, and click Product Type on the submenu. Note: If the table type is Group Above, you can right-click its group header to show the shortcut menu so as to use the automatic going function. For other table types, you have to right-click the group name in group column to perform automatic going.

Going to detail
Go-to-detail action is performed on the summary of the tables, crosstabs and charts. First define a table and make it contain the information you would like to view about the summary values. Suppose that the summary is total sales in different countries. Then when you perform go-to-detail action on the value of total sales in France, you will get the table displaying the fields you defined and having applied the filter condition Country=France. When you go to detail of the total sales in another country, the table will display the data of that country. To define the detail table for a summary and perform the go-to-detail action on it: 1. Right-click any summary value and select Edit Detail Table from the shortcut menu. 2. In the Edit Detail Table dialog, add the fields you want to display in the detail table of the

summary. 3. Click OK. 4. Right-click a summary value of which you would like to view the detailed information, then click Go to Detail on the shortcut menu. The detail table for the summary value will then be displayed, which shows the fields you have defined. 5. To go back to the original report, click on the toolbar.

Applying filters
You can apply filters to business views and data components such as tables, crosstabs and charts of a web report so as to narrow down the data displayed in the web report.

Applying filters to business views


When creating web reports, you can choose to apply some filter to the specified business view to narrow down the data scope of the data component using the business view. In JReport Studio, filters for business views are defined into two categories: predefined filters and user defined filters. As the name suggests, predefined filters are defined in advance when creating or editing the business views in JReport Designer, and user defined filters are created on business views while they are used. Filters can be applied to a business view in the report wizard. 1. In the Bind Data screen of the JReport Studio Wizard or in the report wizard, select the business view that you are going to add filters to from the Data Source drop-down list, and then click the Filter button on the right. The Query Filter dialog is displayed.

2. The dialog has the basic and advanced modes for you to define a filter using either simple expressions or complex expressions. When it is in the advanced mode, you can also choose to apply a predefined filter of the specified business view from the Query Filter drop-down list. If you prefer to define a filter on your own, select User Defined from the drop-down list, and then define the filter according to your requirements. You can also edit a predefined filter if required and save it as a user defined filter to the business view.
r

To define a filter using simple expressions: a. Make sure the dialog is in the basic mode. b. Select the field on which the filter will be based from the field drop-down list. c. From the operator drop-down list, set the operator with which to compose the filter expression. d. Type the values of how to filter the field in the value text box, or select one or more values from the drop-down list. e. If you want to add another condition line, from the logic operator drop-down list,
s

To add a condition line of the AND relationship with the current line, select AND, then define the expression as required. To add a condition line of the OR relationship with the current line, select OR, then define the expression as required. on its left.

Repeat this to add more filter expressions if required. To delete a condition line, click
r

To define a filter using complex expressions: a. Switch the dialog to the advanced mode. b. Click the Add Condition button to add a condition line. c. From the field drop-down list, select the field on which the filter will be based. d. From the operator drop-down list, set the operator with which to compose the filter expression. e. Type the values of how to filter the field in the value text box, or select one or more values from the drop-down list. f. To add another condition line, click the Add Condition button and define the expression as required. Then click the logic button until you get the required logic to specify the relationship between the two filter expressions. The logic can be AND, OR, AND NOT, or OR NOT. g. Repeat the above steps to add more filter expressions if necessary. To group some conditions, select them and click the Group button, then the selected conditions will be added in one group and work as one line of filter expression. Conditions and groups together can be further grouped. To take any condition or group in a group out, select it and click Ungroup. It is the equivalent of adding parenthesis in a logic expression.

To adjust the priority of a condition line or a group, select it and click the Up or Down button. To delete a condition line or a group, select it and click the Delete button. 3. After you finish the report wizard, the specified filter will be applied to the business view, so that your report will get data that meets the filter condition only. Note: Query filters take effect on the component level, which means each time you create a component, you can apply a filter to the business view the component uses and it will not affect other components based on the same business view.

Filtering report data


There are the following ways you can take in order to filter components in a web report: using the Filter dialog, using the Filter panel, using the Filter web control, or via shortcut menu.

Using the Filter dialog


When using the Filter dialog to filter report data, you can only make the filter applied to a specific data component in the current web report. To filter report data using the Filter dialog: 1. Click Menu > Edit > Filter, or the Filter button displayed. on the Standard toolbar. The Filter dialog is

2. From the Apply to drop-down list, select the component in the web report to which you want to apply the filter. 3. Define the filter using either simple expressions or complex expressions. 4. When done, click OK to apply the filter. The Filter dialog provides an entry to all the filters used in the current web report except query filters. You can click the Inspector button to view the detailed filter information.

Using the Filter panel

The Filter panel on the left of JReport Studio is used to filter data components in the current report that are using the same business view. To do this: 1. Add group and detail resources into the Filter panel by clicking + on the panel title bar. Each added group/ detail and its values are housed in a separate box. Group and detail objects can be selected from the business views used by current report. 2. Select the values you would like to filter the report data. The selected values applies a filter condition to all the data components in the current report that are using the same business view, regardless whether the data components contain the fields holding those values. You can make use of the Ctrl or Shift key to do multiple selection. The value selection applies a filter condition and the logic is as follows:
q

For one value selection: Selected_Field=Selected_Value For example, Country=USA

For multiple selection: (Selected_Field1=Selected_Value1 or Selected_Field1=Selected_Value2) and (Selected_Field2=Selected_Value3 or Selected_Field2=Selected_Value4)... For example, (Country=USA or Country=China) and (Year=2008 or Year=2009)

The following shows more about working with the Filter panel:

You can use the buttons on the bottom of the Filter panel to deal with the value selection in the panel.

Back Goes back to the previous value selection status and refreshes the report data accordingly. Clear Removes all the value selection histories and all the filter conditions based on the selections, and refreshes the report data accordingly. Forward Goes forward to the next value selection status and refreshes the report data accordingly.

After right-clicking a group/detail name title bar, these options are available for managing the group/detail object.

Search Displays the quick search toolbar right above the group/detail box which enables you to search values in the group/detail object. You can also use the button quick search toolbar. on the group/detail name title bar to launch the

The following are details about the usage of the quick search toolbar:
s

Text field Type in the text you want to search for in the text field and the matched text will be highlighted among the group/detail values. X Closes the quick search toolbar.

Lists the advanced options.


s

Highlight All Specifies whether to highlight all matched text. Match Case Specifies whether to search for text that meets the case of the typed text. Match Whole Word Specifies whether to search for text that matches a whole word as the typed text.

Highlights the next matched text.

Highlights the previous matched text.

Clear Cancels the selection of a value in the group/detail object. You can also use the button detail name title bar to achieve this. on the group/

Clear All Cancels the selection of all values in all the group and detail objects. Sort Sorts the values in the group/detail object in the ascending or descending order. Delete Removes the group/detail object from the Filter panel. You can also click X on the group/detail name title bar to remove it.

Note: The filters created via the Filter panel cannot be seen when web reports are opened in JReport Designer.

Cascading relationship among filter controls

The Filter panel can be regarded as a collection of special filter controls which apply to all data components using the same data source. While common filter controls can choose the data components they apply, still under the circumstance of using the same data source. When there are filter controls, including the special ones in the Filter panel, that apply to the same data components, and when these controls' fields have cascading relationship, the cascading relationship will be revealed when you select values in the controls. For example, there is a filter control based on the field Country, a filter control on City, and another on State. The first two share one table while the third shares nothing with the other two. In this case, Country and City values will show cascading relationship, but State values will not participate. You select USA in the Country filter control, the values in the City filter control will change as follows if the control has scrollbar: the cities belong to USA are displayed in the upper area of the filter control, and the other cities are put in the lower area and grayed out. For the case that the City filter control has no scrollbar: all the values remain their positions and the values not belonging to USA are grayed out. In both cases all the values are selectable. But the State values remain as before, since the selection of them will not affect the data components that the Country and City filter controls control.

Using filter controls


You can also use the Filter web control to filter one or more data components that use the same data source in a web report. A filter control can do filtering based on one field. For details, see Using filter control to filter report data.

Using the shortcut menu


You can also use filter-related commands on the shortcut menu to filter the data in a table. To do this, point to any value of the field by which you want to filter data, then right-click to show the shortcut menu. You will see the Filter item which provides a submenu containing the following commands:
q

Remove Filter This command is enabled after you have applied filtering on the field. Clicking this item will remove all filters

on this field.
q

First N Shows the First N item with which you can filter data to display records that meet the First N condition. You can select a number from the submenu or enter a positive integer into the text box on the submenu to specify the First N condition. For example, if you select 5 from the First N submenu for a certain field, then only the records with the field value equal to one of the first five field values will be displayed.

Last N Shows the Last N item with which you can filter data to display records that meet the Last N condition. You can select a number from the submenu or enter a positive integer into the text box on the submenu to specify the Last N condition. For example, if you select 5 from the Last N submenu for a certain field, then only the records with the field value equal to one of the last five field values will be displayed.

Field values "Field values" is not the name for a command on the Filter submenu, but represents some items which are the values of the field you have right-clicked. Selecting any field value listed here will make the table only display records with the field value equal to the selected one. More This command is enabled if the Filter submenu cannot list all field values. When it is enabled, clicking it will show the Select Values dialog. You can select one value in this dialog, then the table will only display records with the field value equal to the selected one.

Using web controls


In JReport Studio, these four types of web controls can be applied: parameter control, parameter form control, filter control, and navigation control. This section describes each of the web controls and how to use them.

Using parameter control to specify a parameter to a report


A parameter control is a web control that is bound with a parameter used by the current report. By specifying values to the parameter in a parameter control, you can pass the parameter values to JReport and run the report with the specified values. Parameter controls do not support inserting cascading parameters. If you want to do this, use parameter form controls instead. To insert a parameter control and use it to specify a parameter to a report: 1. Do either of the following:
r

Click Menu > Insert > Parameter Control, then point to the destination where you want to add the parameter control and click the mouse button. Drag Parameter Control from the Components panel to the destination in the report.

The Insert Parameter Control dialog is displayed.

2. Select the parameter you would like to add to the parameter control, then click OK. 3. A parameter control will be added into the report. There are the following ways to specify parameter values according to the appearance of the parameter control which varies with the type and properties of the selected parameter:
r

Typing in the parameter values if the text field is editable. Selecting a parameter value from a drop-down list. Using the calendar button Time, or DateTime type. to specify a value using the calendar if the parameter is of Date,

Selecting or unselecting the checkbox to specify a Yes/No value. Using the button to specify multiple values for the parameter in the Enter Values dialog.

4. Once the value in the parameter control changes, the report will rerun with the new parameter

value. Note: If the specified parameter is no longer used in the report, the parameter control will become invalid.

Using parameter form control to run reports


A parameter form control is a web control that is bound with the parameters used by the current report or other reports. By specifying values to the parameters in a parameter form control, you can make the reports run with the specified parameter values. To insert a parameter form control and use it to run reports: 1. Do either of the following:
r

Click Menu > Insert > Parameter Form Control, then point to the destination where you want to add the parameter form control and click the mouse button. Drag Parameter Form Control from the Components panel to the destination in the report.

The Insert Parameter Form Control dialog is displayed.

2. Specify the target reports to run using the parameter form control.
r

To run the current report, select Current Report, then specify the parameters used to run the

report from the Select Parameters box.


r

To run other reports, select Others, then select the reports you want to run. All the parameters used by the selected reports are displayed in the Parameter Information box. If all the selected reports contain no parameters, you cannot finish the dialog.

3. Specify whether to include the Submit button in the parameter form control. If Submit is included, it is used to submit the parameter values you specified in the parameter form control. If Submit is not included, once you change the values of a parameter in the parameter form control, the new values will be applied automatically. 4. Click OK in the dialog to save the changes. The parameter form control is now inserted in the report. It lists the selected parameters for the current report or lists all parameters used by the specified reports. 5. In the parameter form control, specify values of the listed parameters. 6. Click the Submit button if present to run the current report or the specified reports. If there is no Submit button, the change of values in the parameter form control will trigger report rerunning. Note: If you save or publish a report containing a parameter form control to another directory, the reports that you bind the parameter form control with will not be saved or published along with the report.

Using filter control to filter report data


A filter control is used to filter one or more data components, which refer to tables, charts, and crosstabs, in a report using the same data source. To insert a filter control and use it to filter report data: 1. Do either of the following:
r

Click Menu > Insert > Filter Control, then point to the destination where you want to add the filter control and click the mouse button. Drag Filter Control from the Components panel to the destination in the report.

The Insert Filter Control dialog is displayed.

2. Specify the fields of the same type on which the filter control is based from the resource list in the Select Fields box. 3. Select the data components you want to apply the filter control to from the Apply To drop-down list. 4. When done, click OK. The filter control is inserted in the report. It lists all values of the specified fields. You can select one or more values to apply. After inserting filter controls in the report, you can also insert a navigation control for undoing/redoing the value selection in the filter controls. For details about the usage of navigation control, see Using navigation control to undo/redo value selection in filter controls.

Managing a filter control


After right-clicking at the upper left corner of a filter control, these options are available for managing the filter control.
q

Search Displays the quick search toolbar right above the filter control which enables you to search values in the filter control. You can also click the button quick search toolbar. on the title bar of the filter control to launch the

The following are details about the usage of the quick search toolbar:
r

Text field Type in the text you want to search for in the text field and the matched text will be highlighted among the field values. X Closes the quick search toolbar. You can also click outside of the quick search toolbar to achieve this.

Lists the advanced options.


s

Highlight All Specifies whether to highlight all matched text. Match Case Specifies whether to search for text that meets the case of the typed text. Match Whole Word Specifies whether to search for text that matches a whole word and ignore partial word matches.

Highlights the next matched text.

Highlights the previous matched text. Clear

Cancels the selection of values in the filter control. You can also use the button cancel the selection. This operation can be undone/redone.
q

on the title bar to

Sort Sorts the values in the filter control in the ascending or descending order. Hide Hides the filter control. Delete Removes the filter control from the report and the filter you created with the filter control will be removed from the report too. You can also use the X button on the title bar. Properties Opens the Filter Control Properties dialog for editing the properties of the filter control.

Cascading relationship between filter controls


When there are filter controls that apply to the same data components, and when these controls' fields have cascading relationship, the cascading relationship will be revealed when you select values in the controls. For example, there is a filter control based on the field Country, a filter control on City, and another on State. The first two share one table while the third shares nothing with the other two. In this case, Country and City values will show cascading relationship, but State values will not participate. You select USA in the Country filter control, the values in the City filter control will change as follows if the control has scroll bar: the cities belong to USA are displayed in the upper area of the filter control, and the other cities are put in the lower area and grayed out. For the case that the City filter control has no scroll bar: all the values remain their positions and the values not belonging to USA are grayed out. In both cases all the values are selectable. But the State values remain as before, since the selection of them will not affect the data components that the Country and City filter controls control.

Using navigation control to undo/redo value selection in filter controls


A navigation control can be considered as an accessorial control for filter controls and used to deal with the value selection operations in all the filter controls in the same report. To insert a navigation control into a report, do either of the following:
q

Click Menu > Insert > Navigation Control, then point to the destination where you want to add the navigation control and click the mouse button. Drag Navigation Control from the Components panel to the destination in the report.

A navigation control is a combination of three buttons:


q

Back Goes back to the previous value selection status and refreshes the report data accordingly. Clear

Removes all the value selection histories and all the filter conditions based on the selections, and refreshes the report data accordingly.
q

Forward Goes forward to the next value selection status and refreshes the report data accordingly.

Adding conditional formats to fields


You can add some conditional formats to a field in tables or crosstabs, which refer to the DBField, parameter field, formula field, and summary field, then when the specified condition is fulfilled, the defined format will be applied to the field values for highlighting. To add conditional formats to a field: 1. Right-click the field and select Conditional Formatting from the shortcut menu to access the Conditional Formatting dialog.

2. Click the button to open the Edit Conditions dialog to define a condition using either simple expressions or complex expressions according to your requirements. 3. The newly added condition will then be displayed and highlighted in the Condition box in the

Conditional Formatting dialog. 4. In the Format box, set the format which will be applied to values of the field when the specified condition is fulfilled, for example, the font face, font size, font color, etc. 5. Repeat the above steps to add more conditions and define the format for each condition as required. To edit a condition, select the condition in the Condition box, then click dialog, edit the expressions as required. . In the Edit Conditions

To remove a condition and the corresponding format, select the condition in the Condition box and click . or

To adjust the priority of a condition, select the condition in the Condition box and then click . 6. Click OK to apply the conditional formats to the field. See also Conditional Formatting dialog and Edit Conditions dialog for details about options in the dialogs.

Applying parameters
When running a web report with parameters, a dialog is displayed for you to specify parameter values. After the report is opened in JReport Studio, you can change the parameter values using the following ways.

Using the Parameters panel


The Parameters panel is available when the current web report uses parameters. It lists all the parameters used by the current report. You can specify values to the parameters in the Parameter panel and then click Apply to make the report run with the specified parameter values.

Using parameter controls


You can insert a parameter control and bind it with a parameter used by the current report. By specifying values to the parameter in the parameter control, you can pass the parameter values to JReport and run the report with the specified values. For details, see Using parameter control to specify a parameter to a report.

Using parameter form controls


You can insert a parameter form control, make it run the current report, bind it with one or more parameters used by the report. By specifying values to the parameters in the parameter form control, you can make the report run with the specified parameter values. For details, see Using parameter form control to run reports.

Sorting report data


You can sort the records or groups at a certain group level in a table, crosstab or chart.
q

Sorting records: Changing the order of records in the whole table, crosstab or chart, or in each group if there are. Sorting groups at a group level: Changing the order of groups at the specified group level, that is, the groups will be sorted by value of the group field.

To sort data on a certain field using shortcut menu: 1. Point to any value of a detail field or group field by which to sort the data in a table, crosstab or chart, and then right-click. 2. Choose the command Sort > Ascend or Sort > Descend from the shortcut menu. If what you right-click in Step 1 is a detail field value, the sorting will affect the order of detail records in the table, crosstab or chart; if it is a group field value, the order of groups in the group level represented by the group field will be rearranged. To remove the sort condition on a field, click Sort > No Sort from the shortcut menu. Note: If you use the shortcut menu to sort the report data by a field and then sort by another field, the later sort condition will replace the former one.

Applying CSS styles


CSS styles can be applied to web reports formatting their appearance and characteristics. You can create and set up your own CSS styles in JReport Designer or any other CSS editor. When you publish your catalogs to JReport Server, you can include these custom styles with the catalogs. Styles can be applied to a table, crosstab, or chart, or to the multiple selections of these components, or to the whole report. The last style always takes effect when more than one style is applied to the same object.

Applying a style to a report


When a style is applied to the whole report, all components in the report will take a uniform appearance. You can apply a style in one of the following ways:
q

Specify a style in the Style page of JReport Studio Wizard. In JReport Studio, click the blank area outside of the report field, then select a style from the Report Style list on the Edit menu.

Applying a style to a component


You can apply a style to a table, crosstab, or chart by selecting the component in JReport Studio and then doing one of the following:
q

Select a style from the Report Style list on the Edit menu. Right-click and then select a style from the Apply Style list on the shortcut menu.

Applying a style to multiple components


You can apply a style to multiple selections of tables, crosstabs, and charts by selecting the components and then selecting a style from the Report Style list on the Edit menu. Reference: See also the chapter Styles in the JReport Designer User's Guide for more information about CSS styles.

Saving the report


To save the changes you made to the current report, click Menu > File > Save (or the Save button Standard toolbar). If the report is newly created and has not yet been saved, the Save As dialog will be displayed. on the

1. In the Save in section, browse to the folder where you want to save the web report in the server resource tree.

You can use the

button to return to the parent folder.

2. In the File Name box, enter the name of the report or use the default name. The default file type is web report. 3. Click the Advanced button to set the advanced settings for the report if required. a. From the Status drop-down list, specify a status for the report. b. From the Catalog drop-down list, select the catalog for the report. c. Specify the relationship between the saved report and the catalog used to run it:
s

Set Original Catalog as Linked Catalog into Saved Report If checked, the saved report will be linked with the catalog and will run with the catalog no matter whether the two are in the same directory. If later the catalog is updated, the saved report will run with the latest version of the catalog. Set Catalog Copy to Target Folder If checked, the catalog will be copied to the directory where the report is saved and the saved report will run with the copied catalog.

d. Optionally, input comments in the Description box as a description for the report. 4. Click Save to save the report. To save a copy of a report, click Menu > File > Save As (or the Save As button show the Save As dialog, and then do as above. on the Standard toolbar) to

To find a newly saved web report version, browse to select the row that the web report is in on the JReport Console > Reports page, click Tools > Version on the task bar, and then click the Web Report Versions tab. Note: You will not be able to save the report to some locations if you do not have the required permissions. You need to have Write access to the directory.

Exporting/Printing the report result


When you finish editing a web report, you may want to export it to other formats or have it printed.

Exporting the report result


You can export the report result as a result version or as a local file in these formats: HTML, PDF, Text, Excel, RTF, XML, and PostScript. 1. Click Menu > File > Export (or the Export button dialog. on the Standard toolbar) to display the Export

2. From the Select Report Result Format drop-down list, select a format in which to export the result.

3. Specify the destination of the result:


r

View Report Result: The result will be directly opened in the web browser if the format is supported by a plug-in of the web browser; otherwise it will prompt you to save the result file. Save to File System: The web browser will prompt you to save the result file to a specified folder. If selected, you need to provide a name for the result file in the File Name field. Save to Version System: The result will be saved as a result version in JReport Server's versioning system.

4. Expand More Options to set the options for the selected format. For details about settings of each format, see Export dialog. 5. Click OK to confirm.

Printing the report result


You can print the report result to a PDF/HTML file. To print the result of a web report: 1. Click Menu > File > Print (or the Print button on the Standard toolbar) to display the Print dialog.

2. In the General tab, specify the printer properties, the page range and copies you want to print. 3. In the Appearance tab, specify the appearance of the printed report as required.

4. Click OK. The PDF/HTML result file will be opened in an associated program with which you can print the result to a printer. See also Print dialog for additional information about options in the dialog.

Running web reports on server


Just like page reports, web reports can run using the following ways. However, there are some differences, which are listed as follows:
q

Directly running A web report cannot run in DHTML or Applet format. If the Default Format for Viewing Report property of a web report is set to DHTML or Applet, the web report will run in JReport Studio by default. Advanced running A web report cannot run in DHTML or Applet format, however, one more format is provided when you run a web report in Advanced mode: Studio, by choosing which you can run the web report in JReport Studio. Scheduled running The results of a web report cannot be published to JReport Result or DHTML formats, but one more format is provided: Studio Result, which is a static web report result marked as WST file.

You can refer to the following topics for reference about running and scheduling a web report:
q

Running reports Scheduling reports

Opening web reports in JReport Studio via URL


JReport provides parameters for developer users to run web reports via URL. All the parameters are encapsulated as JSON (JavaScript Object Notation) objects. Therefore, it will help if you obtain some knowledge on JSON to understand the syntax more clearly. When composing the URL, you need to use URL encoding to avoid errors. The following lists the parameters for running web reports via a URL:
q

jrd_report={ "name":"xxx", // The full path of the web report. "ver":"-1", // Optional: The report version. -1 means the latest version. }

jrd_catalog={ "name":"xxx", // The full path of the catalog that the web report uses. "ver":"-1", // Optional: The catalog version. -1 means the latest version.

}
q

jrd_param$={ "p1":"v1", // p1 is parameter name, and v1 is p1's value. "p2":["v1","v2","v3"] // For multiple values }

jrd_userinfo={ // Optional. "user":"xxx", // User name "country":"us", // The locale representing the region part for running reports, following locale naming specification "language":"en", // The locale representing the language part for running reports, following locale naming specification "encoding":"UTF-8", // The encoding for running reports "resolution":"96" // The resolution for displaying reports }

jrd_datasources=[ // Optional. // The following types of external data sources are supported: 0 - JDBC data source, // 2 - Java DataSource object, 3 - Connection object, 4 - ResultSet object. // One or multiple data sources can be included at a time. { // JDBC data source "ds":"Data Source 1", // Data source name "uid":"xxx", // DB user name "pwd":"xxx", // DB user password "type":"0", // Indicates the data source type. "url":"xxx", // JDBC URL. For example, "url":"jdbc:oracle: thin:@[Link]:1521:ora8i". "driver":"xxx" // JDBC driver. For example, "driver":"oracle. [Link]". }, {

// Java DataSource object/Connection object/ResultSet object. // Users should define request or session attribute, then the attribute // key is the one defined in the request. // For example, write [Link] as follows: // // String key = "Rst"; // [Link] rst = null; // rst = // get result set object from user own business logic // [Link]("Rst", rst); // // Then the key would be that "key":"Rst". // The above example is based on ResultSet object. It also applies to the other two types. // "ds":"Data Source 2", // Data source name "type":"2/3/4", // Indicates the data source type. "key":"xxx" // Request attribute object name, included in request or session } ] Here is an example of the complete URL without URL encoding to make it easier to read: [Link] [Link]","ver":"-1"}&jrd_datasources=&jrd_catalog={"name":"/SampleReports/ [Link]","ver":"-1"}&jrd_param$={"P_Coutry":"USA"}"xxx"},[{" ds":"Data Source 1","uid":"xxx","pwd":"xxx","type":"0","url":"xxx","driver":{"ds":"Data Source 2","type":"2","key":"xxx"}] If you use absolute resource path, you need add the property "real":"true" for the path. For example, jrd_report={"name":"C:\JReport\Server\jreports\SampleReports\[Link]","ver":"1","real":"true"}&jrd_catalog={"name":"C:\JReport\Server\jreports\SampleReports \[Link]","ver":"-1","real":"true"}

Running web reports to other formats via URL


To run a web report to other formats than to JReport Studio, you can make use of jrs commands and jrs.result_type which is used to specify the type:

jrs.result_type=1 (HTML) or 2(PDF) or 3(Text) or 4(Excel) or 5(PostScript) or 6(Rich Text) or 7(XML) For example, to run a web report to PDF: [Link] 2fSampleReports%[Link]&[Link]=%2fSampleReports%[Link]&jrs. result_type=2

JDashboard
JDashboard is a new way of information delivery, using a user portal user interface rather than a web report or page report. Users can create, edit and browse dashboards from the JReport Console using JDashboard. Library components are the basic members in dashboards for presenting data via intuitive components such as charts, crosstabs, tables, and Google maps. Library components are created using JReport Designer (for details, see Library Components in the JReport Designer User's Guide), and then published to the component library on JReport Server for use when creating or modifying dashboards. With pre-built library components, users can freely choose the objects they want to display in the dashboard, without having to know how these objects were created, what data sources to use, what styles to set, etc. A dashboard can hold multiple library components so that when browsing the dashboard users are able to see multiple data aspects. Within a dashboard, library components are able to communicate with each other via the message mechanism. This allows actions such as common filters to be applied to all the components of a dashboard even when coming from different data sources. Since predefined containers are used for holding objects, it is easy to move objects around and resize them in dashboards. This chapter covers the following topics:
q

JDashboard basic concepts JDashboard window elements Creating dashboards Inserting components General operations in JDashboard Manipulating data components Filtering component data Saving dashboards Setting JDashboard home page

Note: A JDashboard license is required in order to use JDashboard and all the related features. If you do not have a JDashboard license please contact your Jinfonet Software account manager to obtain a license.

JDashboard basic concepts


The following shows the main JDashboard concepts: Library components Library components are used to build dashboards. They are able to present data via intuitive components such as charts, crosstabs, tables, and Google maps. Library components are created and edited using JReport Designer, and then are published to the component library on JReport Server for use in dashboards. Component library A component library is used to manage library components on JReport Server. The library is a logical concept instead of a physical node. Library components that have been published to the library are available for use when creating or modifying dashboards. Dashboard A workspace window that can contain any number of library components.
q

Components from library When inserting a library component from the component library into a dashboard, you are not copying the component from the library, but instead referencing it from the library, in this sense, the changes to the component in the library will be reflected in all of the dashboards referencing the component. The contents of library references in dashboards cannot be edited since they are referenced resources. Objects from the Toolbox In addition to library components users can select objects from the Toolbox such as labels, images, special fields, sliders, and filter controls.

Message The information that one library component can send to another. The sending and receiving of messages between library components are defined in JReport Designer. Field mapping table Centralized alias table in JReport Server used for library components to interpret messages correctly. There are two mapping tables:
q

Global mapping table The global field mapping table for all dashboards that can be accessed and manipulated by administrators. Local mapping table The local field mapping table in one dashboard that can be accessed and manipulated by authorized end users.

JDashboard window elements


JDashboard is opened in a web browser.

Dashboard view
Dashboard view has header and body. Dashboard header can contain labels, images, and special fields such as Print Date and User Name. Body can contain library components only. You can insert the same library component repeatedly to the same dashboard body. Library components inserted to dashboards are references of the library component in component library. The changes to the library component in the library will be reflected in all of the dashboards referencing the library component, such as removal of library components, version updated, permission changed. Dashboard body lays out library component using grids. The grids are hidden by default, only when users performing actions like dragging will they be shown, and after users dropping objects the grids will become hidden again.

Menu and toolbars


After JDashboard is opened in a web browser, the following will be available for editing dashboards:
q

One toolbar at the top One side bar on the left by default One menu hidden by default

Toolbar
The toolbar at the top contains dashboard name tabs. Dashboard name tab Shows the names of opened dashboards. The following are operations on the tabs:
q

Click a tab to activate the corresponding dashboard. Rename a tab. Double-click a tab name to enter the editing mode. After typing a new name, press Enter or click outside the input field to save the name. Move a tab. Drag a tab and drop it beside a different tab so as to change the tab order. Clicking x beside a dashboard name will close the dashboard.

Adds a new dashboard in the current web browser.

Side bar
The side bar on the left contains these buttons:

The Dashboard button is the entry to the Dashboards panel. The panel contains the resource view of dashboards with folders. By double-clicking a dashboard in the panel you can open it.

The Component button is the entry to the Components panel. The panel contains the resources in the component library. You can select a library component in the panel and drag it into the dashboard body.

The Toolbox button is the entry to the Toolbox panel. The panel lists the objects that can be inserted in dashboards. Dashboard Title, Image, Label, and Special Field can be inserted in dashboard header, while Slider and Filter Control in dashboard body. These objects are editable in dashboards.

Refreshes the current dashboard.

Displays the menu options. The Dashboards, Components, and Toolbox panels share one panel window, therefore the change to one panel's height, width, and position will be reflected in the other two panels. They also share the following common usages:
q

Drag the right border, bottom border, or bottom right corner to resize the panel. Double-click a folder to open it. After a panel is open, you can close it by clicking its button. For example, to close the Toolbox panel, click the Toolbox button. When the panel cannot hold all resources, there will be a scrollbar appearing on the right. Use it to scroll resources vertically. Drag the title bar to move the panel. Click the Pin icon on the title bar to make it vertically positioned, this will make the panel position fixed and unmovable but can be resized.

The Dashboards and Components panels have a toolbar and the buttons on it are as follows:
q

The arrow button

directs you to the parent folder.

The ... beside the arrow button provides a general view of all available folder resources in a tree structure. By selecting a folder you will open the folder in the panel.

Menu
The menu options are available after you click New on the side bar.

Creates a new dashboard. Open Opens another dashboard. Save Saves the changes made to the current dashboard. Save As Saves the dashboard as another one. Set as Home Page Sets the current JDashboard page as home page after logging onto JReport Server using the dashboard port. Component Title Bar Customizes the way of showing component title bar and the icons on it. Themes Applies a theme to the current dashboard. Help Displays the JDashboard help documents. Exit Exits JDashboard.

Creating dashboards
To create a dashboard: 1. On the JReport Console > Reports page, click New Report > Dashboard. A blank dashboard will be created. 2. By default the dashboard header is folded, you need to unfold it before inserting any components into it. To unfold the header, hover the mouse cursor on the border right below the dashboard name tabs, then a dotted line appears and the cursor changes into a double-arrow icon. Drag the dotted line downward to a lower location. The area above the dotted line is the dashboard header. In the header you can insert labels, images, and special fields like Print Date and User Name via the Toolbox panel. To make the header border shown, press the Ctrl button on the keyboard, and you will see the dotted line. Illustration 1: When the two-arrow icon appears, you can drag.

Illustration 2: Drag the border to a lower position.

3. In the body you can insert library components via the Components panel or insert sliders and filter controls via the Toolbox panel. For details see Inserting components.

Inserting components
You can insert components into dashboards via two left panels. From the Components panel you can choose library components available in the component library and reference them into dashboard body. From the Toolbox panel you can insert labels, images, and two special fields User Name and Print Date into dashboard header, and insert sliders and filter controls into dashboard body. By default the dashboard header is folded, you need unfold it before inserting any components into it. To unfold the header, hover the mouse cursor on the border right below the dashboard name tabs, then a dotted line appears and the cursor changes into a double-arrow icon. Drag the dotted line downward to a lower location. The area above the dotted line is the dashboard header. The following shows inserting a specific component in detail:

Inserting library component references


When inserting a library component from component library into a dashboard, you are not copying the component from the library, but instead referencing it from the library, in this sense, the changes to the component in the library will be reflected in all of the dashboards referencing the component. The contents of library references in dashboards cannot be edited since they are referenced resources. To reference a library component into the dashboard body: 1. Click the Component button on the left to display the Components panel.

2. Browse to find the library component you want to insert, then drag it to the destination in the dashboard body.

Inserting a label
Labels can be inserted in the dashboard header. To do this, click the Toolbox button on the left to display the Toolbox panel. From the panel drag Label to the destination in the dashboard header.

Inserting a dashboard title


A dashboard title is a special label. It can be inserted in the dashboard header. To do this, click the Toolbox button on the left to display the Toolbox panel. From the panel drag Dashboard Title to the destination in the dashboard header.

Inserting an image
Images can be inserted in the dashboard header. 1. Click the Toolbox button on the left to display the Toolbox panel.

2. From the panel drag Image to the destination in the dashboard header. The Insert Image dialog

is displayed.

3. Specify the image you want to insert.


r

To use an image in the local file system, select Local File, then click Browse to find the image. To use an image on a website, select Web URL, then input the image URL or paste the URL in the File URL text field. To use an image in the image library of JDashboard, select Library, then select the image in the My Pictures box.

4. Click OK to insert the image.

Inserting a special field


You can insert two types of special fields in the dashboard header: User Name and Print Date. To do on the left to display the Toolbox panel. From the panel drag Special this, click the Toolbox button Field to the destination in the dashboard header. Then in the Insert Special Field dialog, choose User Name or Print Date and click OK to insert the specified one.

Inserting a slider
Sliders can be inserted in the dashboard body. They are used to filter component data. For details, see Using sliders.

Inserting a filter control


Filter controls can be inserted in the dashboard body. They are used to filter component data. For

details, see Using filter controls.

General operations in JDashboard


This section provides a general view of the operations you can perform in JDashboard.

Operations on dashboards
q

Creating a new blank dashboard in the current web browser on the side bar and then select New Click + beside the right most dashboard name tab, or click from the menu list, a blank dashboard will be created in the browser. Then add components to customize the dashboard.

Opening another dashboard in the current web browser on the side bar and then select Open from the menu list. In the Open Dashboard dialog, Click the dashboards in the same folder as the current open dashboard are listed. Select the dashboard you want to open from the default folder or from another folder, and then click OK. You can also open a dashboard using the Dashboards panel. Click the Dashboard button on the left to display the Dashboards panel. Then browse to the target folder by double-clicking and doubleclick a dashboard to open it.

Refreshing the current dashboard Click on the side bar to refresh the data of the current dashboard.

Applying a theme to the current dashboard on the side bar and then select Themes from the menu list. In the Themes dialog, select a Click theme from the left panel and then click OK.

Closing a dashboard For the current dashboard, click X on its name tab to close it. For the other open dashboards, hover the cursor on a name tab until X appears, then click X to close that dashboard. Exiting JDashboard on the side bar and then select If you want to exit JDashboard and release the resources, click Exit from the menu list. Do not use the close button on the browser window as that may not release the resources used by JDashboard.

Asking for help on the side bar and then select Help from the menu list to access the At any time, you can click JDashboard help documents. Furthermore, you can click in any dialog to show the help document about the dialog.

Operations on objects in the dashboard header


q

Editing an object

To edit the text of a label or the dashboard title, double-click it to enter the edit mode. Use the Backspace or Delete button on the keyboard to delete unwanted text and then input the desired text. To edit an image, hover the cursor on the image and then click that appears in the dotted rectangle, and the Edit Image dialog will be displayed for you to select another image.
q

Modifying object properties You can modify the properties of labels, the dashboard title, or special fields. To do this, hover the cursor on the object and then click that appears in the dotted rectangle, and a dialog will be displayed for you to modify the properties of the object.

Moving an object Place the cursor on the object until it becomes a four-arrow icon, then drag to the desired position. Resizing an object Place the cursor on the object until a dotted rectangle appears, next move the cursor on the right border, bottom border, or the bottom right corner until the cursor becomes a two-arrow icon, then drag to the desired position. Deleting an object Hover the cursor on the object and then click that appears in the dotted rectangle.

Operations on objects in the dashboard body


q

Moving an object Place the cursor on the component title bar until it becomes a four-arrow icon, then drag to the desired position. Resizing an object Place the cursor on the object's right border, bottom border, or the bottom right corner until the cursor becomes a two-arrow icon, then drag to the desired position. Navigating component data via scroll bar For tables, crosstabs and charts, you can use the scroll bar to navigate their data if the container cannot display all data of the component. Turning component pages If a table or a crosstab contains more than one page, a navigation bar specific for the component will be available right below the component. You can use the navigation bar to view the desired pages:
r

Click a number to go to that page. Input a number in the text field. Click Prev to go to the previous page. Click Next to go to the next page. Maximizing an object

on the component title bar and the object will take up the whole dashboard body. By clicking Click the button again the object will be restored to the original size. You can also maximize and then restore an object by double-clicking the component title bar.
q

Customizing the way of showing the component title bar and options on it Click on the side bar and then select Component Title Bar from the menu list. In the

Customize Component Title Bar dialog, specify the way of showing the component title bar and the options on it, and then click OK.
q

Deleting an object Click on the component title bar and then select Delete from the drop-down list. Making use of the configuration panel Each library component can be equipped with a configuration panel. The configuration panel can be used to specify parameter values to its library component, to filter or sort the data of its library component, or to change properties of objects in its library component. For how a configuration panel is configured, see Using the configuration panel in the JReport Designer User's Guide. Once a configuration panel has been defined for a library component, you can open it in JDashboard and then perform actions as defined. To do this, on the title bar of the library component, click and then select Edit Setting to display the configuration panel. After specifying values in the panel, click OK to apply the values in the library component. The Cancel button is used to close the configuration panel.

Showing object information Information about an object such as its author, e-mail address and description are provided. To view the information, click on the component title bar and then select About from the drop-down list. A panel will be displayed showing the information. You can click the OK button in the panel to close the panel.

Manipulating data components


You can manipulate data components, which refer to crosstabs, tables, charts, and Google maps, in dashboards as shown below. Applying a style to a data component Right-click in the component, then on the shortcut menu, select a style from the Apply Style submenu. Removing component level filters from a data component On the shortcut menu of data components, there is an option Remove Filters which is used to remove filter conditions generated via the configuration panel and via message delivery from the data components. These two kinds of filters are referred to as component-level filters. In dashboards you can also use sliders and filter controls to do filtering, however filters created by sliders or filter controls are not under the control of the removing component level filter action, because they are regarded as dashboard-level filters. Going up/down on Google map group markers
q

For the group level that is higher than some other group levels in a Google map component, point to its group marker, right-click it and select Go Down from the shortcut menu to jump one group level down. For the group level that is lower than some other group levels in a Google map component, point to its group marker, right-click it and select Go Up from the shortcut menu to jump one group level up.

Manipulating a table
q

Sorting on a field To sort the values of a field, right-click on any value of the field, then on the shortcut menu, select Ascend or Descend from the Sort submenu. To remove the sort condition, select No Sort. Filtering a detail field You can use filter-related commands on the shortcut menu to filter the data in a table. To do this, right-click on any value of the field by which you want to filter data, then from the Filter submenu, specify to show the first/last N values of the field or a specific value. To remove filter condition created this way, use the Remove Filter option on the Filter submenu. Going to and going to by value on a group field You can use Go to or Go to by value command on the shortcut menu of a group field to change the group field to another field. The go-to action simply changes the group field, while the go-to-by-value action adds a filter condition, which is [Group Field] = [Focused Value], on the basis of go-to action.

Manipulating a chart
q

Sorting category/series labels You can sort the labels on the category or series axes of a chart in either descending or ascending alphabetical order. To do this, right-click in the chart, then on the shortcut menu, select the required order from the Sort Category or Sort Series submenu. Swapping chart groups You can switch data between the category and series axes, or between the category and value axes of a chart if no field on the series axes. To do this, right-click in the chart, then on the shortcut

menu, click Swap Chart Groups.


q

Changing chart type Right-click in the chart, then on the shortcut menu, locate the Chart Type. From the drop-down menu, select the desired chart type and its subtype.

Filtering component data


When creating or editing dashboards, you can filter component data using two types of web controls: sliders or filter controls. Filter controls allow you to pick one or more random values from a list and are used with categorical or nominal variables. You can choose one or more values from anywhere in the list and there is no mean or median value calculation possible such as States and Countries. Sliders allow you to pick one or more sequential values from a list and are used for interval variables such as dates, times, quantity and currency variables where the slider represents the scale from lowest to highest value and the middle represents the median value. Think about what you need and choose the proper filtering tool.

Filtering scenarios
Both sliders and filter controls have the same filtering mechanism. Filtering based on one field is a common usage. Bind a field to a slider or filter control, and then based on the field to filter the data of the components created from the same data source as the field. Another special usage is to filter components using different data sources. Choose a common field all the data sources contain and then bind a slider or filter control with the common field in all the data sources, that is, in the insertion dialog, select the common field under the nodes of all the data sources. For example, there are two components containing data from different data sources, and you want to filter their data using one filter tool. The precondition is that both components have the field you want to filter. For example, you would like the two components to show the data of a specific country. In order to do this, insert a slider or a filter control according to your requirement into the dashboard body, then in the insertion dialog, select both the country fields from the two data sources (different data sources may use different names for the country field, for example, data source 1 uses "Country", data source 2 uses "P_Country", in this case, you need to select both "Country" and "P_Country"), then from the Apply To drop-down list, select the two components you want to filter. The filter tool will be inserted in the dashboard body, and you can see it lists country names which come from the two data sources. In the filter tool select one or more countries, then the two target components will be filtered and only display the data of these selected countries. When you bind a slider or filter control with multiple different fields, be sure the list of values in each field match so that when you select a value, such as Country, P_Country and S_Country, it will match the appropriate country field in each component. The logic is the values are OR that is Field1=SelectedValue1 or Field2=SelectedValue1 or Field3=SelectedValue1. Therefore, when Field1, Field2 and Field3 are used in different components you will see the records correctly in each component. When you bind a slider or filter control with multiple different fields which do not contain the same list of values such as Country, Region and Territory, at runtime after you select values in the slider or filter control, the filter condition will use OR logic to apply the selected values to all the fields of the slider or filter control, for example, Field1=SelectedValue1 or Field2=SelectedValue1 or Field3=SelectedValue1. In this case, when there are three fields but the list of values in each field do not match, the result will have no matching records for two of the components and therefore become blank components. We

recommend that you use three different filter tools in cases like this.

Using sliders
To insert a slider to the dashboard body: 1. Click the Toolbox button on the left to display the Toolbox panel.

2. From the panel drag Slider to the destination in the dashboard body. The Insert Slider dialog appears.

3. In the Title text field, input a title for the slider. 4. Choose whether the slider is used to specify a range of values or just a single value. 5. From the resource list, select the fields of the same data type to bind to the slider. To filter components created from the same data source, select a field in the data source. To filter components created from different data sources via one slider, find a common field these data sources contain, then select the field in each of the data sources. 6. By default, all the values of the selected fields will be available for the slider, which may be too

many for a slider. However you can customize the values to show. To do this, a. Click the Customize button to display the Customize Value dialog. b. Uncheck the Select All option. You can then customize the values.
s

To specify values one by one, click to add a value line, then in the line to type a value or select a value from the drop-down list. Repeat the operation to add more values. To remove a value, select its line and then click the button.

To specify the value range, specify a value in the From and To text boxes respectively.

c. For Date/Time/DateTime type fields, you can also specify a special function. For details about the special functions, refer to Specifying special function for group by field in the JReport Designer User's Guide. d. Click OK to save the customized values. The customized values will be available on the slider for choosing. 7. The Apply To drop-down list provides the components involving the selected fields. Select the components which you want to filter. 8. Click OK. A slider bound with the specified fields will be inserted in the dashboard body. You can then specify values in the slider to filter the specified components. Later if you want to modify the slider, click on the title bar of the slider and then select Edit Setting. The Edit Slider dialog will be displayed for you to bind different fields or customize the field values.

Using filter controls


To insert a filter control to the dashboard body: 1. Click the Toolbox button on the left to display the Toolbox panel.

2. From the panel drag Filter Control to the destination in the dashboard body. The Insert Filter Control dialog appears.

3. In the Title text field, input a title for the filter control. 4. From the resource list, select the fields of the same data type to bind to the filter control. To filter components created from the same data source, select a field in the data source. To filter components created from different data sources via one slider, find a common field these data sources contain, then select the field in each of the data sources. 5. The Apply To drop-down list provides the components involving the selected fields. Select the components which you want to filter. 6. Click OK. A filter control bound with the specified fields will be inserted in the dashboard body. You can then specify values in the filter control to filter the specified components. Later if you want to modify the filter control, click on the title bar of the filter control and then select Edit Setting. The Edit Filter Control dialog will be displayed for you to bind different fields. Filter control provides a quick search toolbar for easily locating the values you want. Click field name bar to launch the quick search toolbar. The button cancel the selection of values in the filter control. Usage of the quick search toolbar on the

on the field name bar is used to

Text field Type in the text you want to search for in the text field and the matched text will be highlighted among the field values. X Closes the quick search toolbar.

Lists the advanced options.


r

Highlight All Specifies whether to highlight all matched text. Match Case Specifies whether to search for text that meets the case of the typed text. Match Whole Word Specifies whether to search for text that matches a whole word and ignore partial word matches.

Highlights the previous matched text.

Highlights the next matched text.

Saving dashboards
To save the changes you made to the current dashboard, click list. on the side bar and then select Save from the menu

If the dashboard is newly created and has not yet been saved, the Save As dialog will be displayed.

1. In the Save In section, browse to the folder where you want to save the dashboard in the server resource tree. You can use the button to return to the parent folder.

2. In the File Name box, enter the name of the dashboard or use the default name. 3. Click OK to save the dashboard. To save a copy of a dashboard, click As dialog, and then do as above. on the side bar and then select Save As from the menu list to show the Save

After saving your dashboard into the server resource tree, you can browse to its directory on the JReport Console > Reports page and run it directly just like you run a report. To find a newly saved dashboard version, browse to select the row that the dashboard is in on the JReport Console > Reports page, click Tools > Version on the task bar, the Dashboard Version panel will be displayed showing the versions. Note: You will not be able to save the dashboard to some locations if you do not have the required permissions. You need to have Write access to the directory.

Setting JDashboard home page


You can save the JDashboard status such as which dashboards are open and which dashboard is active. Dashboards can have their status saved in JDashboard only when they have been saved. Then the next time when you access JDashboard via either of the following ways, the saved JDashboard status will be loaded:
q

Log onto JReport Server using the dashboard port. The URL is like this: [Link] 8887 is the default dashboard port. Administrator can change it via the Dashboard Port option on the JReport Administration page > Configuration > Service panel. Click the Home tab on the system toolbar of the JReport Console page. The Home tab is available after you have set JDashboard home page.

To set JDashboard home page: 1. In the Profile > Customize Server Preferences > General tab on the JReport Administration or JReport Console page, set the option Enable Setting Dashboard as Home Page to Yes to enable setting JDashboard home page. 2. In JDashboard, open the desired dashboards, click on the side bar and you will see Set as Home Page is enabled on the menu list. Click the option to set the current JDashboard status as the home page. In the same JDashboard window, you can set JDashboard home page at any time you want. The last time you do this before exiting JDashboard will take effect. To cancel setting JDashboard home page, in the Profile > Customize Server Preferences > General tab on the JReport Administration or JReport Console page, uncheck Yes for the option Enable Setting Dashboard as Home Page.

Integrating with a Java Application Server


JReport Server is implemented using Java Servlet technology and Java Server Pages (JSP). These servlets and JSP pages enable you to work with any Java EE compliant application server and administer JReport Server remotely through a web browser. In order to deploy to an application server, you first have to create a Web Application Archive (WAR) file or an Enterprise Application Archive (EAR) file to include a JReport Server, and then use the application server deployment tools to deploy the WAR/EAR file. This chapter covers the following:
q

Seamless integrated security solution Building a WAR/EAR file to include a self-contained JReport Server Deploying JReport Server to a Java application server Integrating remote JReport Server

Note: JReport Web and JReport Studio slather dynamic classes, so you probably encounter "OutOfMemoryError: PermGen space" problem when working with them after integration. To solve the problem, you need to add -XX:MaxPermSize=256m to JVM or set the number to a bigger one according to your case.

Seamless integrated security solution


As a reporting server, JReport Server protects information via authentication and authorization processes. Furthermore, JReport allows a web application to embed this reporting solution in it seamlessly not only on UI but also with the Java EE technology. In this way, the seamless integrated security solution becomes one of the key solutions of JReport Server. There are all kinds of scenarios on using JReport solution. However, they can all be categorized into the following two types according to the location of the JReport Server instance.

JReport Server instance is located in the same JVM as the web application

In this scenario, the application includes JReport Server JAR files into the same JVM, and it also includes JReport built-in servlets and JSPs which handle DHTML and other reporting services, for example, scheduling reports. Description of the illustration In this scenario, the client (HTTP client) most of time will send a request to the portal, JSP or Servlet of the web application, and the web application can either call the public Server API to the server instance directly to run a report and output a report result to file system, or it can re-direct the request to the JReport services provided by the JReport JSPs and Servlets, for example the DHTML JSP and Servlet. JReport JSPs/Servlets will first make sure the request is authenticated and authorized. After which, it will call the internal API method against the JReport Server Instance in the same JVM to fulfill the requirement and return suitable information to the client via JSPs or internally generated output steam. In the illustration above, you can see that the HTTP client can send a request directly to the application

JSP/Servlets or JReport JSPs/Servlets. Before a response is made by the JReport JSP and Servlet, an Auth Check is performed to authenticate the session and then authorize the action. Normally, the builtin authenticator and authorization instance of JReport Server (Instance) is called to perform these checking actions. However, if the application wants to control the process, the web application developer can set up the configuration to ensure that the customized authenticator and authorization instance is used instead. Pay attention to the RED box: External Authorized instance. This Java class implements JReport jet. [Link] to provide the authenticated user ID from the session. If this Instance returns a user ID, JReport will pass it to its authenticator to check if it is valid. If the user ID is valid for JReport, JReport will qualify the session of the request, and will not ask for a login again. If this external authorized instance does not return a user ID, JReport will respond the request by asking for a login. The other RED box - Authenticator and Authorizer instance, can be provided by implementing two other interfaces: [Link] and [Link]. AuthorizationProvider. The AuthenticationProvider is used to authenticate the user ID, including whether or not the user ID is valid. The AuthorizationProvider is used to check the privileges of the user against the action that the user requests. During the auth check process, if the external authorized instance returns a user ID of the session, JReport auth check will continue to send the user ID to the AuthenticatorProvider to check if it is valid or not. If the user is valid, the auth check will qualify the session of the request, and then continue to check if the action is valid for the user by asking the AuthorizationProvider instance. In general, there is an authentication callback via the implemented interface of External Authorized. Two security check providers can be implemented to seamlessly integrate JReport security into the application.

JReport Server instance is located in a different JVM from the web application

From the web application itself, the architecture is not changed. However, the way that it uses the JReport solution is different since the JReport Server Instance is outside of the Web application server. Inside of the Web Application, the instance is RMI server being called by the web application server or JReport built-in JSP/Servlets for the RMI solution.

Building a WAR/EAR file to include a self-contained JReport Server


There are two ways of creating a WAR or EAR to include a self-contained JReport Server:
q

Create a WAR/EAR file using the provided tool [Link]/[Link] after you have installed a JReport Server. If you are not familiar with JReport Server, it is better to use this way. Create a WAR manually. The method is no longer needed but is still available in this release in case you would like to take it.

The self-contained JReport Server is based on a library. The library contains all class packages required by the JReport Server runtime, such as [Link], [Link], [Link], and [Link]. In the library, [Link] contains the entire JReport runtime environment, and is the key to the selfcontained integration solution. With the self-contained solution, you do not have to specify the JReport Server installation root as the reporthome. When you create a JReport Server WAR/EAR file using the provided tool, the [Link] package will be automatically put into the WAR/EAR, and will be extracted to the specified reporthome when initializing JReport Server. The following is the structure of the [Link] package: [Link] workspace/ -- This is the root folder. bin/ -- This folder contains the license file [Link] and configuration files, such as [Link] and [Link]. lib/ -- This folder contains jar files needed by applets, such as [Link] and [Link]. template/ -- This folder contains template files. profiling/report/ -- This folder contains profiling report files. jreports/ -- This folder contains demo reports or pre-published reports. db/ -- This folder contains demo database for demo reports. help/ -- This folder contains help documents. The bin/, lib/, and template/ folders are necessary for the JReport runtime, while the profiling/, jreports/, db/ and help/ folders are optional. Note: There is a parameter in self-contained WAR/EAR - autoDetectServletPath. It is used to dynamically detect and modify servlet path based on context path of self-contained WAR/EAR when deploying the WAR/EAR to a J2EE application server. This property is enabled by default, and the actual servlet path will be concatenating "context path" with "default servlet path" set in [Link]. If you do not want this way, you can disable the feature using either of the following ways:
q

Before making your WAR/EAR, set the parameter autoDetectServletPath to false in [Link] which is located in <install_root>\bin. If the WAR/EAR has already been built, go to [Link], set this parameter autoDetectServletPath to

false. The following are topics covered in the section:


q

Building a JReport Server WAR/EAR by tool Building a JReport Server WAR manually (deprecated) Four ways of integrating JReport Server

Building a JReport Server WAR/EAR by tool


A tool based on the Apache Ant project is provided by JReport Server to build JReport Server WAR/EAR files which contain the full JReport Server runtime environment. The WAR/EAR files can be deployed to any Java EE compliant application server without having to specify a JReport Server installation root as the reporthome. You can use the default settings to generate a JReport Server WAR/EAR, or you can customize the reporthome and data source for JReport Server before generating the WAR/EAR using the provided tool.
q

Creating a JReport Server WAR/EAR Specifying reporthome for JReport Server in a Java EE environment Specifying a data source for JReport Server in a Java EE environment

Creating a JReport Server WAR/EAR


JReport Server provides a tool for building a WAR or EAR file. The tool is [Link]/[Link], and [Link] in <install_root>\bin.

[Link]
This file can be used to specify the following:
q

Targets specified to build the WAR/EAR file. They start with the tag <target name="xxx"...>. You can modify the target names. By default, the main targets in the [Link] are as follows:
r

Making the server runtime environment Making the WAR file for normal or remote integration Making the EAR file Temp directories.

The temp directory used to save the temp files when building the WAR/EAR. By default, it is <install_root>\bin\distribute\temp. The directory which is used to store the generated WAR/EAR file. By default, it is <install_root> \bin\distribute.

The deployment descriptors, such as [Link] and [Link]. The configuration information, such as the database connection information for the WAR/EAR file is stored in these files.

[Link]/[Link]
The batch/script file used to build a JReport Server WAR/EAR according to the target specified in [Link]. Usage [Link]/[Link] [Target Name] [-Dpredeploy=ReportFolder] [-Dreporthome=XXX] [[Link]=XXX] [-[Link]=XXX] [-[Link].auth_file=XXX] Options
q

Target Name The following targets can be performed:


r

buildWar - Specifies to build the JReport Server WAR. It is the default target. buildEar - Specifies to build the JReport Server EAR. buildRemoteWar - Specifies to build the JReport Server WAR for remote integration.

-Dpredeploy=ReportFolder Allows you to deploy the reports and catalogs under ReportFolder to the WAR/EAR file.

-Dreporthome Specifies the reporthome that will be set into [Link] in the WAR/EAR. If this argument is not set, reporthome will be decided when the WAR/EAR is loaded by the application server and the location will be %[Link]%/.jreport/default. This argument takes effect only when the target name is buildWar, buildEar, or buildWar4WS. -[Link] Specifies the server's RMI host when building a WAR for remote integration. This argument takes effect only when the target name is buildRemoteWar. -[Link] Specifies the server's RMI port when building a WAR for remote integration. This argument takes effect only when the target name is buildRemoteWar. -[Link].auth_file Specifies the RMI auth file with the absolute file path when building a WAR for remote integration. This argument takes effect only when the target name is buildRemoteWar.

Examples
q

Builds the JReport Server WAR file which is defined by [Link] (the default target). The generated WAR file is saved to the default directory <install_root>\bin\distribute. [Link]

Builds the JReport Server WAR file, and saves the generated WAR file [Link] to the specified reporthome. [Link] buildWar -Dreporthome=C:\JReport

Builds the JReport Server EAR file, and saves the generated EAR file [Link] to the default directory <install_root>\bin\distribute. [Link] buildEar

Builds the JReport Server WAR file, and deploys the reports and catalogs in C:\myReport to the WAR file. The generated WAR file [Link] will be saved in the default directory <install_root>\bin \distribute. [Link] buildWar -Dpredeploy=c:\myReport

Builds the JReport Server WAR file as defined by [Link] for remote integration. The generated WAR file is saved to the default directory <install_root>\bin\distribute. [Link] buildRemoteWar -[Link]=[Link] -[Link]=1129 [Link].auth_file=C:\JReport\Server\bin\[Link]

Specifying reporthome for JReport Server in a Java EE environment


JReport Server requires a reporthome as its working space to hold the entire JReport runtime environment, including the server properties, configuration files and resources. The package [Link] that contains the entire JReport runtime environment will be extracted to the specified reporthome when initializing JReport Server. The reporthome can be any location on the disk where JReport Server has read and write privileges. You do not have to specify a reporthome for JReport Server since it will create a default reporthome location <[Link]>/.jreport/default. However, JReport Server enables you to customize the reporthome location before creating the JReport Server WAR/EAR using the provided tool. You can either specify reporthome directly or specify the implementation of the [Link] interface. Note: Make sure that the reporthome for the integrated JReport Server is different from that of the standalone JReport Server.

Interface CustomizedServerEnv
The [Link] interface can be used for specifying the JReport Server reporthome and for setting the server properties in a Java EE environment. It contains two methods:
q

String getReportHome() Properties getServerProperties()

If you specify the implementation of this interface, JReport Server will obtain not only reporthome but also server properties.

Three ways of specifying reporthome


There are three ways of specifying reporthome directly or the implementation of the [Link]. CustomizedServerEnv interface:
q

By JVM -D parameter. Set the JVM option -Dreporthome before starting the application server, for example: -Dreporthome=/home/jreport

Invoking the method [Link](Properties props). For example: Properties props = new Properties(); [Link]("reporthome", "/home/test/JReport"); [Link](props);

Using [Link]/[Link].

The following introduces several methods of specifying reporthome or implementation of CustomizedServerEnv:

Using the default reporthome Specifying reporthome directly in [Link] or [Link] Using the default implementations of [Link] Using a customized implementation of [Link]

Using the default reporthome


If you do not specify a reporthome, the self-contained JReport Server will create a default working folder. The default working folder is <[Link]>/.jreport/default, where <[Link]> is the system property [Link] retrieved from Java VM. The JReport Server has the Read and Write privileges in this directory. Different OSs have different real paths for <[Link]>. For example, For Windows: C:\Documents and Settings\username For Unix/Linux: /home/username Notes:
q

[Link] is a system property of the Java VM (-[Link]=xxx). So you can also specify different folders for this JVM option. If JReport Server is running on Windows as a service, the username is the user who installed the service or the specified logon user for the service. If JReport Server is running as a Unix/Linux Daemon, you can specify the JVM system property [Link] in the script file that starts JReport Server.

Specifying reporthome directly in [Link] or [Link]


It is recommended that you use the <env-entry></env-entry> tags to specify the reporthome directly in the target "[Link]" in the [Link] file or in [Link]. Also, in the target "web. [Link]", you can specify the reporthome using the <context-param></context-param> tags.

Specifying the reporthome for WAR

You can use one of the two methods listed below to specify the reporthome for WAR:
q

In the [Link] file, use the <env-entry></env-entry> tags to specify the reporthome in the target "[Link]", and then uncommented the setting. For example: <env-entry-name>[Link]</env-entry-name> <env-entry-value>/home/jreport</env-entry-value> <env-entry-type>[Link]</env-entry-type>

This is the recommended way to set reporthome since the <env-entry></env-entry> tags are also supported in [Link] (if you call the Server API in your EJB).
q

In the [Link] file, use the <context-param></context-param> tags to specify the reporthome in the target "[Link]", for example: <context-param> <param-name>reporthome</param-name> <param-value>/home/jreport</param-value> </context-param>

Specifying the reporthome for EAR

The same methods can be used to specify the reporthome of building the EAR file as of building the WAR file. However, because you can wrap WAR and EJB in the EAR file, you should ensure that you put the reporthome information either in the target "[Link]" in the [Link] file (for the web module) or in [Link] (for the EJB module). In [Link], use the <env-entry></env-entry> tags to specify the reporthome. For example, <env-entry> <env-entry-name>[Link]</env-entry-name> <env-entry-value>/home/jreport</env-entry-value> <env-entry-type>[Link]</env-entry-type> <env-entry>

Using the default implementations of [Link]


The self-contained JReport Server provides two implementations of CustomizedServerEnv. They are jet. [Link] and [Link]. [Link] If you use this implementation, you will not need to specify it in the target "[Link]" in the makewar. xml or in [Link], since it can find the customized reporthome from the <context-param></ context-param> tags of the target "[Link]" or the <env-entry></env-entry> tags of [Link] or [Link]. [Link] This implementation is extended from DefaultServerEnv. It enables finding the reporthome not only from <context-param></context-param> or <env-entry></env-entry> tags, but also from an external file <[Link]>/.jreportrc. However, this implementation has three main limitations. They are:
q

This implementation must be clearly specified with the <env-entry></env-entry> tags in the target "[Link]" in the [Link] or in [Link], as follows: <env-entry> <env-entry-name>[Link]</env-entry-name> <env-entry-value>[Link]</env-entry-value> <env-entry-type>[Link]</env-entry-type> </env-entry>

The JReport Server must be initialized with JRServerContextListener from a Web module. Since in cases of deploying multiple JReport Server instances in one Java EE application server without touching the WAR, such as extracting the WAR, setting reporthome and rebuilding the WAR, JReport Server has to use ServletContext to generate an ID for every instance. JReport Server retrieves [Link] from ServletContext by invoking the getAttribute(String) method, and then uses this value to generate the instance ID. For detailed information, see Java Servlet Specification Version 2.3/2.4 SRV.3.7.1 Temporary Working Directories.

The <[Link]>/.jreportrc file must be created by JReport Server. You can only edit the file to change the reporthome after the JReport Server initialization. Since the instance ID is generated based on a hash code retrieved from [Link]. tempdir, it cannot be pre-assigned, and is therefore impossible for you to create the <[Link]>/. jreportrc file. However, once the file has been created, you can edit it to change the reporthome for each instance. The RC file can hold multiple records. The record format should be as follows: [Link].<instanceID>=the-instance-report-home The instanceID is created by JReport Server during its first initializing. It is a string of HEX encoded hash value. For example: [Link].12345678=/home/user1/.jreport/instance.12345678

[Link].12345abc=/home/user1/.jreport/instance.12345abc If JReport Server cannot get the reporthome from CustomizedServerEnv, it will create a default reporthome in <[Link]>/.jreport/default. The following is an example of specifying reporthomes when deploying multiple server instances using [Link]: Example: Specifying reporthomes when deploying multiple server instances JReport Server provides an internally implemented class of the [Link]. CustomizedServerEnv interface - [Link] which supports multiple JReport Server instances in one Java EE application server. The reporthome of each instance can be assigned by the class automatically. To do this, follow the steps below: 1. In the file [Link], use the <env-entry></env-entry> tags to specify [Link]. MultipleInstanceServerEnv in the target "[Link]". For example: <env-entry> <env-entry-name>[Link]</env-entry-name> <env-entry-value>[Link]</env-entry-value> <env-entry-type>[Link]</env-entry-type> </env-entry>

2. Since different JReport instances cannot access the same JReport Server system database at the same time, you will need to create a [Link] file to store the connection information, and put it in [Link] in workspace\bin (you can find the [Link] file after extracting [Link]) for each JReport Server WAR/EAR. For detailed information about modifying the [Link], see Configuring the server database. 3. When the JReport Server WAR/EAR has been deployed, JReport will create a file .jreportrc in <[Link]>, and each JReport instance will read its reporthome from this file. This file must be created by JReport Server, however, you can edit it in order to change the reporthome after it has been created.

Using a customized implementation of [Link]


You can implement the interface and add your class to the generated WAR/EAR file, then use the <enventry></env-entry> tags to specify your implemented class in the target "[Link]" in the makewar. xml file or in [Link]. The following is an example of specifying a customized implementation of CustomizedServerEnv in the target [Link] in the [Link] file or in [Link] using the <env-entry></env-entry> tags. Here the customized implementation of CustomizedServerEnv is named [Link]. <!-- JReport Server calls [Link] to obtain reporthome and server properties.--> <env-entry> <env-entry-name>[Link]</env-entry-name> <!-- must be [Link]--> <env-entry-value>[Link]</env-entry-value> <!-- your class name --> <env-entry-type>[Link]</env-entry-type> </env-entry>

Notes:
q

JReport Server will retrieve the reporthome and properties from your implemented class when the WAR/EAR file has been deployed. The properties returned from getServerProperties() can be the properties listed in [Link] file in the directory <install_root>\bin, JVM System properties, or self-defined ones.

Specifying a data source for JReport Server in a Java EE environment


See Configuring the server database when integrating with an application server for detailed information.

Building a JReport Server WAR manually (deprecated)


This section introduces a method that has been used in earlier versions. If using this method, you will have to specify the JReport Server installation root as the reporthome unless you make the WAR be a self-contained solution. This section takes creating a WAR file on Unix for example. The instruction is applicable to both Unix and Windows platforms. However, the paths for Windows should use the Windows format, for example, C:\JReport \Server, while paths for Unix should use the Unix format, for example, /opt/JReport/Server. It is assumed that JReport Server has been installed to /opt/JReport/Server. Take the following steps to build a JReport Server WAR manually: 1. Create a new directory jreport in the JReport Server installation root: /opt/JReport/Server/jreport. 2. Create a sub directory WEB-INF in jreport: /opt/JReport/Server/jreport/WEB-INF. 3. Create a [Link] file in the WEB-INF directory as follows: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "[Link] <web-app> <listener> <listener-class>[Link]</listener-class> </listener> <servlet> <servlet-name>jrserver</servlet-name> <servlet-class>[Link]</servlet-class> </servlet> <servlet> <servlet-name>sendfile</servlet-name> <servlet-class>[Link]</servlet-class> </servlet> <servlet> <servlet-name>dhtml</servlet-name> <servlet-class>[Link]</servlet-class> </servlet> <servlet> <servlet-name>help</servlet-name> <servlet-class>[Link]</servlet-class> </servlet> <servlet-mapping> <servlet-name>jrserver</servlet-name> <url-pattern>/jrserver/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>sendfile</servlet-name> <url-pattern>/sendfile/*</url-pattern>

</servlet-mapping> <servlet-mapping> <servlet-name>dhtml</servlet-name> <url-pattern>/dhtml/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>help</servlet-name> <url-pattern>/help/*</url-pattern> </servlet-mapping> </web-app>

4. Create a directory lib in the jreport/WEB-INF directory: mkdir lib 5. Create a directory pages in the jreport/WEB-INF/lib directory: mkdir lib/pages 6. Copy all of the files in /opt/JReport/Server/lib/pages to the jreport/WEB-INF/lib/pages directory: cp /opt/JReport/Server/lib/pages/* lib/pages 7. Create a jar file to include the resources folder which is located in /opt/JReport/Server and name it [Link]. For example, run the following command: jar -cvf [Link] resources Then put the [Link] in /opt/JReport/Server/lib. 8. Copy the following jar files from /opt/JReport/Server/lib to the jreport/WEB-INF/lib directory: [Link], jai_codec.jar, jai_core.jar, [Link], [Link], [Link], [Link], [Link], [Link], [Link], [Link], [Link]. If you want to export reports to the following formats, you should copy the corresponding jar to the jreport/WEB-INF/lib directory:
r

To e-mail or use the e-mail Notification function, copy [Link] and [Link]. To FTP, copy [Link]. To PDF and DHTML, copy itext_1.[Link]. To Excel, copy poiHSSF_151.jar.

9. Copy the [Link] file and the admin, dhtmljsp, images, javascript, jinfonet, skin, and style folders from / opt/JReport/Server/public_html to the /opt/JReport/Server/jreport directory: cp -r /opt/JReport/Server/public_html/* /opt/JReport/Server/jreport Notes:
r

The jsp files within the admin folder are used by the JReport Administration pages. Those within the dhtmljsp folder are used when viewing reports in the DHTML format. If you copy [Link] and these folders mentioned above to a sub folder in /opt/JReport/Server/ jreport, for example, /opt/JReport/Server/jreport/sub, to view reports in DHTML format, you need:
s

Modify the [Link] file:

[Link]=/jreport/sub/skin
s

Uncomment the following lines in [Link] in the dhtmljsp folder and make it adapt to the environment as follows: [Link](SessionID,"[Link] [Link](SessionID,"/jreport/sub/dhtmljsp/"); [Link](SessionID, RptSetId, "/jreport/dhtml");

In the step 10, edit the [Link] file like this: <FRAME name="ind" src="/jreport/sub/jinfonet/[Link]" frameborder="0">

Then go to step 11. 10. Edit the [Link] file and add the context path /jreport to the src tag. Note that the path separator character is the Unix style "/" when referencing JSP. The result should be as follows: <FRAME name="ind" src="/jreport/jinfonet/[Link]" frameborder="0"> 11. Using the following command to create a WAR file named [Link]: jar -cvf [Link] [Link] admin dhtmljsp images javascript jinfonet skin style WEB-INF Note: The jar utility is in the Java home bin directory. If it is not on your path you must call jar with the entire path, for example, /opt/jdk1.6.0_17/bin/[Link].

To make the WAR be a self-contained solution


To make the WAR include a self-contained JReport Server, except for the above procedure, you need create jrenv. jar and then put it in the jreport/WEB-INF/lib directory before creating the WAR. Use either way to create the [Link]:
q

By the [Link]/[Link] tool For example: run the command makewar [Link] Creating manually Make sure all necessary contents are included and then use a proper tool to package them into a jar file.

See also Building a WAR/EAR file to include a self-contained JReport Server for details about the structure of the [Link].

Four ways of integrating JReport Server


You can either create a JReport Server WAR/EAR, or create your WAR/EAR and embed a self-contained JReport Server inside it. The following are four ways of building a WAR/EAR file in order to include a self-contained JReport Server:
q

Integrating by building a JReport Server WAR Integrating by building a JReport Server EAR Integrating by building a user WAR and embedding a self-contained JReport Server Integrating by building a user EAR and embedding a self-contained JReport Server

Integrating by building a JReport Server WAR


The self-contained JReport Server can be deployed as a single WAR file. After specifying the reporthome and configuring the database information, you can build the WAR file using the tool [Link]/[Link] in <install_root>\bin. To generate the WAR file, execute the command with the buildWar parameter. For example: [Link]/[Link] buildWar

Structure of the JReport Server WAR


For example, here you can create a JReport Server WAR file named [Link]. The structure of the JReport Server WAR is as below: [Link] WEB-INF/ [Link] lib/ -- This folder contains all resources in the JReport Server library. admin/ -- This folder contains JSP files for the JReport Administration page. jinfonet/ -- This folder contains JSP files for the JReport Console page. dhtmljsp/ --This folder contains JSP files for viewing DHTML reports.

WEB-INF/[Link]
The following is the default content in the [Link] file of the JReport Server WAR: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "[Link] <web-app> <listener> <listener-class>[Link]</listener-class> </listener> <servlet> <servlet-name>jrserver</servlet-name> <servlet-class>[Link]</servlet-class> </servlet> <servlet> <servlet-name>sendfile</servlet-name> <servlet-class>[Link]</servlet-class> </servlet> <servlet> <servlet-name>dhtml</servlet-name> <servlet-class>[Link]</servlet-class>

</servlet> <servlet> <servlet-name>help</servlet-name> <servlet-class>[Link]</servlet-class> </servlet> <servlet-mapping> <servlet-name>jrserver</servlet-name> <url-pattern>/jrserver/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>sendfile</servlet-name> <url-pattern>/sendfile/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>dhtml</servlet-name> <url-pattern>/dhtml/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>help</servlet-name> <url-pattern>/help/*</url-pattern> </servlet-mapping> </web-app>

Integrating by building a JReport Server EAR


The self-contained JReport Server can be deployed as a single EAR file. After specifying the reporthome and configuring the database information, you can build the EAR file using the tool [Link]/ [Link] in <install_root>\bin. To generate the EAR file, execute the command with the buildEar parameter, for example: [Link]/[Link] buildEar

Structure of the JReport Server EAR


For example, here you can create a JReport Server EAR file named [Link]. The structure of the JReport Server EAR is as below: [Link] META-INF/[Link] jreport-lib/ -- This folder contains all resources in the JReport Server library. [Link] META-INF/[Link] WEB-INF/[Link] admin/ jinfonet/ dhtmljsp/

META-INF/[Link]
Following the Java EE standard, you should configure the META-INF/[Link] file before deploying the EAR: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "[Link] <application> <display-name>Self-contained JReport Server</display-name> <module id="JReportWebModule"> <web> <web-uri>[Link]</web-uri> <context-root>jreport</context-root> </web> </module> </application>

META-INF/[Link] of Web module


Since the JReport Server library is included in jreport-lib of the EAR layer, you must specify Class-Path in the META-INF/[Link] file. The contents below should be included in the [Link] file: Class-Path: jreport-lib/[Link] jreport-lib/[Link] jreport-lib/JREngine. jar ... Class-Path is a list of all packages in the JReport Server library. Each package name should start with the prefix jreport-lib/, and you should use a blank space to separate package names.

WEB-INF/[Link] of Web module


The contents in the [Link] of the JReport Server EAR are the same as the contents in [Link] of the JReport Server WAR. See the section Integrating by building a JReport Server WAR for details.

Integrating by building a user WAR and embedding a self-contained JReport Server


You can embed a self-contained JReport Server into your WAR.

Structure of the user WAR


For example, here you can create a WAR named [Link], and then embed a self-contained JReport Server inside it. The structure of your WAR may be as follows: [Link] WEB-INF/ [Link] lib/ -- This folder contains all resources in the JReport Server library and your other jar files. classes/ -- This folder contains your servlet classes. ../../asset/images/ jsp/ If you put the JReport WAR related JSPs to a sub folder, for example, jreport, and this time the structure of your WAR may be as follows: [Link] WEB-INF/ [Link] lib/ -- This folder contains all resources in the JReport Server library and your other jar files. classes/ -- This folder contains your servlet classes. ../../asset/images/ jreport/ admin/ dhtmljsp/ jinfonet/ ... To run JReport reports, you must do the following configurations:
q

Add the following entry into [Link]: <context-param> <param-name>autoDetectServletPath</param-name> <param-value>false</param-value>

</context-param>

WEB-INF/[Link] in the user WAR


You should add listener into the [Link] as follows: <listener> <listener-class>[Link]</listener-class> </listener>

Integrating by building a user EAR and embedding a self-contained JReport Server


You can embed a self-contained JReport Server into your EAR in order to use JReport Server from EJB.

Structure of the user EAR


For example, here you can create an EAR named [Link] and then embed a self-contained JReport Server inside it. In the EAR, there is an EJB module used for initializing JReport Server. The structure of your EAR may be as follows: [Link] META-INF/[Link] jreport-lib/ -- This folder contains all resources in the JReport Server library [Link] META-INF/ [Link] [Link] com/

META-INF/[Link]
Following the Java EE standard, you should configure the META-INF/[Link] file before deploying your EAR: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "[Link] <application> <display-name>EJB with Embedded JReport Server</display-name> <module id="MyEJBModule"> <ejb>[Link]</ejb> </module> </application>

META-INF/[Link] of EJB module


Since the JReport Server library is included in the jreport-lib folder of the EAR layer, you must specify Class-Path in the META-INF/[Link] file. The contents below should be included in the MANIFEST. MF file: Class-Path: jreport-lib/[Link] jreport-lib/[Link] jreport-lib/JREngine. jar ... Class-Path is a list of all packages in the JReport Server library. Each package name should start with

the prefix jreport-lib/, and you should use a blank space to separate package names.

META-INF/[Link]
If you do not want to set the reporthome for the embedded self-contained JReport Server, but instead want to use JReport's default settings, there is no requirement for configuring the [Link]. However, if you want to control the reporthome of the JReport Server, or specify a JNDI data source for JReport Server to use, you should first configure the [Link] file using the <env-entry></enventry> tags. Here is an example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "[Link] <ejb-jar id="ejb-jar_ID"> <display-name>MyEJB</display-name> <enterprise-beans> <session id="JReportEJB"> <ejb-name>JRptServer</ejb-name> <home>[Link]</home> <remote>[Link]</remote> <ejb-class>[Link]</ejb-class> <session-type>Stateless</session-type> <!-- Specify JReport reporthome directly <env-entry> <env-entry-name>[Link]</env-entry-name> <env-entry-value>/home/jreport</env-entry-value> <env-entry-type>[Link]</env-entry-type> </env-entry> --> <!-- JReport callback my CustomizedServerEnv --> <env-entry> <env-entry-name>[Link]</env-entry-name> <env-entry-value>[Link]</env-entry-value> <env-entry-type>[Link]</env-entry-type> </env-entry> <transaction-type>Bean</transaction-type> </session> </enterprise-beans> </ejb-jar>

Deploying JReport Server to a Java application server


After you have created a WAR/EAR file that includes a self-contained JReport Server, you can deploy the WAR/EAR to an application server following the deploying instructions of the application server. This section provides examples of deploying JReport Server to several leading Java EE application servers. The instructions are applicable to Unix, z/Linux and Windows platforms. However, the paths for Windows should use the Windows format, for example, C:\JReport\Server, while paths for Unix and z/Linux should use the Unix and z/Linux format, for example, /opt/JReport/Server. Before going on to the next sections, you should already have reviewed Building a WAR/EAR file to include a self-contained JReport Server. The following examples are based on the Unix platform with one exception of Sun Application Server on Windows:
q

Deploying to IBM WebSphere 7 Deploying to WebLogic 11g Release 1 (10.3.2) Deploying to Tomcat 6 Deploying to JBoss 5.0.1 Deploying to OC4J 10g R3 ([Link].0) Deploying to Sun Java System Application Server Platform Edition 9.1 Deploying to GlassFish V3

Note: It is supported if you change the location of the two folders, skin and dhtmljsp, which are in the \public_html directory in the application server side. What is need is creating a file [Link] in the \WEB-INF directory and then adding the following two properties and providing the correct paths (the context root is excluded): [Link] web.dhtml_jsp_path

Deploying to IBM WebSphere 7


The example directory paths listed below are based on Solaris or Linux (referred to as Unix). The instructions are applicable to both Unix and Windows installations; however, the format of the paths for Windows would use the Windows format, i.e. C:\JReport\Server instead of /opt/JReport/Server. It is assumed that:
q

WebSphere 7 is installed in the /opt/IBM/WebSphere7/AppServer directory. The JReport Server WAR file [Link] is located in the /opt/JReport/Server/bin/distribute directory. To create the WAR file, refer to the instructions in Building a WAR/EAR file to include a selfcontained JReport Server.

To deploy JReport Server to IBM WebSphere: 1. Copy Derby jars in /opt/JReport/Server/derby to the /opt/IBM/WebSphere7/AppServer/lib directory. 2. Start IBM WebSphere. Use the shell script /opt/IBM/WebSphere7/AppServer/bin/startServer. sh <servername> to start the server. The default server name is server1. 3. Access the WebSphere Administrative Console by using the URL: [Link] console, where the hostname is host name or IP address, and 9060 is the port number. 4. The login requires user name and password. 5. After successfully log in, expand the Applications node, select Application Types and then Websphere enterprise applications. 6. Click Install. 7. Click Browse to select the [Link] file, and then click Next. 8. Keep clicking Next until you see the requirement for specifying context root. 9. In the Context Root field, type a context path such as /jreport/, then click Next. 10. Click Finish on the Summary page. The installing process may take several minutes, wait until the process is completed. 11. Click Save. 12. Select [Link] and then click Start to start JReport Server. 13. Access JReport Server using the following URL: [Link] [Link] [Link]

Troubleshooting

If you run into problems when using JReport Server in IBM WebSphere, send the log files of JReport Server to support@[Link]. The following procedure illustrates how to generate the log files: 1. Type -Dlogall=true in the Generic JVM arguments field. Go to Application servers > server1 > Process Definition > Java Virtual Machine to access this field. 2. Restart the application server, and try to reproduce the problem. After reproducing the problem, send support@[Link] the log files in reporthome/logs. The WebSphere log files may also help to identify the problem. The most useful one is in /opt/ IBM/WebSphere7/AppServer/profiles/AppSrv01/logs/server1/[Link].

Deploying to WebLogic 11g Release 1 (10.3.2)


The example directory paths listed below are based on Solaris or Linux (referred to as Unix). The instructions are applicable to both Unix and Windows installations; however, the format of the paths for Windows would use the Windows format, i.e. C:\JReport\Server instead of /opt/JReport/Server. It is assumed that:
q

WebLogic 11g Release 1 (10.3.2) is installed in the /opt/bea directory. This is referred to as BEA_HOME in the WebLogic documentation. The JReport Server WAR file [Link] is located in the /opt/JReport/Server/bin/distribute directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a selfcontained JReport Server.

To deploy JReport Server to BEA WebLogic: 1. If you have not already created a WebLogic Domain for JReport Server you must create one before starting the integration. 2. Start WebLogic by running [Link] in /opt/bea/user_projects/domains/domain_name/ bin. 3. Access the WebLogic Administrative Console by using URL [Link] where the hostname is host name or IP address, and 7001 is the port number. 4. After your successful login, in the Domain Structure panel on the left, click Deployments node. 5. In the Summary of Deployments panel, click Install. 6. In the Install Application Assistant panel, click the upload your file(s) link. 7. In the Deployment Archive section, click Browse to select the [Link] file in C:\JReport \Server\bin\distribute, and then click Next. 8. Keep clicking Next until the Finish button is enabled, and then click Finish. 9. Start JReport Server and then access it using the following URL: [Link]

Troubleshooting
If you run into problems when using JReport Server in BEA WebLogic, send the log files of JReport Server to support@[Link]. The following procedure illustrates how to generate the log files: 1. Add -Dlogall=true on the same line as -Dreporthome in the [Link] shell script. 2. Restart the application server, and then try to reproduce the problem. After reproducing the problem, send support@[Link] the log files in reporthome/logs. The WebLogic log file may also help to identify the problem. It is /opt/bea/user_projects/

domains/domain_name/logs.

Deploying to Tomcat 6
The example directory paths listed below are based on Solaris or Linux (referred to as Unix). The instructions are applicable to both Unix and Windows installations; however, the format of the paths for Windows would use the Windows format, i.e. C:\JReport\Server instead of /opt/JReport/Server. It is assumed that:
q

Tomcat 6 is installed in the /opt/apache-tomcat-6 directory. The JReport Server WAR file [Link] is located in the /opt/JReport/Server/bin/distribute directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a selfcontained JReport Server.

To deploy JReport Server to Tomcat 6: 1. Ensure that Tomcat is shut down. 2. Copy the Web Application Archive [Link] to /opt/apache-tomcat-6/webapps. 3. Start Tomcat by running the [Link] script. 4. Access JReport Server using the following URLs: [Link] [Link] [Link]

Troubleshooting
If you run into problems when using JReport Server in Tomcat, send the log files of JReport Server to support@[Link]. The following procedure illustrates how to generate the log files: 1. Modify the [Link] file in /opt/apache-tomcat-6/bin. In the file [Link], add -Dlogall=true after the reporthome definition: "$JAVA" $JAVA_OPTS \-classpath "$JBOSS_CLASSPATH" -Dreporthome=/opt/JReport/Server\-Dlogall=true\ [Link] "$@"

2. After editing [Link], start Tomcat. 3. To get the information about the JReport Server environment, you can access http:// localhost:8080/jreport/admin/[Link]?cmd=info. 4. Save the output to a file. 5. After reproducing the problem, send support@[Link] the log files in reporthome/logs.

The Tomcat log files may also help to identify the problem. The most useful one is /opt/apachetomcat-6/logs/[Link].

Deploying to JBoss 5.0.1


The example directory paths listed below are based on Solaris or Linux (referred to as Unix). The instructions are applicable to both Unix and Windows installations; however, the format of the paths for Windows would use the Windows format, i.e. C:\JReport\Server instead of /opt/JReport/Server. It is assumed that:
q

JBoss 5.0.1 is installed in the /opt/jboss directory. The JReport Server WAR file [Link] is located in the /opt/JReport/Server/bin/distribute directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a selfcontained JReport Server.

To deploy JReport Server to JBoss 5.0.1: 1. Ensure that JBoss is shut down by running the script /opt/jboss/bin/[Link] -S. 2. Remove the two files [Link] and [Link] from [Link] since they conflict with JBoss. They are located in [Link]\WEB-INF\lib. 3. Copy [Link] to /opt/jboss/server/default/deploy. 4. Start JBoss by running the [Link] script. 5. Access JReport Server using the following URLs: [Link] [Link] [Link]

Troubleshooting
If you run into problems when using JReport Server in JBoss, send the log files of JReport Server to support@[Link]. The following procedure illustrates how to generate the log files: 1. Modify the file [Link] in /opt/jboss/bin. In the file [Link], add -Dlogall=true after the reporthome definition: "$JAVA" $JAVA_OPTS \ -classpath "$JBOSS_CLASSPATH" -Dreporthome=/opt/JReport/Server \ -Dlogall=true \ [Link] "$@"

2. After editing [Link], start JBoss using the modified file. 3. After reproducing the problem, send support@[Link] the log files in reporthome/logs. The JBoss log files may also help to identify the problem. The most useful one is /opt/jboss/

server/default/log/[Link].

Deploying to OC4J 10g R3 ([Link].0)


It is assumed that the JReport Server WAR file [Link] is located in the /opt/JReport/Server/bin/ distribute directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a self-contained JReport Server. To deploy JReport Server to OC4J 10g R3 ([Link].0): 1. Start OC4J. 2. On the Applications tab, click Deploy. 3. In the Archive Location section, click Browse to select the [Link] file in /opt/JReport/ Server/bin/distribute. Then click Next. 4. Type JRServer in the Application Name field, and type a context path such as /jreport in the Context Root field. Then click Next. 5. Click Deploy to deploy the WAR. 6. Access JReport Server using the following URLs: [Link] [Link] [Link]

Troubleshooting
If you run into problems when using JReport Server in the Oracle oc4j Application Server, send the log files of JReport Server to support@[Link]. The following procedure illustrates how to generate the log files: 1. Type -Dlogall=true in oc4j located in /oc4jhome/bin. 2. Restart OC4J, and then try to reproduce the problem. 3. After reproducing the problem, send support@[Link] the log files in reporthome/logs.

Deploying to Sun Java System Application Server Platform Edition 9.1


The example directory paths listed below are based on Windows. The instructions are applicable to both Unix and Windows installations; however, the format of the paths for Unix would use the Unix format, i. e. /opt/JReport/Server instead of C:\JReport\Server. It is assumed that:
q

Sun Java System Application Server Platform Edition 9.1 is installed in the C:\Sun\AppServer directory. It is assumed that the JReport Server WAR file [Link] is located in the C:\JReport\Server\bin \distribute directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a self-contained JReport Server.

To deploy JReport Server to Sun Java System Application Server Platform Edition 9.1: 1. Upgrade Sun Application Server's Derby jars by using the lib folder in C:\JReport\Server\derby to replace the lib folder in C:\Sun\AppServer\javadb\lib. 2. Start the Sun Application Server by selecting Start > Programs > Sun Microsystems > Application Server PE > Start Default Server. 3. Launch the Admin Console by selecting Start > Programs > Sun Microsystems > Application Server PE > Admin Console. 4. In the left console tree, expand the Applications node, then click Web Applications. 5. In the Web Applications page, click Deploy. 6. Click Browse to select the WAR file [Link]. Then click Next. 7. Use the default settings and click OK. You will find a new application jreport is listed. 8. Access JReport Server using the following URLs: [Link] [Link] [Link]

Troubleshooting
If you run into some problems when using the Sun Application Server, send the log files of JReport Server to support@[Link]. The following procedure illustrates how to generate the log files: 1. Start the Sun Application Server, and then launch the Admin Console. 2. In the console tree, click Application Server. 3. Go to the JVM Settings tab, and then click JVM Options. 4. In the JVM Option field, click Add JVM Option, and then type -Dlogall=true.

5. Click Save to save your changes. 6. Restart Sun Application Server and try to reproduce the problem. 7. After reproducing the problem, send support@[Link] the log files in reporthome/logs.

Deploying to GlassFish V3
The example directory paths listed below are based on Solaris or Linux (referred to as Unix). The instructions are applicable to both Unix and Windows installations; however, the format of the paths for Windows would use the Windows format, i.e. C:\JReport\Server instead of /opt/JReport/Server. It is assumed that the JReport Server WAR file [Link] is located in the /opt/JReport/Server/bin/ distribute directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a self-contained JReport Server. To deploy JReport Server to GlassFish V3: 1. Start the GlassFish in the default domain1 and then launch the Admin Console. 2. Click the Deployment node on the left. 3. Click Deploy on the displayed page. 4. Click Choose File to select the WAR file [Link]. 5. Leave Application Name and Context Root as jreport and jreport. Then click OK. 6. Expand the Deployment node on the left and you will see a new node named jreport. Click jreport and then on the displayed page click Save. 7. In the console tree, click Configuration. Go to the JVM Settings tab, and then click JVM Options. In the JVM Options section, click Add JVM Option, and then type -[Link]=true. Click Save to save your changes. You need not add this JVM option if you are using Windows. 8. Restart GlassFish, and then start the application jreport. 9. Access JReport Server using the following URLs: [Link] [Link] [Link]

Troubleshooting
If you run into some problems when using the GlassFish V3, send the log files of JReport Server to support@[Link]. The following procedure illustrates how to generate the log files: 1. Start the GlassFish in the default domain1 and then launch the Admin Console. 2. In the console tree, click Configuration. 3. Go to the JVM Settings tab, and then click JVM Options. 4. In the JVM Options section, click Add JVM Option, and then type -Dlogall=true. Click Save to save your changes. 5. Restart GlassFish and try to reproduce the problem.

6. After reproducing the problem, send support@[Link] the log files in reporthome/logs. The GlassFish log file may also help to identify the problem. It is /opt/glassfish/domains/domain1/ logs/[Link].

Integrating remote JReport Server


Normally, JReport servlets are only integrated with other applications on the same machine. However, you can now implement JReport Remote Server API in your JSPs, and integrate the JSPs with the application server to call JReport Server, which is running on a different machine. Notes:
q

In a remote integration environment, the options for publishing resources are hidden since they are not supported by JReport JSPs. If you want to publish reports or catalogs to JReport Server, use one of the following ways:
r

Access the JReport Server (not the remote server) Administration page with 8889 as the default port to perform publish work. Copy the report or catalog files to the computer where JReport Server (not the remote server) is located, and then call the RMI API to publish them. Publish the report or catalog files from JReport Designer to the JReport Server. In a remote integration environment, running reports to the Applet format is not supported.

In a remote integration environment, the two tabs Monitor and Data are hidden on JReport Administration page since they are not supported. You can change the location of the two folders, skin and dhtmljsp, in the \public_html directory in the application server side. What is required is to create a file [Link] in the \WEB-INF directory and then add the following two properties and provide the correct paths (the context root is excluded): [Link] web.dhtml_jsp_path

See the following cases:


q

Integrating remote JReport Server with IBM WebSphere 7 by a WAR file Integrating remote JReport Server with WebLogic 11g Release 1 (10.3.2) by a WAR file

Related Topics:
q

Overall Remote Server APIs & unified JSPs

Integrating remote JReport Server with IBM WebSphere 7 by a WAR file


Here is an example illustrating the case of using JSPs based on Remote Server APIs to integrate with IBM WebSphere 7. It is assumed that:
q

WebSphere 7 is installed in C:\WebSphere in computer A. JReport Server is installed in C:\JReport\Server in computer B. The computer IP is [Link].

Take the following steps to integrate remote JReport Server with IBM WebSphere: 1. Generate a WAR file. 2. Configure JReport Server. 3. Deploy the WAR file. Below show the details for each step:

Generating the WAR file


1. In computer B, use the tool [Link] to build the JReport Server WAR file as defined by [Link] for remote integration. Both [Link] and [Link] are located in C: \JReport\Server\bin. Run the following commands in DOS window and the generated WAR file [Link] will be saved to the directory C:\JReport\Server\bin\distribute. [Link] buildRemoteWar -[Link]=[Link] -[Link]=1129 [Link].auth_file=C:\JReport\Server\bin\[Link] 2. Copy the [Link] file from C:\JReport\Server\bin in computer B to C:\JReport\Server\bin in computer A.

Configuring JReport Server


1. Make sure JReport Server has been started once in order that the [Link] file is generated. 2. Change [Link] file in C:\JReport\Server\bin as follows: [Link]=true [Link]=true (This is required only when you have included the admin JSP pages from C:\JReport\Server\bin\public_html\admin and are going to use the administration service.)

Deploying the WAR file


1. In computer A, start IBM WebSphere.

2. In computer B, access the WebSphere Administrative Console by using the URL: https:// hostname:9046/ibm/console, where the hostname is computer A's host name or IP address, and 9046 is the port number. 3. After successfully log in, expand the Applications node, select Application Types and then Websphere enterprise applications. 4. Click Install. 5. Click Browse to select the [Link] file, and then click Next. 6. Keep clicking Next until you see the requirement for specifying context root. 7. In the Context Root field, type a context path such as /remote/, then click Next. 8. Click Finish on the Summary page. The installing process may take several minutes, wait until the process is completed. 9. Click Save. 10. Select [Link] and then click Start. 11. Access JReport Server using the following URL: [Link] Here the hostname is computer A's host name or IP address.

Integrating remote JReport Server with WebLogic 11g Release 1 (10.3.2) by a WAR file
Here is an example illustrating the case of using JSPs based on Remote Server APIs to integrate with WebLogic 11g Release 1 (10.3.2). It is assumed that:
q

WebLogic is installed in C:\bea in computer A. JReport Server is installed in C:\JReport\Server in computer B. The computer IP is [Link].

Take the following steps to integrate remote JReport Server with WebLogic: 1. Generate a WAR file. 2. Configure JReport Server. 3. Deploy the WAR file. Below show the details of each step:

Generating a WAR file


1. In computer B, use the tool [Link] to build the JReport Server WAR file as defined by [Link] for remote integration. Both [Link] and [Link] are located in C: \JReport\Server\bin. Run the following commands in DOS window and the generated WAR file [Link] will be saved to the directory C:\JReport\Server\bin\distribute. [Link] buildRemoteWar -[Link]=[Link] -[Link]=1129 [Link].auth_file=C:\JReport\Server\bin\[Link] 2. Copy the [Link] file from C:\JReport\Server\bin in computer B to C:\JReport\Server\bin in computer A.

Configuring JReport Server


1. Make sure JReport Server has been started once in order that the [Link] file is generated. 2. Change [Link] file in C:\JReport\Server\bin as follows: [Link]=true [Link]=true (This is required only when you have included the admin JSP pages from C:\JReport\Server\bin\public_html\admin and are going to use the administration service.)

Deploying the WAR file

1. If you have not already created a WebLogic Domain for JReport Server you must create one before starting the integration. 2. In computer A, start WebLogic by running [Link] in C:\bea\user_projects\domains \domain_name\bin. 3. In computer B, access the WebLogic Administrative Console by using URL [Link] console/, where the hostname is computer A's host name or IP address, and 7001 is the port number. 4. After your successful login, in the Domain Structure panel on the left, click Deployments node. 5. In the Summary of Deployments panel, click Install. 6. In the Install Application Assistant panel, click the upload your file(s) link. 7. In the Deployment Archive section, click Browse to select the [Link] file in C:\JReport \Server\bin\distribute, and then click Next. 8. Keep clicking Next until the Finish button is enabled, and then click Finish. 9. Start JReport Server in computer B. Then go to computer A and access JReport Server using the following URL: [Link]

Clustering
A JReport Server cluster is a distributed cluster in which a group of servers work together to provide cluster-wide shared resources, security, schedules and version services. In a JReport Server cluster, all clustered servers play exactly the same role. You can add a new server to the existing cluster or shut down a server from the cluster any time. This chapter shows you the infrastructure of the JReport Server cluster, what features it owns, how to set it up, and how to manage it. The following topics are covered:
q

Cluster overview JReport Server cluster main features Setting up and starting a JReport Server cluster Managing JReport Server clusters Dispatching RMI Server Pages requests in multiple server environment

Note: A JReport Server cluster license is required in order to use this feature. If you do not have a cluster license please contact your Jinfonet Software account manager to obtain a license.

Cluster overview
There are many nodes (clustered servers) that play the same role in a JReport Server cluster. The following is a diagram of the JReport Server cluster infrastructure:

Every clustered server in this distributed cluster has the same responsibility. You can set each clustered server in a JReport Server cluster by configuring its properties. The following list shows all the tasks each clustered server in the server cluster can complete.
Business tasks Run Reports Clustered Server Y Submit Scheduled Tasks Y LoadBalancing Y Failover Y Administrative tasks LoadBalancing Administration Y Security Administration Y Resource Administration Y

Related topics:
q

JReport Server cluster

JReport Server cluster main features


This section describes the main features of the JReport Server cluster. Some of these features are also available through the API. With these features in mind, you will be better able to understand JReport Server clusters and easily use them.

Administering security and resources


In a distributed cluster, you can accomplish all administrative tasks from any single node. After logging onto the cluster from a clustered server as an administrator, certain security administrative tasks can be performed:
q

Create, remove and edit users, groups, realms, protections and ACLs. Edit resource nodes and sub resource nodes. Add reachable virtual resource nodes. Customize the default page appearance for users.

Load balancing
As for scheduled tasks in a cluster environment, JReport Server provides a load balancing mechanism which enables the server to work more effectively. Every clustered server has a scheduler, and among the schedulers those with a lease are active schedulers. When the time of a scheduled task arrives, active schedulers compete and the winner gets to trigger the schedule. When dispatching tasks, the server which has the active scheduler will select a server according to load balancing algorithm and allocate the task to it. Here are the benefits of deploying load balancing in a JReport Server cluster.
q

Automatically allocates tasks to suitable servers according to their current load and performance. Makes sure that all of the servers in the cluster are fully utilized. Automatically re-balances the network load when one server is added or removed.

Cluster Scheduler Lease


By default, in a JReport Server cluster all nodes of the cluster compete to become the active scheduler when the time of a scheduled task arrives. If the scheduled task has been bound with a trigger, then the node who gets the trigger becomes the active scheduler. The active scheduler for the task will then determine the server that will be asked to run the scheduled report based on load balancing. The Cluster Scheduler Lease option allows you to limit the number of servers competing for each scheduled report by setting a Cluster Scheduler Lease Active Count. As long as the count is less than the total number of nodes in the cluster, only the nodes holding a lease will compete to become the scheduler for the report that is ready to run. Depending on the number of scheduled reports you have, you may find that setting the Lease Active Count to 1 or 2 will provide more overall throughput on the system so the other nodes never have to be concerned about scheduled tasks.

There are two additional parameters that can be set:


q

Cluster Scheduler Lease Valid Time will set the amount of time that the lease holder will continue to compete for scheduled tasks to run. The default value is 300 seconds. Cluster Schedule Lease Check Interval will set the amount of time between when other non-lease nodes will check to see if a lease is available to pick up. The default value is 30 seconds, i.e. every 30 seconds all the other nodes will check to see if one of the lease semaphores is available to take. The number of semaphores is set by the Cluster Scheduler Lease Active Count.

Load detection
There is a JReport Server residing in each node of a JReport Server cluster. The main factor that affects load balancing is the number of concurrent reports that are running on every JReport Server. In order to avoid heavy load, every member server in the cluster has been enabled to send the number of concurrently running reports on it to the other cluster nodes.

Built-in load balancing algorithms


JReport Server Cluster supports several algorithms for load balancing clustered servers. Configurable algorithms for load balancing clustered servers are:
q

Min-load ([Link]=0) The server that has the active scheduler will select the server which has the least number of currently running reports. If the local server is one of the qualified servers, it will be given higher priority. Road Robin ([Link]=1) The server that has the active scheduler will select each server in sequence one by one until each has been allocated a report to run then will repeat the cycle. This is the default setting. Weighted Min-load ([Link]=2) The server that has the active scheduler will select the server that has the least weighted current reports. If the local server is one of the qualified servers, it will be given higher priority.
Number of currently running reports Weighted current reports= Performance Weight

Performance weight is a positive floating point number that you set to each server in a cluster on any clustered server. Use Admin Console > Cluster > Weight panel and measure the performance of a typical report on each node of the cluster. The higher performance weight you set to a clustered server, the higher chance it may get selected by the server that holds the active scheduler during load balancing. See Configuring performance weight for how to set performance weight and how this algorithm works. If you do not set performance weight, by default the algorithm will work the same as Round Robin.
q

Random ([Link]=3) The server that holds the active scheduler will select the server randomly.

Failover

You can check the status of the clustered servers on JReport Server Monitor and notice the failure of any member server. If a member server is down, JReport cluster will remove it from the active clustered server list.

Member server failure


Effect on load balancing When JReport cluster detects a failed member server, it will remove the member server from the active server list and will not schedule reporting tasks to that server any more. Load balancing will proceed on the remaining active servers. Effect on incomplete tasks When JReport cluster detects a failed clustered server, it will check the shared table for the list of incomplete tasks and will then reassign all incomplete tasks to other active servers using the load balancer. Effect on completed tasks JReport supports only report level recovery but not session level recovery. Once a report task is completed, it will be written to temporary storage for redirection to the requester. Failure after that will not be recovered.

Notifying of server down


If you have enabled the notifying of server down feature, when a member server crashes or is disconnected with the cluster, JReport cluster will send a notification e-mail to a specified address.

Distributed storage
In pure distributed cluster the resource files are no longer stored in a central place. They might be stored on any node in the cluster. You can set how many copies would be made in the cluster. Then if you need to access the files from another node, JReport cluster will copy them to the node from where it is stored. As a result, you can access your required files from anywhere in the cluster. If the copy number is 0, then it means every node of the cluster will get a copy. Here are the resources that can be stored on any single node of the cluster:
q

Temp Directory When viewing reports from any server in a JReport Server cluster, some temporary files will be generated. All temporary files are saved in the temp directory. History Directory When publishing reports to the versioning system from any server in a JReport Server cluster, all the result files are saved in the history directory. Realm Directory On each clustered server, the realm related files are saved in the realm directory. CRD result files On each clustered server, the CRD result files are stored in the cached CRD result folder.

Setting up and starting a JReport Server cluster


This section introduces the steps for setting up a JReport Server cluster and starting it. Here, it is assumed that you already have a general idea about the infrastructure of JReport Server clusters and know the functions of the clustered servers. If this isn't the case, see Cluster overview and JReport Server cluster. Following are steps and examples for how to set up and start a JReport Server cluster:
q

Preparation Setting up and configuring a JReport Server cluster Starting a JReport Server cluster Example 1: Setting up a simple JReport Server cluster Example 2: Setting up a JReport Server cluster for a production environment

Preparation
To set up a JReport Server cluster, you must determine the following factors:
q

What is a JReport cluster? JReport cluster is based on JGroups and is a distributed cluster. All clustered servers in JReport cluster play the same role. You can add a new server to the existing cluster or shut down a server from the cluster any time.

How many servers will be included in the cluster? The maximum number of servers is unlimited as long as you install JReport Server with the license key for cluster. Based on your expected load and protection from system failures you can create 2 or more nodes for your cluster. Often with multi-cpu and multi-core systems you will get better overall throughput having several nodes on a single server. Only by testing in your environment will you be able to find the number of nodes to give you the highest performance. Too few and resources will be under utilized and too many will cause thrashing and lower throughput.

Whether to use the distributed storage feature in the cluster? In a distributed cluster the files may be stored on any node in the cluster. You can set how many copies will be made in the cluster and if you need to access the files from another node, JReport cluster will copy them to this node from the node it is stored on. As a result, you can access your required files from anywhere in the cluster. If the copy number is 0, then it means every node of the cluster will get a copy. The tradeoff is overall system performance versus individual user performance when a user requests a report result. If you set Number of Copies to 0, the system will copy every resource file to every node, slowing overall throughput considerably. However, setting Number of Copies to 1 will keep a single copy just on the node where it was created which provides maximum system throughput but when a user requests a resource which is not on his node he then needs to wait for it to be copied before he can view it. If the node goes down though then the resource is unreachable. A setting of 2 is the default which allows for failover if a node goes down but just does a single copy.

Whether to use the default Derby DBMS or use your own DBMS? JReport includes the Apache Derby DBMS for the server data such as resources and users, groups and roles and a lot of other information. By default each installed node creates it's own database in <install_root>/derby. In order to use a JReport cluster, all nodes must use the same database. Select one of the nodes to manage the Derby DBMS and ensure that all the other nodes point to this same instance. For an example, review the sample configuration Case 1. Another option to consider is using your own DBMS for the server database. If you already have a reliable DBMS which is already being backed up and provides the reliability you need such as MySQL or Oracle we recommend you change the system DBMS to use your own managed DBMS rather than maintain a separate one for JReport. For information on how to configure JReport to use a different system DBMS, refer to Configure the server database.

Setting up and configuring a JReport Server cluster


Before setting up a JReport Server cluster, first you need to make the time difference between the target computers that will join the cluster as small as possible (the time difference between the target computers should be within one minute), and make sure all servers in the cluster will be set up on the same architecture and operating system. A JReport Server cluster can be set up either during the JReport Server installation or after the servers have been installed using the appropriate license key for cluster.

Creating a JReport Server cluster during installation


It is recommended that you create a JReport Server cluster during the installation of servers. This is the easiest way for you to set up a cluster. To create a JReport Server cluster during installation: 1. Run the JReport Server installation file to install JReport Server with the Installation Wizard. 2. Specifies your User ID. In the License Key text field, use the cluster enabled license key. 3. When choosing the installation type, choose Custom Installation for Standalone Server. Then specify the installation directory for JReport Server. 4. In the Service tab of the Configuration panel, check the Network Address At option and type in the IP address of the server. 5. In the Cluster tab, specify a cluster name in the Cluster Name text field. You can either make the server join an existing cluster or specify a new cluster name to build another cluster. 6. Uncheck the Disable Cluster option. 7. From the Load Balancer Type drop-down list, select the algorithm for load balancing clustered servers. 8. Check the Cluster Scheduler Lease option to enable lease for the cluster, then set the active count, valid time and check interval for the cluster scheduler lease. If you don't enable the lease option, all clustered servers in the cluster will compete for a chance to trigger scheduled tasks which could lower overall system throughput. Read main features for additional information. 9. Specify values for Cluster Storage History Number of Copies, Cluster Storage Realm Number of Copies and Cluster Storage CRD Result Number of Copies. If you are using shared disk resources for any of these directories you should set the value to 1. The default value is 2 which means make one copy plus the original. This allows any one node to go down and the system will still be able to find all resources. If you want to allow 2 simultaneous failures, set the number of copies to 3. 10. Specify the value for Cluster Memory Storage Number of Copies to set how many memory copies will be shared in the cluster 11. Check Notify via E-mail When a Server Is Down if you need to notify somebody via e-mail when a server in the cluster is down, then in the E-mail Address text field, input the e-mail addresses of the people to whom you want to send a notification e-mail.

12. Set the Properties, Realm, Resource, History, and Temporary Directories if necessary. If they are not specified, default directories will be used. 13. Type the IP address or host name of the server in the Server's RMI Host text field, and type the port number in the Server's RMI Port text field. 14. In the Data Source tab, configure the System DB and Realm DB to make sure they point to the database that the server will use. 15. Go on with the installation steps to complete the installation. 16. Install another server you want to join the cluster and repeat the above steps to configure its cluster settings. Since JReport Cluster uses only one server DBMS, you need to make the system database and realm database in the URL text field point to the same DBMS as the previous server. This requires that you replace localhost with the IP address of the first cluster node that you installed: jdbc:derby://localhost:1527/systemtables;create=true; jdbc:derby:// localhost:1527/[Link];create=true.

Creating a JReport Server cluster after installation


After the servers have been installed using the appropriate license key for cluster, you can configure the clustered servers either by using the JReport Administration page or the [Link] and [Link] files.

Using the JReport Administration page


1. Start up the server that hasn't been enabled for cluster. 2. Log onto the JReport Administration page, and click Cluster > Configuration on the system toolbar. 3. In the Cluster Name text field, specify a name for the cluster. You can either make the server join an existing cluster or specify a new cluster name to build another cluster. 4. Check the Enable Cluster option. 5. Click Save to enable the cluster. 6. A cluster member ID will be generated automatically for the server. But if you need to modify it, go to [Link] file located in <install_root>\bin and set the property [Link]. id. 7. Go to the JReport Administration > Data page, configure the databases to make sure they point to the database that the server will use. For details, see Configuring the server database. 8. Restart the server you have enabled with cluster, then log onto the JReport Administration page, go to the Cluster > Configuration panel. 9. From the Load Balancer Type drop-down list, select the algorithm for load balancing clustered servers. 10. To enable lease for the cluster, check the Cluster Scheduler Lease option and set the active count, valid time and check interval of the cluster scheduler lease respectively. 11. Specify values for Cluster Storage History Number of Copies, Cluster Storage Realm Number of

Copies, Cluster Storage CRD Result Number of Copies and Cluster Memory Storage Number of Copies. 12. Check Notify via E-mail When a Server Is Down if you need to notify somebody via e-mail when a server in the cluster is down, then in the E-mail Address text field, input the e-mail addresses of the people to whom you want to send a notification e-mail. 13. Set the Properties, Realm, Resource, History, and Temporary Directories if necessary. If they are not specified, default directories will be used. 14. In the Server's RMI Host text field, type the RMI IP address or host name of the clustered server. 15. In the Server's RMI Port text field, type the RMI port number of the clustered server. 16. Shut down the server. 17. Start up another server you want to join the cluster and repeat the above steps to configure its cluster settings. See also Cluster dialog for details about the cluster configuration options.

Using the [Link] and [Link] files


To set up a JReport Server cluster using the [Link] and [Link] files, you need to modify the [Link] file on each JReport Server. The process uses the following procedures: 1. In the [Link] file located in <install_root>\bin of each server, set the property [Link]=true. 2. Modify [Link] in any server's [Link] file to specify the cluster name. If not specified, it will take jreport-cluster as the default name. 3. In the [Link] file of each clustered server, modify the properties file as follows:
r

[Link]=(integer) Specifies the member ID of the local server. The value of this property should be an integer no less than 1. [Link]=localhost IP address Specifies the RMI IP address or host name of the local server. [Link]=1129 Specifies the RMI port number of the local server.

4. Specify the paths of the directories on the physical disk, such as properties directory, realm directory, resource root, history directory, and temporary files directory. The directories on each clustered server should point to a different physical disk. Add the following properties to the [Link] file:
r

[Link]= Specifies the directories for storing temporary files. [Link]= Specifies the directories for storing all versions of report results in the cluster. [Link]= Specifies the directories of the realm files.

[Link]= Specifies the directories of the properties files. [Link]= Specifies the directories of the JReport demo reports.

5. Modify [Link] in each server's <install_root>\bin, and make sure that the system database and realm database all server nodes use point to the same DBMS. For details, see Configuring the server database. Notes:
q

In JReport cluster, you can no longer use HSQLDB as the server's system database. If you set up a JReport cluster on one computer, you need to make sure that the settings of HTTP Port, Administration Port, and Server's RMI Port on each cluster node be different from those on any other nodes. It is strongly recommended that you do not change the auto generated cluster member ID in a JReport cluster, because distributed storage uses the member ID to recognize on which node the physical files are stored. Properties such as [Link], [Link], [Link], [Link]. [Link], [Link], [Link], [Link], [Link], [Link]. port, [Link], [Link], [Link], and [Link] that created in the [Link] file and their corresponding UI options on the JReport Administration page need to be configured respectively for each cluster node. However, properties that are now saved in the database should be configured for all the server nodes in the cluster. These properties are:
r

The following properties listed before in the [Link] file: cluster. enable_notify_server_down, cluster.notify_server_down_address, [Link]. active_count, [Link].check_interval, [Link], cluster. [Link].valid_time, cluster.share_memory.node_number, [Link].crd_result. copy_number, [Link].copy_number, [Link].copy_number, loadbalance.custom_class, [Link], [Link], [Link]. time, [Link], [Link], [Link]. max_count, [Link], [Link], [Link], [Link]. temp. All properties in the [Link] file in <install_root>\bin. All properties in the [Link] file in the system database. All properties in the LDAP configuration XML file [Link] in <install_root> \properties.

No sub folders should be created under the realm directory because it may create a realm when server is started. To use the old result files in <reporthome>\history, install the new JReport Server to the same directory with a new license key, overriding the existing program files. In order to fax report results successfully in a cluster, you need to configure the fax settings for each clustered server respectively. If the content of the resource root directory jreports is removed, the Public Reports folder in the

resource tree will be empty.

Starting a JReport Server cluster


To start a JReport Server cluster, start the servers you have configured for the cluster one by one. If you are using the default Derby DBMS, be sure to start Derby first by running [Link]/ sh in the <install_root>/derby/bin directory on the server containing the server DBMS. Notes:
q

If you are using multiple IP address on a clustered server, you need to add -Djgroups. bind_addr=IP address at which JReport cluster can work properly to its [Link] file located in <install_root>\bin to make sure the server can be started successfully. If you have two JReport clusters with the same cluster name in a network segment, although the two clusters are pointing to different databases, only the one started earlier can work successfully.

Example 1: Setting up a simple JReport Server cluster


This example demonstrates how to configure a simple JReport Server cluster by modifying the configuration options on the JReport Administration page on each JReport Server. Example description:
q

Set up a simple JReport Server cluster using the JReport Administration page. Assume that JReport Server Monitor has been installed on your computer. The cluster consists of two copies of JReport Server on one computer. The cluster uses one server DBMS. The cluster uses shared directories for resources so no resource copies are required.

Take the following steps to set up the cluster: 1. Install the two JReport Servers respectively to C:\JReport\Server1 and C:\JReport\Server2 using the cluster enabled license key. 2. Launch the JReport Server installed to C:\JReport\Server2. 3. Log onto the JReport Administration page of Server2, click Configuration > Service on the system toolbar, then set Port and Administration Port respectively to 8886 and 8887 to make them different from those of Server1. You may use any port numbers which are available on your system. 4. Click Cluster > Configuration on the system toolbar. 5. In the Configuration panel, specify a cluster name and check the Enable Cluster option, then click Save to enable the cluster. 6. Restart the JReport Server installed to C:\JReport\Server2. 7. Log onto the JReport Administration page of Server2 using the administration port 8887 set in Step 3 ([Link] 8. Go to the Cluster > Configuration panel, leave the Load Balancer Type as Round Robin. 9. Check the Cluster Scheduler Lease option to enable lease for the cluster, then set the active count, valid time and check interval for the cluster scheduler lease. 10. Change the Cluster Storage History, Realm and CRD Result Number of Copies to 1. We will just use one resource directory. 11. Keep the default value 2 for Cluster Memory Storage Number of Copies, thus 2 memory copies will be shared in the cluster. 12. Check the Notify via E-mail When a Server Is Down option, and in the E-mail Address text field, input the e-mail addresses of the people to whom you want to send a notification e-mail. 13. Keep the default values for Properties Directory, Realm Directory, Resource Root, History Directory and Temporary Files Directory.

14. Type the IP address or host name of Server2 in the Server's RMI Host text field, and type the port number in the Server's RMI Port text field. The port is the RMI port of the clustered server. The default port number is 1129. If there are two or more JReport Servers started on one machine, the RMI port number of each clustered server must be changed to a unique one, in order to avoid port conflicts. In this example, the port number is changed to 1130, since the other server will use the default port number 1129. 15. Click Save to accept all the changes, then shut down the server. 16. Edit C:\JReport\Server2\bin\[Link] and remove the lines with auto-start-derbyservice. We only want Server1 to start the server DBMS since we will always use the Server1 database. 17. Launch the JReport Server installed to C:\JReport\Server1, log onto the JReport Administration page ([Link] then click Cluster > Configuration on the system toolbar. 18. Use the same cluster name as Server2, thus making Server1 join the existing cluster. Check the Enable Cluster option, then click Save to enable the cluster. 19. Restart the JReport Server installed to C:\JReport\Server1, and then log onto the JReport Administration page. 20. Go to the Cluster > Configuration panel, configure Server's RMI Host and Server's RMI Port. Remember to keep Server's RMI Port to its default value 1129. 21. Upon finish, click Save to accept all settings and shut down Server1. 22. Copy [Link] in C:\JReport\Server1\bin to C:\JReport\Server2\bin. This allows RMI to be authorized between the two systems. 23. Edit [Link] in C:\JReport\Server2\bin and remove [Link]. It will be recreated when you restart Server