|
|||||||||
| 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.MultiUserDesigner
public class MultiUserDesigner
MultiUserDesigner class provides a series of editing methods for several users to edit reports at the same time
* and manipulate JReport ReportSets (.cls) and its children objects. By building a
MultiUserDesigner instance in a Java program, users can also edit
a ReportSet by methods provided by API and Designer.
ReportSets are also called Page Reports in JReport manuals.
JReport ReportSet and its objects are stored in a tree
structure. An instance of Designer can
retrieve each object in the ReportSet by its handle. The handle
of an object is named by its qualified and unique instance name.
MultiUserDesigner only supports report sets created in the V7 and earlier versions that have a single report sheet or tab.
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)
The following is one example of the use of the MultiUserDesigner . The code:
MultiUserDesigner dr = null;
try
{
String path = "C:\\JReport\\Designer\\Demo\\Reports\\TutorialReports";
String catName = "TutorialReports.cat";
String uID = "user1"
DesignerUserInfo userInfo=new DesignerUserInfo("UID", "designer API license key");
dr = new MultiUserDesigner(path, catName,userInfo);
MultiUserCatalogAPI cat = dr.getCatalogAPI();
......
}
finally
{
dr.exit();
}
Note:
The above descriptions and samples are based on JReport ReportSet structure.
Since version 8, JReport upgraded the template from Report
to ReportSet.
The methods that have the parameter uID are used to
manipulate the Report and its children objects, and the report
will not be converted to ReportSet when saving it.
| 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 | |
|---|---|
MultiUserDesigner(java.lang.String path,
java.lang.String name)
Deprecated. since version 6.1. |
|
MultiUserDesigner(java.lang.String path,
java.lang.String name,
DesignerUserInfo user)
Constructs a MultiUserDesigner object. |
|
| Method Summary | |
|---|---|
java.lang.String |
create(java.lang.String name,
java.lang.String query,
java.lang.String uID)
Creates a new report with a report name. |
java.lang.String |
create(java.lang.String name,
java.lang.String sourceName,
java.lang.String query,
java.lang.String uID)
Creates a new report with a report name. |
java.lang.String[] |
getChangedByFields(java.lang.String handle,
java.lang.String propertyName,
java.lang.String uID)
Gets the fields that can be used to control the object's property values at runtime. |
java.lang.String[] |
getControlFields(java.lang.String handle,
java.lang.String name,
java.lang.String uID)
Gets the fields that can be used to control an object's property values at runtime. |
java.lang.String[] |
getDBFields(java.lang.String handle,
java.lang.String uID)
Gets the database fields that can be used in the report. |
java.lang.String[] |
getFormats(java.lang.String handle,
java.lang.String uID)
Gets the default format list of the object. |
java.lang.String[] |
getFormulae(java.lang.String handle,
java.lang.String uID)
Gets the formulae that can be used in the report. |
MultiUserCatalogAPI |
getMultiUserCatalogAPI()
Gets MultiUserCatalogAPI instance. |
java.lang.String[] |
getParameter(java.lang.String uID)
Gets all parameters in the default data source of the catalog. |
java.lang.String[] |
getQueries(java.lang.String uID)
Gets queries the in the datasource of the catalog. |
java.lang.String[] |
getSummaries(java.lang.String handle,
java.lang.String uID)
Gets the summaries that can be used in the report. |
java.lang.String |
insert(java.lang.String parent,
java.lang.String name,
boolean avoid,
boolean onleft,
boolean ontop,
boolean repeat,
boolean vertical,
int boundary,
CTRowColFieldInfo[] colInfo,
CTRowColFieldInfo[] rowInfo,
CTAggFieldInfo[] aggInfo,
java.lang.String uID)
Inserts a crosstab object and its children into the parent node. |
java.lang.String |
insert(java.lang.String parent,
java.lang.String name,
CTRowColFieldInfo[] colInfo,
CTRowColFieldInfo[] rowInfo,
CTAggFieldInfo[] aggInfo,
java.lang.String uID)
Inserts a crosstab object and its children into the parent node. |
java.lang.String |
insert(java.lang.String uID,
java.lang.String parent,
int type,
java.lang.String name,
java.lang.String mapping)
Inserts an object of database field, parameter, formula , summary or group into the parent node. |
java.lang.String |
insert(java.lang.String parent,
java.lang.String name,
java.lang.String paperName,
int type,
java.lang.String group1,
java.lang.String group2,
java.lang.String value,
ChartLegendInfo chartLegendInfo,
ChartLabelInfo chartLabelInfo,
java.lang.String uID)
Inserts a chart object and its children into the parent node. |
boolean |
setControlFields(java.lang.String handle,
java.lang.String prop,
java.lang.String field,
java.lang.String uID)
Sets the field to control the property value at runtime. |
| 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 MultiUserDesigner(java.lang.String path,
java.lang.String name)
throws jet.jetc.ReadFailureException,
jet.universe.exception.UniverseFileException
path - Indicates the path of the catalog file.name - Indicates the name of the catalog file.
jet.jetc.ReadFailureException
jet.universe.exception.UniverseFileException
public MultiUserDesigner(java.lang.String path,
java.lang.String name,
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.
jet.jetc.ReadFailureException
jet.universe.exception.UniverseFileException| Method Detail |
|---|
public MultiUserCatalogAPI getMultiUserCatalogAPI()
null value will be
returned, uses getError() to check the error message.
public java.lang.String create(java.lang.String name,
java.lang.String query,
java.lang.String uID)
create in class Designername - indicates the instance name of the report to be created.query - indicates the mapping name of the query in the default data source which is bound to the report.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
null if the object fails to be inserted and use API.getError() to get the reason.- See Also:
Designer.addReport(String, String)
public java.lang.String create(java.lang.String name,
java.lang.String sourceName,
java.lang.String query,
java.lang.String uID)
name - indicates the instance name of the report to be created.sourceName - indicates the name of the data source on which the query is based.query - indicates the mapping name of the query in the specified data source which is bound to the report.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
getError() to check the error message.
public java.lang.String insert(java.lang.String uID,
java.lang.String parent,
int type,
java.lang.String name,
java.lang.String mapping)
uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.parent - Indicates the handle of the parent node. The section should be
a container, such as sections.type - Indicates the type of the object to be inserted. The useful constants:
GROUP
MEDIAFIELD
BARCODEFIELD
DBFIELD
FORMULA
SUMARY
PARAMETER
COMPUTEDCOLUMN
name - Indicates the instance name of the new object.mapping - Indicates the mapping name of the database field, parameter, formula or summary.
null if the object fails to be inserted and use API.getError() to get the reason.
public java.lang.String insert(java.lang.String parent,
java.lang.String name,
java.lang.String paperName,
int type,
java.lang.String group1,
java.lang.String group2,
java.lang.String value,
ChartLegendInfo chartLegendInfo,
ChartLabelInfo chartLabelInfo,
java.lang.String uID)
parent - handle of the parent node.name - instance name of the new chart.paperName - the instance name of ChartCoordinatepaper objecttype - type of the chart to be insertedgroup1 - mapping name of the first group.group2 - mapping name of the second group. It can be null.value - mapping name of the summary.chartLegendInfo - field info array of the chart legend.chartLabelInfo - field info array of the chart title and notes.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
null if the object fails to be inserted and use API.getError() to get the reason.
public java.lang.String insert(java.lang.String parent,
java.lang.String name,
CTRowColFieldInfo[] colInfo,
CTRowColFieldInfo[] rowInfo,
CTAggFieldInfo[] aggInfo,
java.lang.String uID)
parent - handle of the parent node.name - instance name of the new object.colInfo - field info array of column. The value of index of colInfo[n] is ignored.rowInfo - field info array of row. The value of index of rowInfo[n] is ignored.aggInfo - field info array of aggregate. The value of index of aggInfo[n] is ignored.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String insert(java.lang.String parent,
java.lang.String name,
boolean avoid,
boolean onleft,
boolean ontop,
boolean repeat,
boolean vertical,
int boundary,
CTRowColFieldInfo[] colInfo,
CTRowColFieldInfo[] rowInfo,
CTAggFieldInfo[] aggInfo,
java.lang.String uID)
parent - handle of the parent node.name - instance name of the new object.avoid - keep columns together when page break.onleft - display aggregate calculation of row on left of crosstabontop - display aggregate calculation of column on top of crosstabrepeat - repeat column title when page breakvertical - set aggregate calculations layout verticallyboundary - set number of aggregate calculations in a row or column.colInfo - field info array of column. The value of index of colInfo[n] is ignored.rowInfo - field info array of row. The value of index of rowInfo[n] is ignored.aggInfo - field info array of aggregate. The value of index of aggInfo[n] is ignored.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getDBFields(java.lang.String handle,
java.lang.String uID)
handle - the object handle to anchor the report. It could be a
report handle or one of its posterities' object handle.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getFormulae(java.lang.String handle,
java.lang.String uID)
handle - the object handle to anchor the report. It could be a
report handle or one of its posterities' object handle.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getSummaries(java.lang.String handle,
java.lang.String uID)
handle - the object handle to anchor the report. It could be a
report handle or one of its posterities' object handle.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getParameter(java.lang.String uID)
uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getQueries(java.lang.String uID)
getQueries in class DesigneruID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getFormats(java.lang.String handle,
java.lang.String uID)
handle - Indicates the object handle.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getChangedByFields(java.lang.String handle,
java.lang.String propertyName,
java.lang.String uID)
handle - handle of the object.propertyName - name of the propertyuID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public java.lang.String[] getControlFields(java.lang.String handle,
java.lang.String name,
java.lang.String uID)
handle - handle of the object.name - name of the property.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
public boolean setControlFields(java.lang.String handle,
java.lang.String prop,
java.lang.String field,
java.lang.String uID)
handle - handle of the selected object.prop - property name.field - field mapping name.uID - The user id to identify the proper user while several users sharing the MultiUserDesigner.
Use uID to access the user's private data in MultiCatalogAPI.
true if it is set successfully.false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||