|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.crystaldecisions.sdk.occa.report.application.ReportObjectController
public class ReportObjectController
This object is used to add, remove, and modify the report objects that are defined in the
definition package.
These objects include charts, pictures, lines, text objects, and field objects.
Report objects are contained within a section of the report, and each section belongs to a
particular report area.
ReportDefinition object to retrieve the area that contains the report section that
the desired report object has been added to. Pre-defined areas include the report header and footer,
page header and footer, and details area.getSections
method to retrieve the section that contains the reportgetReportObjects
method to retrieve the report object.
| Method Summary | |
|---|---|
void |
add(IReportObject object,
ISection section,
int index)
Adds a report object to a specified section of the report. |
void |
add(java.lang.String fieldName)
Adds a Field object to details section. |
void |
add(java.lang.String fieldName,
java.lang.String headingText)
Adds a Field object to details section and adds
a FieldHeadingObject object to the
page header section if headingText is not empty or not null. |
ReportObjects |
getAllReportObjects()
Gets a collection of all the report objects in the report. |
ReportObjects |
getReportObjectsByKind(ReportObjectKind objectKind)
Gets a collection of all the report objects of the specific kind in the report. |
PictureObject |
importPicture(java.lang.String pictureFilePath,
ISection section,
int left,
int top)
Imports an image file into the report as a Picture object. |
void |
modify(IReportObject oldObject,
IReportObject newObject)
Modifies a report object. |
void |
remove(IReportObject object)
Removes a report object from the report. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void add(IReportObject object,
ISection section,
int index)
throws ReportSDKException
Adds a report object to a specified section of the report. The collection of report objects
can be accessed by using the getReportObjects
method in the Section object.
The index is zero-based.
object - The report object that you want to add to the report.section - The section of the report in which the object will appear.index - The position in the ReportObjects collection where you want to add
the object. Specify -1 to add the object to the end of the array. The index is zero-based.
ReportSDKException
public void modify(IReportObject oldObject,
IReportObject newObject)
throws ReportSDKException
Modifies a report object. The collection of report objects can be accessed
by using the getReportObjects
method in the Section object. The index is zero-based.
oldObject - The report object to be modified in the collection.newObject - The new report object.
ReportSDKException
public void remove(IReportObject object)
throws ReportSDKException
Removes a report object from the report.
Note:When you remove a SummaryField, the Filters
and Sorts associated with this SummaryField will also be removed.
object - The ReportObject to be removed.
ReportSDKException
public ReportObjects getAllReportObjects()
throws ReportSDKException
Gets a collection of all the report objects in the report.
Example:
This sample shows how to retrieve a collection of all the ReportObjects in a Crystal report. Report objects are the visible entities that define a report, such as charts, pictures and hyperlinks. Report Objects store information about the object's size, position, border, and color.
ReportDefController reportDefController = clientDoc.getReportDefController();
ReportObjectController reportObjectController = reportDefController.getReportObjectController();
ReportObjects reportObjects = reportObjectController.getAllReportObects();
ReportObjects collection
ReportSDKException
public ReportObjects getReportObjectsByKind(ReportObjectKind objectKind)
throws ReportSDKException
Gets a collection of all the report objects of the specific kind in the report.
Example:
This sample shows how to retrieve a collection of all the ReportObjects in a Crystal report of a specified kind. Report objects are the text objects, charts, pictures, bitmaps and so on that appear in reports. Report objects store information about the object's size, position, border, and color.
ReportDefController reportDefController = clientDoc.getReportDefController();
ReportObject reportObjectController = reportDefController.getReportObjectController();
ReportObjects reportObjects = reportObjectController.getReportObectsByKind(ReportObjectKind.field);
objectKind - the ReportObjectKind of objects to return
ReportObjects collection
ReportSDKExceptionReportObjectKind
public void add(java.lang.String fieldName)
throws ReportSDKException
Adds a Field object to details section.
fieldName - the name of the field object to add to the details section
ReportSDKException
public void add(java.lang.String fieldName,
java.lang.String headingText)
throws ReportSDKException
Adds a Field object to details section and adds
a FieldHeadingObject object to the
page header section if headingText is not empty or not null.
Note: The field added to the detail section with this method must be a DB field, parameter field, formula field, or SQL expression field.
Example:
This sample shows how to add a report object to a specified section of the report. Report objects can be charts, pictures, lines, text objects, and field objects. Report objects are contained within a section of the report, and each section belongs to a particular report area. An area is a group of like sections in the report that all share the same characteristics. You will add a field to the PageHeaderArea of the report.
ReportDefController reportDefController = clientDoc.getReportDefController();
ReportObjectController reportObjectController = reportDefController.getReportObjectController();
reportObjectController.add( "{Table.Field}", "FieldName" );
fieldName - the name of the field object to add to the details section. The name must be in formula form.headingText - the name of the FieldHeadingObject that you want to add to the page header section,
when headingText is not null or empty. This parameter is optional. The default value is empty.
ReportSDKException
public PictureObject importPicture(java.lang.String pictureFilePath,
ISection section,
int left,
int top)
throws ReportSDKException
Imports an image file into the report as a Picture object.
Use this method to import an image into the report as a PictureObject.
If you want to replace an image that you have imported using this method,
or if you want to replace an image that you have imported using the Graphic Location feature
in the Report designer, first use the remove(IReportObject) method to remove the image and then use
this method to import the replacement image. Do not use the modify(IReportObject, IReportObject) method to replace the image.
pictureFilePath - The file path to the image relative to the location of the RAS server.
The SDK must have access rights to the image file. Forward relative paths are acceptable.
For example, \images\myphoto.jpg is acceptable but ..\images\myphoto.jpg is not.
HTTP paths are acceptable. FTP requests are not available.
Only mapped file server locations are considered valid.section - The section of the report in which the object will appear.left - The position of the Picture object relative to the left of the section.top - The position of the Picture object relative to the top of the section.
ReportSDKException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||