Class GoogleSpreadsheetsDataProvider
- Namespace
- combit.Reporting.DataProviders
- Assembly
- combit.ListLabel31.CrossPlatform.dll
Provides a data provider implementation for Google Spreadsheets.
public sealed class GoogleSpreadsheetsDataProvider : IDataProvider
- Inheritance
-
GoogleSpreadsheetsDataProvider
- Implements
- Inherited Members
Remarks
This provider retrieves spreadsheet data using the Google Sheets API and exposes each sheet as a table.
Constructors
GoogleSpreadsheetsDataProvider(string, bool, ReadOnlyCollection<string>, string)
Initializes a new instance of the GoogleSpreadsheetsDataProvider class for a public spreadsheet (without OAuth authorization).
public GoogleSpreadsheetsDataProvider(string tableId, bool firstRowAreColumnNames, ReadOnlyCollection<string> sheetNames, string apiKey)
Parameters
tableIdstringThe identifier of the spreadsheet.
firstRowAreColumnNamesboolIf set to
true, the first row of each sheet contains column names.sheetNamesReadOnlyCollection<string>A collection of sheet names to include as tables. If
null, all sheets are included.apiKeystringThe API key used to access the public spreadsheet. This parameter must be provided.
Exceptions
- ArgumentException
Thrown if
apiKeyis empty.
GoogleSpreadsheetsDataProvider(string, bool, ReadOnlyCollection<string>, string, string, string)
Initializes a new instance of the GoogleSpreadsheetsDataProvider class using OAuth authorization.
public GoogleSpreadsheetsDataProvider(string tableId, bool firstRowAreColumnNames, ReadOnlyCollection<string> sheetNames, string refreshToken, string clientId, string clientSecret)
Parameters
tableIdstringThe identifier of the spreadsheet.
firstRowAreColumnNamesboolIf set to
true, the first row of each sheet contains column names.sheetNamesReadOnlyCollection<string>A collection of sheet names to include as tables. If
null, all sheets are included.refreshTokenstringThe OAuth refresh token.
clientIdstringThe OAuth client identifier.
clientSecretstringThe OAuth client secret.
GoogleSpreadsheetsDataProvider(string, bool, string)
Initializes a new instance of the GoogleSpreadsheetsDataProvider class for a public spreadsheet (without OAuth authorization).
public GoogleSpreadsheetsDataProvider(string tableId, bool firstRowAreColumnNames, string apiKey)
Parameters
tableIdstringThe identifier of the spreadsheet.
firstRowAreColumnNamesboolIf set to
true, the first row of each sheet contains column names.apiKeystringThe API key used to access the public spreadsheet. This parameter must be provided.
GoogleSpreadsheetsDataProvider(string, bool, string, string, string)
Initializes a new instance of the GoogleSpreadsheetsDataProvider class using OAuth authorization.
public GoogleSpreadsheetsDataProvider(string tableId, bool firstRowAreColumnNames, string refreshToken, string clientId, string clientSecret)
Parameters
tableIdstringThe identifier of the spreadsheet.
firstRowAreColumnNamesboolIf set to
true, the first row of each sheet contains column names.refreshTokenstringThe OAuth refresh token.
clientIdstringThe OAuth client identifier.
clientSecretstringThe OAuth client secret.
Properties
ApiKey
Gets the API key used for accessing public spreadsheets.
public string ApiKey { get; }
Property Value
ClientId
Gets the client identifier used for OAuth authorization.
public string ClientId { get; }
Property Value
FirstRowContainsColumnNames
Gets a value indicating whether the first row of each sheet contains column names.
public bool FirstRowContainsColumnNames { get; }
Property Value
RefreshToken
Gets the refresh token used for OAuth authorization.
public string RefreshToken { get; }
Property Value
SheetNames
Gets the names of sheets that should be included as tables.
public ReadOnlyCollection<string> SheetNames { get; }
Property Value
TableId
Gets the table identifier of the spreadsheet.
public string TableId { get; }