The editor supports the creation of Views for various types of reports: tables, crosstabs, and charts. You intuitively interact with the editor to create these Views by simply dragging and dropping elements. You can add and summarize fields, define groups, label the report, and format data for each field. You can also use the editor to explore and analyze data interactively.
1. Click Create Ad Hoc View. This opens the Data Chooser wizard.
2. In the Data Chooser: Source dialog, select a data source type (from Topics, Domains, or OLAP Connections), then choose your data source and click a report type (Table, Chart, or Crosstab). Select the report type you are likely to want as your end result, although you can change your report type later on while working with your View.
|
The Ad Hoc Editor contains the following panels:
• Data Selection, which contains the fields, dimensions, and measures available in the source Domain, Topic, or OLAP connection.
• Ad Hoc View, the main View design panel.
• Filters, which defines a subset of data to retrieve from the data source.
We’ll discuss how to use these panels to create an Ad Hoc View later in this section.
The following repository objects provide a prepared connection to a data source for Ad Hoc View creation:
• Topics, JRMXL files created externally and uploaded to JasperReports Server as a basis for Ad Hoc reports.
• Domains, virtual views of a data source that present the data in business terms, allow for localization, and provide data-level security.
• OLAP Connections, multi-dimensional views of data that allow users to analyze a large number of aggregate data levels.
You can also open and edit an existing Ad Hoc View to create a new Ad Hoc View.
Generally, an administrator or iReport user creates a Topic as a JRXML file. The JRXML topic is then associated with a data source in the server. A Topic can also be created from a Domain in the server. Both types of topics appear in the Data Chooser wizard when you create an Ad Hoc View.
Using a Topic as your source generates an empty View, which allows you to begin adding data to your View right away, without choosing, pre-filtering, or changing display names of the data (all of which are required steps when creating a Domain-based report).
To begin designing a Topic-based View:
1. Launch the Ad Hoc Editor by clicking Create > Ad Hoc View.
2. In the Data Chooser, select the Topics option at the top of the dialog window.
3. Expand the Topics folder and select a topic.
4. Select the type of report you intend to create: table, chart, or crosstab. For an overview of report types, see section Ad Hoc Report Types.
You can now begin working on your View in the Ad Hoc Editor.
Administrators create Domains that typically filter the data, create input controls, and manage the list of available fields and measures. A Domain specifies tables in the database, join clauses, calculated fields, display names, and default properties, all of which define items and sets of items for creating Ad Hoc Views.
To begin designing a Domain-based View:
1. Launch the Ad Hoc Editor by clicking Create > Ad Hoc View.
2. In the Data Chooser, select the Domains option at the top of the dialog window.
3. Expand the Domains folder and select a domain.
4. Click Choose Data..., and click the options on the left of the window to perform the following tasks:
• Click Fields to select fields of data to use in the View.
• Click Pre-filters to create filters to limit the data available in the Ad Hoc Editor.
• Click Display to change the fields’ display names.
• Click Save as Topic to save the customized topic for later use.
5. Select the type of report you want to create: table, chart, or crosstab. For an overview of report types, see section Ad Hoc Report Types.
You can now begin working on your View in the Ad Hoc Editor.
Administrators create OLAP client connections that expose transactional data and define how the data can be seen as a multidimensional cube. An OLAP connection can expose multiple cubes in a single OLAP connection.
|
With OLAP connections, you can only create Views for crosstab-type reports. |
To begin designing an OLAP connection-based View:
1. Launch the Ad Hoc Editor by clicking Create > Ad Hoc View.
2. In the Data Chooser, select the OLAP Connections option at the top of the dialog window.
3. Expand the Analysis Components | Analysis Connections folder and select a connection.
4. Select Crosstab as the type of report you want to create.
You can now begin working on your View in the Ad Hoc Editor.
For more information about OLAP-based report functionality, refer to the following sections:
• Working with OLAP Connection-based Crosstabs
The Ad Hoc Editor allows you to create Views you can use to generate the most frequently-used report types:
• Tables, which are used to view values in the database and to summarize the values in columns.
• Charts, which compare one or more measures across multiple sets of related fields.
• Crosstabs, which summarize data across multiple dimensions.
This section provides an overview of each report type. The design and content tasks for working with each type of report is discussed in more detail in the following sections:
• For more information on table reports, see section Working with Tables.
• For more information on chart reports, see section Working with Charts.
• For more information on crosstab reports, see section Working with Standard Crosstabs.
The architecture of a table report consists of columns, rows, and groups.
Columns in a table correspond to the columns in the data source. They are included in the report by adding fields or measures. to the table in the Ad Hoc View.
Rows correspond to rows in the database. The information in each row depends on what columns are included in the table.
Using groups, rows can be grouped by identical values in any field with intermediate summaries for each grouped value. For example, a table report of product orders might contain columns to show the dates and amounts of each order, and its rows might be grouped by city and product:
|
Date Placed |
Date Filled |
Payment Received |
City A |
|||
Product 01 |
|||
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
Product 01 totals: |
|
Count |
Sum |
Product 02 |
|||
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
Product 02 totals: |
|
Count |
Sum |
Product 03 |
|||
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
Product 03 totals: |
|
Count |
Sum |
City A totals: |
|
Count |
Sum |
City B |
|||
Product 01 |
|||
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
Date |
Date |
Amount |
|
... |
... |
... |
For more information on working with tables, see section Working with Tables.
Charts summarize data graphically. Types of charts include bar chart, line chart, and pie chart, among others. With the exception of time series and scatter charts, each type of chart compares summarized values for a group. For example, the Chart tab might show the data in a bar chart that compared the sum of Payments Received for each of the products in each of the cities:
.
Total Payments Received |
||
|
||
City A |
City B |
City C |
Product 01 Product 02 Product 03 |
For more information on working with charts, see section Working with Charts.
Crosstabs are more compact representations than tables; they show only computed values, rather than individual database values. Columns and rows specify the dimensions for grouping; cells contain the summarized measurements. For instance, the example above could be displayed in a crosstab with columns grouped by sales manager and year:
|
Tom |
Harriet |
Manager Totals |
|||||
2007 |
2008 |
Year Totals |
2007 |
2008 |
Year Totals |
|||
City A |
Product 01 |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Product 02 |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
|
Product 03 |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
|
Product Totals |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
|
City B
|
Product 01 |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
... |
... |
... |
... |
... |
... |
... |
... |
|
City Totals |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
Payment Received |
For more information on working with crosstabs, see section Working with Standard Crosstabs.
OLAP connection-based crosstabs behave differently than those created from Topics or Domains. See section Creating Topics.
The Data Selection panel contains a list of available fields in the chosen Topic or Domain. If you are using a Domain, fields may appear in nested sets. Use the arrow beside the set name to expand or collapse a set of fields.
Available fields may be divided into two sections in the panel, Fields and Measures.
To hide this panel, click the icon in the top left corner; this is helpful when arranging content in a large Ad Hoc View. Click the same icon on the minimized panel to expand it.
For more information on working with fields, see sections Using Fields in Tables , Using Fields and Measures in Charts, and Using Fields in Crosstabs.
The Ad Hoc View panel includes Sample Data | Full Data options for displaying a subset (sample) of data, or all (full) data in the report. Using the sample data can make the design process quicker by loading less data. The full data set shows you a more realistic view of the final report as it appears to your users. Use the subset for initial design; use the full set for refining layout elements such as column width.
By default, the editor displays only a smaller, sample set of the data in the table. Click Full Data to view the full set of data.
|
Depending on its configuration, JasperReports Server may load a Topic, Domain, or OLAP connection’s entire result set into memory when you edit or run the report. If the data policies and other options that control JasperReports Server’s memory are disabled, ensure that each Topic, Domain, or OLAP connection returns a manageable amount of data, given the environment’s load capacity. Alternately, you can change the server’s configuration. |
The Ad Hoc View panel also includes Table, Chart, and Crosstab options for resetting the report type. You can change the report type in the Ad Hoc Editor during the design or when you reopen the design for editing.
To change the report type:
• Near the top of the Ad Hoc View panel, select the report type you wish to display.
The data is displayed in the new report type.
The tool bar at the top of the panel provides access to many functions of the Ad Hoc Editor. See "Ad Hoc Editor Tool Bar Icons" describes the tool bar.
Icon |
Name |
Description |
|||||||||
|
Presentation Mode |
Click this icon to hide the editor interface and view only the report. This mode provides a subset of the editor’s full feature set. |
|||||||||
|
Save |
Place the cursor over this icon to open a menu of save options. |
|||||||||
|
Export |
Click this icon to export the View into one of the available formats. |
|||||||||
|
Undo |
||||||||||
|
Redo |
||||||||||
|
Undo All |
Click this icon to revert the report to its state when you last saved. |
|||||||||
|
Switch Group |
Click this icon to change the way groups are displayed. For more information, refer to section Creating a View from a Domain. |
|||||||||
|
Sort |
When working with tables, click this icon to view the current sorting and to select fields for sorting data. For more information, refer to section Sorting Tables |
|||||||||
|
Input Controls |
Click this icon to see the input controls applied to this View. For more information, refer to section Using Input Controls. |
|||||||||
|
Page Options |
Place the cursor over this icon to open a menu of page-level options. You can:
|
Directly beneath the toolbar is the Layout Band. Here, there are two fields. These fields have different labels and functions, depending on the type of View you are creating:
• For tables, these fields are Columns and Groups.
• For charts, these fields are Measures and Group.
• For crosstabs, these fields are Columns and Rows.
You can drag and drop fields and measures into these boxes to populate your View.
The Filters panel displays any filters defined for the View. You can set the filter values and see the resulting change in the Ad Hoc View Ad Hoc Viewpanel.To hide the Filters panel, click the icon in the top left corner of the panel. Click the same icon on the minimized panel to expand it again.
For more information on working with filters, see section Using Filters and Input Controls.
Ad Hoc Views are created and edited in the Ad Hoc Editor, and are saved to the repository. In addition to creating Ad Hoc Reports, Views can be used as data sources to create new Views based on the data included in them, rather than on an original data source.
After you create a compelling table, chart, or crosstab, you can save the View in the repository for future use.
To save an Ad Hoc View:
1. Hover your mouse over .
2. Select Save Ad Hoc View or Save Ad Hoc View As.
3. Name the View as needed, and click
The View is saved in the repository.
You can also save an Ad Hoc view as a report. Typically, a report is created when you want to:
• See data in the interactive Report Viewer.
• Perform additional formatting of the table data.
• Embed the data content into a dashboard.
Create a report from the View by selecting Save Ad Hoc View and Create Report; you can also create and run a report directly from the repository. For more information, see section Running a Simple Report. When you run the report, it is displayed as a JasperReport.
When you create a report from an Ad Hoc View, the report is considered “dependent” on that View.
When you save an Ad Hoc View its dependent reports are not updated. For example, if you open an Ad Hoc View in the Editor and add a column to it, that column will not show up in previous reports created from that View. In such a case, you may want to save the updated View with a different filename to avoid confusion.