aspose.cells
Class DocumentProperty

Represents a custom or built-in document property.

Example:

//Instantiate a Workbook object
$workbook = new cells\Workbook("Book1.xls");
//Retrieve a list of all custom document properties of the Excel file
$customProperties = $workbook->getWorksheets()->getCustomDocumentProperties();
//Accessng a custom document property by using the property index
$customProperty1 = $customProperties->get(0);
//Accessng a custom document property by using the property name
$customProperty2 = $customProperties->get("Owner");

Property Getters/Setters Summary
functionisGeneratedName()
           Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API.
functionisLinkedToContent()
           Indicates whether this property is linked to content
functiongetName()
           Returns the name of the property.
functiongetSource()
           The linked content source.
functiongetType()
           Gets the data type of the property. The value of the property is PropertyType integer constant.
functiongetValue()
functionsetValue(value)
           Gets or sets the value of the property.
 
Method Summary
functiontoBool()
           Returns the property value as bool.
functiontoDateTime()
           Returns the property value as DateTime in local timezone.
functiontoDouble()
           Returns the property value as double.
functiontoInt()
           Returns the property value as integer.
functiontoString()
           Returns the property value as a string.
 

Property Getters/Setters Detail

getName : String 

function getName()
Returns the name of the property.

getValue/setValue : Object 

function getValue() / function setValue(value)
Gets or sets the value of the property.

isLinkedToContent : boolean 

function isLinkedToContent()
Indicates whether this property is linked to content

getSource : String 

function getSource()
The linked content source.

getType : Number 

function getType()
Gets the data type of the property. The value of the property is PropertyType integer constant.

isGeneratedName : boolean 

function isGeneratedName()
Returns true if this property does not have a name in the OLE2 storage and a unique name was generated only for the public API.

Method Detail

toString

function toString()
Returns the property value as a string.

Converts a number property using Object.ToString(). Converts a boolean property into "Y" or "N". Converts a date property into a short date string.


toInt

function toInt()
Returns the property value as integer. Throws an exception if the property type is not PropertyType.Number.

toDouble

function toDouble()
Returns the property value as double. Throws an exception if the property type is not PropertyType.Float.

toDateTime

function toDateTime()
Returns the property value as DateTime in local timezone.

Throws an exception if the property type is not PropertyType.Date.


toBool

function toBool()
Returns the property value as bool.

Throws an exception if the property type is not PropertyType.Boolean.


See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.