GSpreadsheets Class
Properties Methods Events Configuration Settings Errors
The GSpreadsheets component provides a simple interface to manage spreadsheets.
Class Name
InGoogle_GSpreadsheets
Procedural Interface
ingoogle_gspreadsheets_open(); ingoogle_gspreadsheets_close($res); ingoogle_gspreadsheets_register_callback($res, $id, $function); ingoogle_gspreadsheets_get_last_error($res); ingoogle_gspreadsheets_get_last_error_code($res); ingoogle_gspreadsheets_set($res, $id, $index, $value); ingoogle_gspreadsheets_get($res, $id, $index); ingoogle_gspreadsheets_do_addqueryparam($res, $name, $value); ingoogle_gspreadsheets_do_config($res, $configurationstring); ingoogle_gspreadsheets_do_createrow($res); ingoogle_gspreadsheets_do_createworksheet($res); ingoogle_gspreadsheets_do_deleterow($res); ingoogle_gspreadsheets_do_deleteworksheet($res); ingoogle_gspreadsheets_do_querycells($res); ingoogle_gspreadsheets_do_queryrows($res); ingoogle_gspreadsheets_do_queryspreadsheets($res); ingoogle_gspreadsheets_do_queryworksheets($res); ingoogle_gspreadsheets_do_updatecell($res); ingoogle_gspreadsheets_do_updaterow($res); ingoogle_gspreadsheets_do_updateworksheet($res);
Remarks
GSpreadsheets allows you to easily create, query, update, and delete spreadsheet information.
Before using the class you must have a valid Google account.
Once you have a valid Google account, set User and Password to your e-mail address and password before calling any of the methods.
The class allows you to create, modify, and delete worksheets and rows in the spreadsheet. You can also modify individual cell contents. This is achieved through the following methods:
To perform a query on the cells, rows, spreadsheets, or worksheets first use AddQueryParam to build the list of parameters to use when querying (if any). Then call one of the following methods:
For more information please see the description for each of the individual methods.
Note: The Google Spreadsheets API supports fetching a list of spreadsheets and editing their contents for the authenticated user. However the Google Spreadsheets API does not allow you to create or delete spreadsheets. For these operations, you must use the GDocuments class.
This service supports authentication via OAuth 2.0. First, perform OAuth authentication using the OAuth class or
a separate process. Once complete you should have an authorization string which looks like:
Bearer ya29.AHES6ZSZEJzATdZYjeihDn5W-VrXSsxEZu5p0pclxGdKKQAssign this value to the Authorization property before attempting any operations. Consult the Google documentation for this particular service for more information about supported scope values and more details on OAuth authentication.
Alternatively, this service also supports Client Login authentication by setting the User and Password configuration settings.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
Authorization | OAuth 2.0 Authorization Token. |
CellCount | The number of cells contained within a Google Worksheet Cell feed. |
CellDateUpdated | Contains the date that a cell was updated. |
CellDetailColumn | This property contains the column index for the current cell. |
CellDetailInputValue | This property contains the input (actual physically entered) value of the current cell. |
CellDetailNumericValue | This property contains the numeric (computed) value of the current cell. |
CellDetailRow | This property contains the row index for the current cell. |
CellETag | The ETag of the current cell in a Google Worksheet Cell feed. |
CellIndex | The index of the current cell in a Google Worksheet Cell feed. |
CellPropertiesCount | The number of records in the CellProperties arrays. |
CellPropertiesAttributes | A space-separated list of attributes (name-value pairs) contained within a Google Data entry element. |
CellPropertiesName | The Name of the Google data entry element. |
CellPropertiesValue | The Value of the Google data entry element. |
CellPropertiesValueFormat | The format of the value for the Google Data entry element. |
CellPropertiesXPath | The XPath of the Google data entry element. |
CookieCount | The number of records in the Cookie arrays. |
CookieDomain | The domain of a received cookie. |
CookieExpiration | This property contains an expiration time for the cookie (if provided by the server). |
CookieName | The name of the cookie. |
CookiePath | This property contains a path name to limit the cookie to (if provided by the server). |
CookieSecure | This property contains the security flag of the received cookie. |
CookieValue | This property contains the value of the cookie. |
FeedAuthor | Contains the name and e-mail address of the author. |
FeedAuthorUri | This property contains the URI of the author. |
FeedCategoryLabel | This property identifies a human readable label for the category. |
FeedCategoryScheme | This property identifies a categorization scheme. |
FeedCategoryTerm | This property identifies the category to which the entry or feed belongs. |
FeedEditURL | This property contains the URL of the edit link (rel='edit'). |
FeedETag | This property contains the ETag of the Google Data feed. |
FeedGenerator | This property identifies the generator of the feed. |
FeedId | The Id conveys a permanent, universally unique identifier for an entry or feed. |
FeedNextURL | This property contains the URL of the next link (rel='next'). |
FeedOpenSearchItemsPerPage | The maximum number of items that appear on one page. |
FeedOpenSearchStartIndex | The 1-based index of the first result. |
FeedOpenSearchTotalResults | The total number of search results for the query. |
FeedPreviousURL | This property contains the URL of the previous link (rel='previous'). |
FeedSelfURL | This property contains the URL of the self link (rel='self'). |
FeedTitle | This contains the title of the current Atom Feed. |
FeedUpdated | Date-time when the feed was updated. |
FirewallAutoDetect | This property tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallType | This property determines the type of firewall to connect through. |
FirewallHost | This property contains the name or IP address of firewall (optional). |
FirewallPassword | This property contains a password if authentication is to be used when connecting through the firewall. |
FirewallPort | This property contains the TCP port for the firewall Host . |
FirewallUser | This property contains a user name if authentication is to be used connecting through a firewall. |
Idle | The current status of the component. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
OtherHeaders | Other headers as determined by the user (optional). |
ParsedHeaderCount | The number of records in the ParsedHeader arrays. |
ParsedHeaderField | This property contains the name of the HTTP header (same case as it is delivered). |
ParsedHeaderValue | This property contains the header contents. |
ProxyAuthScheme | This property is used to tell the component which type of authorization to perform when connecting to the proxy. |
ProxyAutoDetect | This property tells the component whether or not to automatically detect and use proxy system settings, if available. |
ProxyPassword | This property contains a password if authentication is to be used for the proxy. |
ProxyPort | This property contains the TCP port for the proxy Server (default 80). |
ProxyServer | If a proxy Server is given, then the HTTP request is sent to the proxy instead of the server otherwise specified. |
ProxySSL | This property determines when to use SSL for the connection to the proxy. |
ProxyUser | This property contains a user name, if authentication is to be used for the proxy. |
QueryParamsCount | The number of records in the QueryParams arrays. |
QueryParamsName | This property contains the name of the parameter to be used in a Query request. |
QueryParamsValue | This property contains the value of the parameter to be used in a Query request. |
RowCount | The number of rows contained within a Google Worksheet Row feed. |
RowDateUpdated | Contains the date that a row was updated. |
RowDetailCount | The number of records in the RowDetail arrays. |
RowDetailHeader | This property contains the header name. |
RowDetailValue | This property contains the value of the current cell in the row. |
RowETag | The ETag of the current row in a Google Worksheet Row feed. |
RowIndex | The index of the current row in a Google Worksheet Row feed. |
RowPropertiesCount | The number of records in the RowProperties arrays. |
RowPropertiesAttributes | A space-separated list of attributes (name-value pairs) contained within a Google Data entry element. |
RowPropertiesName | The Name of the Google data entry element. |
RowPropertiesValue | The Value of the Google data entry element. |
RowPropertiesValueFormat | The format of the value for the Google Data entry element. |
RowPropertiesXPath | The XPath of the Google data entry element. |
SpreadsheetAuthor | Contains the name and e-mail address of the author that created the spreadsheet. |
SpreadsheetCount | The number of spreadsheets contained within a Google Spreadsheet feed. |
SpreadsheetDateUpdated | Contains the date that a spreadsheet was updated. |
SpreadsheetETag | The ETag of the current spreadsheet in a Google Spreadsheet feed. |
SpreadsheetIndex | The index of the current spreadsheet in a Google Spreadsheet feed. |
SpreadsheetPropertiesCount | The number of records in the SpreadsheetProperties arrays. |
SpreadsheetPropertiesAttributes | A space-separated list of attributes (name-value pairs) contained within a Google Data entry element. |
SpreadsheetPropertiesName | The Name of the Google data entry element. |
SpreadsheetPropertiesValue | The Value of the Google data entry element. |
SpreadsheetPropertiesValueFormat | The format of the value for the Google Data entry element. |
SpreadsheetPropertiesXPath | The XPath of the Google data entry element. |
SpreadsheetTitle | Contains the title of the spreadsheet. |
SSLAcceptServerCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertEncoded | The certificate (PEM/base64 encoded). |
SSLCertStore | The name of the certificate store for the client certificate. |
SSLCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
SSLCertStoreType | The type of certificate store for this certificate. |
SSLCertSubject | The subject of the certificate used for client authentication. |
SSLServerCertEncoded | The certificate (PEM/base64 encoded). |
Timeout | A timeout for the component. |
WorksheetColumnCount | Contains the number of columns within the current worksheet. |
WorksheetCount | The number of worksheets contained within a Google Worksheet feed. |
WorksheetDateUpdated | Contains the date that a worksheet was updated. |
WorksheetETag | The ETag of the current worksheet in a Google Worksheet feed. |
WorksheetIndex | The index of the current worksheet in a Google Worksheet feed. |
WorksheetPropertiesCount | The number of records in the WorksheetProperties arrays. |
WorksheetPropertiesAttributes | A space-separated list of attributes (name-value pairs) contained within a Google Data entry element. |
WorksheetPropertiesName | The Name of the Google data entry element. |
WorksheetPropertiesValue | The Value of the Google data entry element. |
WorksheetPropertiesValueFormat | The format of the value for the Google Data entry element. |
WorksheetPropertiesXPath | The XPath of the Google data entry element. |
WorksheetRowCount | Contains the number of rows within the current worksheet. |
WorksheetTitle | Contains the title of the worksheet. |
AttrCount | The number of records in the Attr arrays. |
AttrName | The Name provides the local name (without prefix) of the attribute. |
AttrNamespace | Attribute namespace. |
AttrPrefix | Attribute prefix (if any). |
AttrValue | Attribute value. |
XChildrenCount | The number of records in the XChild arrays. |
XChildName | The Name property provides the local name (without prefix) of the element. |
XChildNamespace | Namespace of the element. |
XChildPrefix | Prefix of the element (if any). |
XChildXText | The inner text of the element. |
XElement | The name of the current element. |
XNamespace | The namespace of the current element. |
XParent | The parent of the current element. |
XPath | Provides a way to point to a specific element in the document. |
XPrefix | The prefix of the current element. |
XSubTree | A snapshot of the current element in the document. |
XText | The text of the current element. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
AddQueryParam | Adds a query parameter to the QueryParams properties. |
Config | Sets or retrieves a configuration setting . |
CreateRow | Creates a new row within the specified Google Worksheet. |
CreateWorksheet | Creates a new worksheet within the specified Google Spreadsheets feed. |
DeleteRow | Deletes a row within a Google Worksheet. |
DeleteWorksheet | Deletes a worksheet within a Google Worksheets feed. |
QueryCells | Queries a Google Worksheet Cells feed using the specified parameters. |
QueryRows | Queries a Google Worksheet Rows feed using the specified parameters. |
QuerySpreadsheets | Queries a Google Spreadsheets feed using the specified parameters. |
QueryWorksheets | Queries a Google Worksheets feed using the specified parameters. |
UpdateCell | Updates a cell within a Google Worksheet. |
UpdateRow | Updates a row within a Google Worksheet. |
UpdateWorksheet | Updates a Google Worksheet. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
CellList | Fired once for each cell entry retrieved. |
Connected | Fired immediately after a connection completes (or fails). |
Disconnected | Fired when a connection is closed. |
EndTransfer | Fired when a document finishes transferring. |
Error | Information about errors during data delivery. |
Header | Fired every time a header line comes in. |
RowList | Fired once for each row entry retrieved. |
SetCookie | Fired for every cookie set by the server. |
SpreadsheetList | Fired once for each spreadsheet entry retrieved. |
SSLServerAuthentication | Fired after the server presents its certificate to the client. |
SSLStatus | Shows the progress of the secure connection. |
StartTransfer | Fired when a document starts transferring (after the headers). |
Status | Fired when the HTTP status line is received from the server. |
Transfer | Fired while a document transfers (delivers document). |
UpdateACLResponse | Fired once for each entry returned after updating a document ACL. |
WorksheetList | Fired once for each worksheet entry retrieved. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
CellValue | The value in the cell. |
RowHeaderCount | Total number of cells in the header row. |
RowHeader[i] | Value of the row header cell. |
SetRowHeaders | Action to create and insert row header values. |
AccountType | The type of account to request authorization for. |
CaptchaToken | The token received from Google during a CAPTCHA challenge. |
CaptchaURL | The image URL received from Google during a CAPTCHA challenge. |
CaptchaValue | The value given by the person responding to the CAPTCHA challenge. |
DateFormat | The format string to be used for formatting the DateTime values received from the server. |
NameAndEmailFormat | Determines how the data of the name and e-mail properties will be formatted. |
Source | The source parameter value for Google ClientLogin. |
TransferredData | The contents of the last response from the server. |
TransferredHeaders | The full set of headers as received from the server. |
ServiceName | The name of the Google Data service. |
User | The user's email address used for Client Login authentication. |
Password | The user's password used for Client Login authentication. |
AcceptEncoding | Used to tell the server which types of content encodings the client supports. |
AllowHTTPCompression | This property enables HTTP compression for receiving data. |
AllowIdenticalRedirectURL | Allow redirects to the same URL. |
Append | Whether to append data to LocalFile. |
Authorization | The Authorization string to be sent to the server. |
BytesTransferred | Contains the number of bytes transferred in the response data. |
EncodeURL | If set to true the URL will be encoded by the component. |
FollowRedirects | Determines what happens when the server issues a redirect. |
GetOn302Redirect | If set to true the component will perform a GET on the new location. |
HTTPVersion | The version of HTTP used by the component. |
IfModifiedSince | A date determining the maximum age of the desired document. |
KeepAlive | Determines whether the HTTP connection is closed after completion of the request. |
MaxRedirectAttempts | Limits the number of redirects that are followed in a request. |
OtherHeaders | Other headers as determined by the user (optional). |
ProxyAuthorization | The authorization string to be sent to the proxy server. |
ProxyAuthScheme | The authorization scheme to be used for the proxy. |
ProxyPassword | A password if authentication is to be used for the proxy. |
ProxyPort | Port for the proxy server (default 80). |
ProxyServer | Name or IP address of a proxy server (optional). |
ProxyUser | A user name if authentication is to be used for the proxy. |
TransferredDataLimit | The maximum number of incoming bytes to be stored by the component. |
TransferredHeaders | The full set of headers as received from the server. |
UseChunkedEncoding | Enables or Disables HTTP chunked encoding for transfers. |
ChunkSize | Specifies the chunk size in bytes when using chunked encoding. |
UserAgent | Information about the user agent (browser). |
KerberosSPN | The Service Principal Name for the Kerberos Domain Controller. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The TCP port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
RecordLength | The length of received data records. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
OpenSSLCADir | The path to a directory containing CA certificates. |
OpenSSLCAFile | Name of the file containing the list of CA's trusted by your application. |
OpenSSLCipherList | A string that controls the ciphers to be used by SSL. |
OpenSSLPrngSeedData | The data to seed the pseudo random number generator (PRNG). |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
CodePage | The system code page used for Unicode to Multibyte translations. |