Table of Contents

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

tableId string

The identifier of the spreadsheet.

firstRowAreColumnNames bool

If set to true, the first row of each sheet contains column names.

sheetNames ReadOnlyCollection<string>

A collection of sheet names to include as tables. If null, all sheets are included.

apiKey string

The API key used to access the public spreadsheet. This parameter must be provided.

Exceptions

ArgumentException

Thrown if apiKey is 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

tableId string

The identifier of the spreadsheet.

firstRowAreColumnNames bool

If set to true, the first row of each sheet contains column names.

sheetNames ReadOnlyCollection<string>

A collection of sheet names to include as tables. If null, all sheets are included.

refreshToken string

The OAuth refresh token.

clientId string

The OAuth client identifier.

clientSecret string

The 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

tableId string

The identifier of the spreadsheet.

firstRowAreColumnNames bool

If set to true, the first row of each sheet contains column names.

apiKey string

The 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

tableId string

The identifier of the spreadsheet.

firstRowAreColumnNames bool

If set to true, the first row of each sheet contains column names.

refreshToken string

The OAuth refresh token.

clientId string

The OAuth client identifier.

clientSecret string

The OAuth client secret.

Properties

ApiKey

Gets the API key used for accessing public spreadsheets.

public string ApiKey { get; }

Property Value

string

ClientId

Gets the client identifier used for OAuth authorization.

public string ClientId { get; }

Property Value

string

FirstRowContainsColumnNames

Gets a value indicating whether the first row of each sheet contains column names.

public bool FirstRowContainsColumnNames { get; }

Property Value

bool

RefreshToken

Gets the refresh token used for OAuth authorization.

public string RefreshToken { get; }

Property Value

string

SheetNames

Gets the names of sheets that should be included as tables.

public ReadOnlyCollection<string> SheetNames { get; }

Property Value

ReadOnlyCollection<string>

TableId

Gets the table identifier of the spreadsheet.

public string TableId { get; }

Property Value

string