com.f1j.ss.pivot
Interface PivotRange


public interface PivotRange
extends Lockable

this interface defines the PivotRange API.


Inner Class Summary
static class PivotRange.EArea
           
static class PivotRange.EAutoFormat
           
 
Method Summary
 Field addCalculatedField(java.lang.String name, java.lang.String formula)
          Creates a new calculated field with the given name and formula in US English.
 Field addCalculatedFieldLocal(java.lang.String name, java.lang.String formula)
          Creates a new calculated field with the given name and formula in user's language.
 PivotRange applyDefinition(PivotRangeDef definition)
          Applies the specified definition to this PivotRange and returns a reference to a new PivotRange if the definition causes the PivotRange to move to a new sheet.
 void checkCanAddCalculatedField()
          throws exception if calculated fields are not allowed.
 void checkIsValidPivotRange()
          Check for valid PivotRange and signals if invalid.
 void deleteCalculatedField(java.lang.String name)
          Deletes the calculated field with the given name.
 void deleteFormula(int index)
          Deletes the formula at the specified index.
 void deleteFormula(int index, boolean updatePivotRanges)
          Deletes the formula at the specified index.
 Area getArea(PivotRange.EArea eArea)
          Returns the Area object associated with the specified EArea enumeration.
 PivotRange.EAutoFormat getAutoFormat()
          Returns which AutoFormat is currently applied.
 Book getBook()
          Returns the book that contains this PivotRange.
 Range getBounds()
          Returns the bounds of this PivotRange.
 Field getCalculatedField(int index)
          Returns the calculated field at the specified index.
 int getCalculatedFieldCount()
          Returns the number of calculated fields in the PivotRange.
 Field getDataField()
          Returns the Data Field or null if data field not present.
 PivotRangeDef getDefinition()
          Returns the definition for this PivotRange.
 Field getField(int index)
          Returns the Field located at the specified index.
 Field getField(java.lang.String name)
          Returns the Field with the specified name.
 int getFieldCount()
          Returns the number of Fields in the PivotRange.
 java.lang.String getFormula(int index)
          Returns the formula located at the specified index in the user's language.
 int getFormulaCount()
          Returns the number of formulas in the PivotRange.
 java.lang.String getFormulaLocal(int index)
          Returns the formula located at the specified index in US English.
 java.lang.String getFormulaName(int index)
          Returns the name of the formula located at the specified index.
 java.lang.String getName()
          Returns the name of the PivotRange.
 boolean isDrillDownEnabled()
          Indicates if detail about summary fields can be shown.
 Sheet listFormulas()
          Creates a list of calculated PivotRange items and fields on a separate worksheet.
 void moveFormula(int currentIndex, int newIndex)
          Moves the specified formula to a new index.
 void moveFormula(int currentIndex, int newIndex, boolean updatePivotRanges)
          Moves the specified formula to a new index.
 void refresh()
          this will update the PivotRange with the latest information from the data source.
 void setAutoFormat(PivotRange.EAutoFormat format)
          Updates the PivotRange to use the specified AutoFormat.
 
Methods inherited from interface com.f1j.util.Lockable
getLock, releaseLock
 

Method Detail

addCalculatedField

public Field addCalculatedField(java.lang.String name,
                                java.lang.String formula)
                         throws DataConflictException,
                                DuplicateNameException,
                                InvalidPivotRangeException,
                                F1Exception
Creates a new calculated field with the given name and formula in US English. if a calculated field with this name already exists, then the new formula is applied.
Parameters:
name - The name of the calculated field.
formula - The formula for the calculated field.
Returns:
The calculated field.
Throws:
AccessDeniedException - if the sheet is protected.
DataConflictException - if PivotRange is invalid.
DuplicateNameException - if a non-calculated field already exists with the specified name.
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

addCalculatedFieldLocal

public Field addCalculatedFieldLocal(java.lang.String name,
                                     java.lang.String formula)
                              throws AccessDeniedException,
                                     DataConflictException,
                                     DuplicateNameException,
                                     InvalidPivotRangeException,
                                     F1Exception
Creates a new calculated field with the given name and formula in user's language. if a calculated field with this name already exists, then the new formula is applied.
Parameters:
name - The name of the calculated field.
formula - The formula for the calculated field.
Returns:
The calculated field.
Throws:
AccessDeniedException - if the sheet is protected.
DataConflictException - if the PivotRange would become too large.
DuplicateNameException - if a calculated field already exists with the specified name.
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

applyDefinition

public PivotRange applyDefinition(PivotRangeDef definition)
                           throws DuplicateNameException,
                                  InvalidPivotRangeException,
                                  InvalidArgumentException,
                                  InvalidDataException,
                                  F1Exception
Applies the specified definition to this PivotRange and returns a reference to a new PivotRange if the definition causes the PivotRange to move to a new sheet.
Parameters:
definition - The definition that should be applied to the PivotRange.
Returns:
The PivotRange that was created or modified.
Throws:
DuplicateNameException - if PivotRange already exists with specified name.
InvalidPivotRangeException - if PivotRange is invalid.
InvalidArgumentException - if definition is invalid or the data source info is invalid.
InvalidDataException - if data is invalid
F1Exception - if an error occurs.
Since:
11.0
See Also:
PivotRangeDef

checkCanAddCalculatedField

public void checkCanAddCalculatedField()
                                throws InvalidPivotRangeException,
                                       F1Exception
throws exception if calculated fields are not allowed.
Throws:
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0

checkIsValidPivotRange

public void checkIsValidPivotRange()
                            throws InvalidPivotRangeException,
                                   F1Exception
Check for valid PivotRange and signals if invalid.
Throws:
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0

deleteCalculatedField

public void deleteCalculatedField(java.lang.String name)
                           throws InvalidPivotRangeException,
                                  F1Exception
Deletes the calculated field with the given name.
Parameters:
name - The name of the calculated field.
Throws:
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0
See Also:
Field

deleteFormula

public void deleteFormula(int index)
                   throws InvalidPivotRangeException,
                          F1Exception
Deletes the formula at the specified index.
Parameters:
index - Index to formula to be deleted. the formula is deleted.
Throws:
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0

deleteFormula

public void deleteFormula(int index,
                          boolean updatePivotRanges)
                   throws InvalidPivotRangeException,
                          F1Exception
Deletes the formula at the specified index. Can also specify whether PivotRanges should be updated immediately upon completion of this operation. if an immediate update is not necessary, the PivotRanges will automatically updated at a future scheduled time.
Parameters:
index - Index to formula to be deleted.
updatePivotRanges - true = if wants all related PivotRanges to be updated immediately upon completion.
Throws:
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0

getArea

public Area getArea(PivotRange.EArea eArea)
Returns the Area object associated with the specified EArea enumeration.
Parameters:
eArea - An EArea enumeration.
Returns:
Area associated with EArea.
Since:
11.0
See Also:
Area, PivotRange.EArea

getAutoFormat

public PivotRange.EAutoFormat getAutoFormat()
Returns which AutoFormat is currently applied.
Returns:
The AutoFormat that is currently applied.
Since:
11.0
See Also:
PivotRange.EAutoFormat

getBook

public Book getBook()
Returns the book that contains this PivotRange.
Returns:
The book that contains this PivotRange.
Since:
11.0
See Also:
Book

getBounds

public Range getBounds()
Returns the bounds of this PivotRange.
Returns:
The bounds of this PivotRange.
Since:
11.0
See Also:
Book

getCalculatedField

public Field getCalculatedField(int index)
Returns the calculated field at the specified index.
Parameters:
index - Index to the calculated field.
Returns:
Calculated Field located at specified index.
Since:
11.0
See Also:
Field

getCalculatedFieldCount

public int getCalculatedFieldCount()
Returns the number of calculated fields in the PivotRange.
Returns:
Number of calculated fields in the PivotRange.
Since:
11.0
See Also:
Field

getDataField

public Field getDataField()
Returns the Data Field or null if data field not present.
Returns:
The Data Field.
Since:
11.0
See Also:
Field

getDefinition

public PivotRangeDef getDefinition()
Returns the definition for this PivotRange.
Returns:
The definition for this PivotRange.
Since:
11.0
See Also:
PivotRangeDef

getField

public Field getField(int index)
Returns the Field located at the specified index.
Parameters:
index - Index to the desired Field.
Returns:
Field located at specified index.
Since:
11.0
See Also:
Field

getField

public Field getField(java.lang.String name)
Returns the Field with the specified name.
Parameters:
name - Name of the desired Field.
Returns:
Field with specified name.
Since:
11.0
See Also:
Field

getFieldCount

public int getFieldCount()
Returns the number of Fields in the PivotRange.
Returns:
Number of Fields in the PivotRange.
Since:
11.0
See Also:
Field

getFormula

public java.lang.String getFormula(int index)
                            throws InvalidArgumentException,
                                   F1Exception
Returns the formula located at the specified index in the user's language.
Parameters:
index - Index to the desired formula.
Returns:
Formula located at specified index.
Throws:
InvalidArgumentException - if the index is invalid.
F1Exception - if an error occurs.
Since:
11.0

getFormulaLocal

public java.lang.String getFormulaLocal(int index)
Returns the formula located at the specified index in US English.
Parameters:
index - Index to the desired formula.
Returns:
Formula located at specified index.
Since:
11.0

getFormulaCount

public int getFormulaCount()
Returns the number of formulas in the PivotRange.
Returns:
Number of formulas in the PivotRange.
Since:
11.0

getFormulaName

public java.lang.String getFormulaName(int index)
Returns the name of the formula located at the specified index.
Parameters:
index - Index to the desired formula.
Returns:
Name of formula located at specified index.
Since:
11.0

getName

public java.lang.String getName()
Returns the name of the PivotRange.
Returns:
The name of the PivotRange.
Since:
11.0

isDrillDownEnabled

public boolean isDrillDownEnabled()
Indicates if detail about summary fields can be shown.
Returns:
boolean. true = if can show detail on summary fields.
Since:
11.0

listFormulas

public Sheet listFormulas()
                   throws F1Exception
Creates a list of calculated PivotRange items and fields on a separate worksheet.
Returns:
The sheet containing the listed formulas.
Throws:
F1Exception - if formulas cannot be listed.
Since:
11.0

refresh

public void refresh()
             throws AccessDeniedException,
                    DataConflictException,
                    InvalidDataException,
                    F1Exception
this will update the PivotRange with the latest information from the data source.
Throws:
AccessDeniedException - if the sheet is protected.
DataConflictException - if PivotRange is invalid.
F1Exception - if an error occurs.
InvalidDataException - if data is invalid.
Since:
11.0

moveFormula

public void moveFormula(int currentIndex,
                        int newIndex)
                 throws InvalidArgumentException,
                        InvalidPivotRangeException,
                        F1Exception
Moves the specified formula to a new index.
Parameters:
currentIndex - Index to the formula to be moved.
newIndex - The new location for the specified formula.
Throws:
InvalidArgumentException - if an argument is invalid.
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0

moveFormula

public void moveFormula(int currentIndex,
                        int newIndex,
                        boolean updatePivotRanges)
                 throws InvalidArgumentException,
                        InvalidPivotRangeException,
                        F1Exception
Moves the specified formula to a new index. Can also specify whether PivotRanges should be updated immediately upon completion of this operation. if an immediate update is not necessary, the PivotRanges will automatically updated at a future scheduled time.
Parameters:
currentIndex - Index to the formula to be moved.
newIndex - The new location for the specified formula.
updatePivotRanges - true = if wants all related PivotRanges to be updated upon completion.
Throws:
InvalidArgumentException - if an argument is invalid.
InvalidPivotRangeException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0

setAutoFormat

public void setAutoFormat(PivotRange.EAutoFormat format)
                   throws AccessDeniedException,
                          DataConflictException,
                          F1Exception
Updates the PivotRange to use the specified AutoFormat.
Parameters:
format - The AutoFormat to be applied.
Throws:
AccessDeniedException - if the sheet is protected.
DataConflictException - if PivotRange is invalid.
F1Exception - if an error occurs.
Since:
11.0
See Also:
PivotRange.EAutoFormat