|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjet.api.API
jet.api.Designer
jet.api.MultipliedDesigner
public class MultipliedDesigner
The MultipliedDesigner class allows an application to create
and manipulate JReport ReportSets (.cls) and its children objects. By building a
MultipliedDesigner instance in a Java program, users can edit
a ReportSet by methods provided by API.
ReportSets are also called Page Reports in JReport manuals.
JReport ReportSet and its objects are stored in a tree
structure. An instance of MultipliedDesigner can
retrieve each object in the ReportSet by its handle. The handle
of an object is named by its qualified and unique instance name.
A ReportSet is composed of one or more reports (also called tabs or sheets) that are designed for the same purpose, or related purposes. Report developers can design, maintain, run and schedule these reports together or separately. The reports in the same ReportSet can share the same parameters and DataSets which reduces the number of queries to the DBMS.
A dataset is the set of data built from the result of a query, and can optionally have filters applied to it. A dataset contains not only DBFields, but also all formulas, summaries, and parameters that use the DBFields. A dataset has a name, which by default is the name of the resource on which it is created. When you create a data component, you specify whether to create a new dataset for it or use an existing one.
JReport reports are usually composed of multiple components. Components in JReport can be classified as follows:
A label is an object that contains a string. It is typically a brief description used to identify a field or other value nearby.
An image is a digital representation of a picture. JReport supports the following image formats: .bmp, .gif, .jpg, and .png.
A table is composed of rows and columns, and each contains several cells. Tables give you great control over how to present data, including placing fields, grouping them, and sorting them. With such a structure a table is a good way to show any two-dimensional dataset.
A crosstab summarizes data and presents the summaries in a compact row and column format.
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.
A banded object is a component that can present grouped data and detailed data. A banded object is composed of several banded panels(sections) with which you can easily organize data fields and other elements.
A tabular is a component designed to lay out other components. Unlike a table component, which is used to display a dataset, a tabular is a set of cells that can each display a data component.
A report that is inserted into another report is referred to as the subreport. Subreports are inserted and managed just like a component in a primary report, but a subreport itself is created and managed just like a primary report. You can specify relationships between the primary report and the subreport as well as have JReport pass values to the primary report or the subreport. A primary report can have more than one subreport. They can be in the same ReportSet as the primary report or can be in different ReportSets.
Formula fields are calculated from DBFields, other formulas, summaries, parameters and constants, so they can present information that DBFields cannot do.
A summary is a special kind of formula. A summary generates a count, average, sum, standard deviation or other aggregation of a set of data values. A summary may apply to a defined group of data or can be a dynamic summary able to summarize on any group.
A parameter in JReport is a variable whose value is determined at runtime. The runtime parameters help you dynamically control your report results when used as parameters in a query.
Drawing objects can only be inserted into banded objects. You can add arcs, ovals, boxes, round boxes and lines to your report.
Some components can be bound with a dataset or inherit data from the dataset of their parents. These components are table, chart, crosstab, and banded object, and they are also referred to as data containers or data components. Depending on the location of the libraries you either need a Designer API License Key or a Server Designer API License Key. If you are using Designer libraries you need report.jar and JREngine.jar (Designer API License Key) If you are using Server libraries you need JRSRMI.jar (Server Designer API License Key)
For detailed explanation about the object properties, refer to the help document
The following is one example of the use of the MultipliedDesigner. The code:
MultipliedDesigner dr = null;
try
{
String path = "C:\\JReport\\Designer\\Demo\\Reports\\TutorialReports";
String catName = "TutorialReports.cat";
DesignerUserInfo userInfo=new DesignerUserInfo("UID", "designer API license key");
dr = new MultipliedDesigner(path, catName,userInfo);
CatalogAPI cat = dr.getCatalogAPI();
......
}
finally
{
dr.exit();
}
// To create a new ReportSet (Page Report) with a banded object using the above MultipliedDesigner (dr)
// 1. Create ReportSet
reportset = dr.createReportSet(name);
// 2. Add Dataset
dataset = dr.addDataset(reportset, queryname, dsname, null, Designer.DATASET_TYPE_QUERY);
// 3. Create a report tab inside the ReportSet
report = dr.addReport(reportset, name);
// 4. Insert a PagePanel into the report tab
page = dr.insertPage(report);
// 5. Insert the data component you want to use such as a banded object
banded = dr.insertBandedObject(reportbody, true, true, true);
// 6. Bind the dataset to the reportbody and set inherit from parent for the banded object
dr.bindDataSet(reportbody, queryname);
dr.set(banded, "dataInherit", true);
// 7. Get handles so that you can start adding objects to the report
handles = dr.getHandles(banded, Designer.PAGE);
......
// 8. Add groups to the banded object page
GroupInfo ginfo = new GroupInfo(dbfield,GroupInfo.DESCENDING);
group = dr.insertSectionGroup(handles[0], ginfo);
.....
// 9. Exit and save changes
dr.exit();
| Field Summary |
|---|
| Fields inherited from class jet.api.API |
|---|
BOOLEAN, CAT, CENTIMETER, COLOR, DOUBLE, ENUM, FLOAT, INCH, INTEGER, LONG, PIXEL, REFERENCE, RPT, SELFRPT, STRING, TEXTRPT, UNKNOWN, XMLCAT, XMLRPT |
| Constructor Summary | |
|---|---|
MultipliedDesigner(java.lang.String path,
java.lang.String name,
java.lang.String suffix,
DesignerUserInfo user)
Constructor. |
|
| Method Summary | |
|---|---|
MultipliedCatalogAPI |
getCatalogAPI()
Gets a MultipliedCatalogAPI instance with the specified catalog. |
| Methods inherited from class jet.api.API |
|---|
clearError, clearMsg, clearWarning, closeLog, containPropName, getBool, getChildren, getClassType, getColor, getDouble, getError, getFloat, getHandles, getHandles, getHandles, getHandles, getInstanceName, getInt, getLong, getPropNames, getPropType, getQualifyName, getString, getStringArray, getUnit, getWarning, set, set, set, set, set, setLog, setLog, setLog, setReference, setUnit, writeLog, writeLog |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultipliedDesigner(java.lang.String path,
java.lang.String name,
java.lang.String suffix,
DesignerUserInfo user)
throws jet.jetc.ReadFailureException,
jet.universe.exception.UniverseFileException
path - Indicates the path of the catalog file.name - Indicates the name of the catalog file.user - The DesignerUserInfo includes the product license of Design API.suffix - Indicates the suffix of the catalog file. Design API can save a catalog
in binary or XML format. The suffix can be XMLCAT or
CAT.
jet.jetc.ReadFailureException
jet.universe.exception.UniverseFileException| Method Detail |
|---|
public MultipliedCatalogAPI getCatalogAPI()
getCatalogAPI in class DesignergetError() to check the error message.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||