|
|||||||||
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(IFieldObject fieldObject,
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 and not null . |
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 . |
boolean |
canAddReportObject(IReportObject object,
ISection section)
For internal use only. |
boolean |
canEmbedFieldIntoTextObject(java.lang.String formulaForm,
ITextObject textObject)
For internal use only. |
ReportObjects |
getAllReportObjects()
Gets a collection of all the report objects in the report. |
ChartObjectController |
getChartObjectController()
For internal use only. |
CrossTabObjectController |
getCrossTabObjectController()
For internal use only. |
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 |
move(IDrawingObject object,
ISection newSection,
int top,
int left,
ISection endSection,
int bottom,
int right)
Moves a drawing object to a new position in the report. |
void |
move(IReportObject object,
ISection newSection,
int top,
int left)
Moves a report object to a specified section and position within the section. |
void |
remove(IReportObject object)
Removes a report object from the report. |
void |
reorder(IReportObject rptObj,
int toIndex)
For internal use only. |
void |
validateReportObject(IReportObject object)
For internal use only. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean canAddReportObject(IReportObject object, ISection section)
public boolean canEmbedFieldIntoTextObject(java.lang.String formulaForm, ITextObject textObject)
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()
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
collectionpublic ReportObjects getReportObjectsByKind(ReportObjectKind objectKind)
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
collectionReportObjectKind
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, runningtotal 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 void add(IFieldObject fieldObject, 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 and not null
.
Note: The field added to the detail section with this method must be a DB field, parameter field, formula field, runningtotal field, or SQL expression field.
fieldObject
- the field object to be added to the details section.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
public void move(IReportObject object, ISection newSection, int top, int left) throws ReportSDKException
Note: This method cannot be used to move drawing objects. To move an IDrawingObject
, use move(IDrawingObject,...)
.
object
- the IReportObject
to move (must not be an IDrawingObject
)newSection
- the ISection
to move the report object totop
- the distance from the top of the section at which to place the report objectleft
- the distance from the left of the section at which to place the report object
ReportSDKException
public void move(IDrawingObject object, ISection newSection, int top, int left, ISection endSection, int bottom, int right) throws ReportSDKException
object
- the IDrawingObject
to movenewSection
- the ISection
to move the report object totop
- the distance from the top edge of the section at which to place the report objectleft
- the distance from the left edge of the section at which to place the report objectendSection
- the end ISection
where the bottom-right corner of the drawing
object will be positionedbottom
- the distance from the bottom edge of the endSection
of the
drawing object's bottom-right cornerright
- the distance from the right edge of the endSection
of the drawing
object's bottom-right corner
ReportSDKException
public void reorder(IReportObject rptObj, int toIndex) throws ReportSDKException
ReportSDKException
public CrossTabObjectController getCrossTabObjectController()
public ChartObjectController getChartObjectController()
public void validateReportObject(IReportObject object) throws ReportSDKException
ReportSDKException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |