com.crystaldecisions.sdk.occa.report.application
Class ReportSectionController

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.application.ReportSectionController

public class ReportSectionController
extends java.lang.Object

This object is used to add, remove, and set the properties for sections in the report. Each section belongs to a particular report area, and can contain different types of report objects.

Section objects are defined in the definition package, and can be accessed by using the Area object's getSections() method.

To access a report section

  1. Use the ReportDefinition object to retrieve the area that contains the desired report section. Pre-defined areas include the ReportHeaderArea, ReportFooterArea, PageHeaderArea, PageFooterArea, and DetailArea.
  2. Use the Area object's getSections() method to retrieve the section.


Field Summary
static java.lang.String SECTION_PROP_FORMAT
          Section format.
static java.lang.String SECTION_PROP_HEIGHT
          Section height.
static java.lang.String SECTION_PROP_LINKEDURI
          Section linked URI.
static java.lang.String SECTION_PROP_NAME
          Section name.
static java.lang.String SECTION_PROP_WIDTH
          Section width.
 
Method Summary
 void add(ISection section, IArea area, int index)
           Adds a section to a specified report area.
 void autoFitSections(java.lang.Object sectionObject)
           Sets the height of all specified sections to minimum.
 int getMinSectionHeight(ISection section)
           
 void remove(ISection section)
           Removes an ISection object from the report.
 void reorder(ISection section, int toIndex)
           
 void setProperty(ISection section, ReportSectionPropertyEnum propID, java.lang.Object value)
           Sets the properties for a section in the report.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECTION_PROP_NAME

public static final java.lang.String SECTION_PROP_NAME

Section name.

See Also:
Constant Field Values

SECTION_PROP_HEIGHT

public static final java.lang.String SECTION_PROP_HEIGHT

Section height.

See Also:
Constant Field Values

SECTION_PROP_WIDTH

public static final java.lang.String SECTION_PROP_WIDTH

Section width.

See Also:
Constant Field Values

SECTION_PROP_FORMAT

public static final java.lang.String SECTION_PROP_FORMAT

Section format.

See Also:
Constant Field Values

SECTION_PROP_LINKEDURI

public static final java.lang.String SECTION_PROP_LINKEDURI

Section linked URI.

See Also:
Constant Field Values
Method Detail

add

public void add(ISection section,
                IArea area,
                int index)
         throws ReportSDKException

Adds a section to a specified report area. The collection of section objects can be accessed by using the getSections() method in the Area object. The index is zero-based.

Parameters:
section - The section that you want to add to the report.
area - The area of the report to which the section is added.
index - The position in the Sections 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.
Throws:
ReportSDKException

getMinSectionHeight

public int getMinSectionHeight(ISection section)
                        throws ReportSDKException
Throws:
ReportSDKException

remove

public void remove(ISection section)
            throws ReportSDKException

Removes an ISection object from the report.

Parameters:
section - The ISection to be removed.
Throws:
ReportSDKException

reorder

public void reorder(ISection section,
                    int toIndex)
             throws ReportSDKException
Throws:
ReportSDKException

setProperty

public void setProperty(ISection section,
                        ReportSectionPropertyEnum propID,
                        java.lang.Object value)
                 throws ReportSDKException

Sets the properties for a section in the report. Most objects are modified by copying the object, modifying the copy, and then using the appropriate controller to modify the original based on the changes you have made in the copy. Because areas consist of sections, and sections contain report objects, it is costly to copy the entire object. This method is used to modify a single property in the Section object.

Parameters:
section - The section whose property is being modified. This object should be a copy of the original. For example, if you want to modify a Section object's Format property using setFormat, pass in SectionCopy as the argument, where SectionCopy = Section.Format.Clone
propID - The name of the property that is being modified.
value - The value that is being set for the property.
Throws:
ReportSDKException

autoFitSections

public void autoFitSections(java.lang.Object sectionObject)
                     throws ReportSDKException

Sets the height of all specified sections to minimum.

If the sectionObject parameter is empty or NULL, the height of all sections in the report will be set to minimum. If the sectionObject parameter is an Area object, an Areas collection, or an area name, the height of all sections in the Area or Areas collection will be set to minimum. If the sectionObject parameter is a Section object, a Sections collection, or a section name, the height of each section will be set to minimum. If the sections parameter is AreaSectionKind object, the sections contained in the areas of the type specified by the enumerated constant will have their height set to minimum.

Example:

This sample shows how to set the height of all specified sections to a minimum value. Each section belongs to a particular report area and can contain different types of report objects. For more information on areas and sections, see the Crystal Reports Online Help.

 ReportDefController reportDefController = clientDoc.getReportDefController();
 ReportSectionController reportSectionController = reportDefController.getReportSectionController();
 reportSectionController.autoFitSections( AreaSectionKind.detail );
 

Parameters:
sectionObject - The sections for which you want to set the height to minimum. This parameter can be empty or NULL, an Area object, a Areas collection, a Section object, a Sections collection, a string representation of the area or section name, or AreaSectionKind object.
Throws:
ReportSDKException
See Also:
AreaSectionKind, Area