Table of Contents

Class OpenBiApiClientDataProviderExtensions

Namespace
BiExcellence.OpenBi.Api.DataProviders
Assembly
BiExcellence.OpenBi.Api.Client.dll

Extension methods for the /dataproviders and /chartdefinitions REST APIs - the reporting engine.

public static class OpenBiApiClientDataProviderExtensions
Inheritance
object
OpenBiApiClientDataProviderExtensions

Remarks

A dataprovider is session state, not a stored row: its id is the name it has inside the caller's own session, and it comes into existence by validating a connection template (OpenBiApiClientConnectionTemplateExtensions.ValidateConnectionTemplateAsync). The usual flow is validate, OpenDataProviderAsync(IOpenBiApiClient, string, OpenDataProviderRequest, CancellationToken), GetDataProviderViewAsync(IOpenBiApiClient, string, CancellationToken), change the definition, execute, read the grid - and DeleteDataProviderAsync when done, which DataProviderView does on dispose.

Plan values are buffered server-side: SetDataProviderPlanValueAsync(IOpenBiApiClient, string, SetDataProviderPlanValueRequest, CancellationToken) writes into the buffer, SaveDataProviderPlanValuesAsync(IOpenBiApiClient, string, CancellationToken) writes the buffer to the source and ResetDataProviderPlanBufferAsync(IOpenBiApiClient, string, CancellationToken) throws it away.

Methods

CreateDataProviderCommentAsync(IOpenBiApiClient, string, CreateDataProviderCommentRequest, CancellationToken)

Writes a comment against a cell of the grid. The comments come back from GetDataProviderTextsAsync(IOpenBiApiClient, string, CancellationToken) along with whatever else the source attaches to the context.

public static Task<DataProviderComment> CreateDataProviderCommentAsync(this IOpenBiApiClient client, string dataProviderName, CreateDataProviderCommentRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
request CreateDataProviderCommentRequest
cancellationToken CancellationToken

Returns

Task<DataProviderComment>

CreateDataProviderDefinitionAsync(IOpenBiApiClient, string, CreateDataProviderDefinitionRequest, CancellationToken)

Builds a dataprovider from a definition rather than from a source object, and stores it as a view.

public static Task<SavedDataProviderView> CreateDataProviderDefinitionAsync(this IOpenBiApiClient client, string dataProviderName, CreateDataProviderDefinitionRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
request CreateDataProviderDefinitionRequest
cancellationToken CancellationToken

Returns

Task<SavedDataProviderView>

DeleteDataProviderAsync(IOpenBiApiClient, string, CancellationToken)

Closes the dataprovider and frees the source system connection behind it.

public static Task DeleteDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
cancellationToken CancellationToken

Returns

Task

DeleteDataProviderCommentAsync(IOpenBiApiClient, string, string, CancellationToken)

Removes a data comment. Only its author can, unless the caller is an administrator.

public static Task DeleteDataProviderCommentAsync(this IOpenBiApiClient client, string dataProviderName, string commentId, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
commentId string
cancellationToken CancellationToken

Returns

Task

DeleteDataProviderElementsAsync(IOpenBiApiClient, string, DataProviderElementType, IEnumerable<string>, CancellationToken)

Removes dimensions, key figures or variables from the dataprovider.

public static Task DeleteDataProviderElementsAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderElementType type, IEnumerable<string> elementIds, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

type DataProviderElementType

The kind of element to remove.

elementIds IEnumerable<string>

The ids to remove.

cancellationToken CancellationToken

A cancellation token.

Returns

Task

ExecuteDataProviderAsync(IOpenBiApiClient, string, DataProviderDefinition, IEnumerable<AffectedDataProvider>?, CancellationToken)

Applies a definition and reads the data.

public static Task<DataProviderExecuteResult> ExecuteDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderDefinition definition, IEnumerable<AffectedDataProvider>? affectedDataProviders = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
definition DataProviderDefinition
affectedDataProviders IEnumerable<AffectedDataProvider>
cancellationToken CancellationToken

Returns

Task<DataProviderExecuteResult>

ExecuteDataProviderAsync(IOpenBiApiClient, string, ExecuteDataProviderRequest, CancellationToken)

Applies a definition and reads the data. The definition is applied whole - what is left out of it is removed from the dataprovider.

public static Task<DataProviderExecuteResult> ExecuteDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, ExecuteDataProviderRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

request ExecuteDataProviderRequest

The definition, and what else to re-execute with it.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<DataProviderExecuteResult>

ExportDataProviderDocumentAsync(IOpenBiApiClient, string, DataProviderExportFormat?, string?, CancellationToken)

Renders the executed grid as a document. The caller owns the returned file and has to dispose it.

public static Task<OpenBiApiFile> ExportDataProviderDocumentAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderExportFormat? format = null, string? gridStyleGroupId = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

format DataProviderExportFormat?

The document format. Defaults to Xlsx.

gridStyleGroupId string

The grid style group to render with. Defaults to the default group.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<OpenBiApiFile>

GenerateChartDefinitionAsync(IOpenBiApiClient, GenerateChartDefinitionRequest, CancellationToken)

Stores a chart definition and returns its id, to be passed to the chart data routes as definitionId. The one dataprovider route that is not bound to a session dataprovider.

public static Task<ChartDefinition> GenerateChartDefinitionAsync(this IOpenBiApiClient client, GenerateChartDefinitionRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
request GenerateChartDefinitionRequest
cancellationToken CancellationToken

Returns

Task<ChartDefinition>

GetDataProviderChartDataAsync(IOpenBiApiClient, string, DataProviderChartDataOptions?, string?, string?, CancellationToken)

Reads the executed grid reshaped for charting: points, categories and series instead of cells. With a definitionId the values are rendered into that stored chart definition instead.

public static Task<DataProviderChartData> GetDataProviderChartDataAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderChartDataOptions? options = null, string? definitionId = null, string? description = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

options DataProviderChartDataOptions

How the grid is reshaped.

definitionId string

A stored chart definition to render the values into.

description string

The title to render into that definition.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<DataProviderChartData>

GetDataProviderChartDataAsync(IOpenBiApiClient, string, DataProviderChartDataRequest, CancellationToken)

Renders the executed grid into a chart definition sent in the body - for a definition that is being edited and has not been stored yet.

public static Task<DataProviderChartData> GetDataProviderChartDataAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderChartDataRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
request DataProviderChartDataRequest
cancellationToken CancellationToken

Returns

Task<DataProviderChartData>

GetDataProviderDatabaseMetaAsync(IOpenBiApiClient, string, bool?, CancellationToken)

Reads the tables and views a database-backed dataprovider can read - the metadata needed to write the SQL for CreateDataProviderDefinitionAsync(IOpenBiApiClient, string, CreateDataProviderDefinitionRequest, CancellationToken).

public static Task<DataProviderDatabaseSchema> GetDataProviderDatabaseMetaAsync(this IOpenBiApiClient client, string dataProviderName, bool? refreshMetadata = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

refreshMetadata bool?

Reads the database again instead of answering from the server-side cache.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<DataProviderDatabaseSchema>

GetDataProviderDefinitionAsync(IOpenBiApiClient, string, bool?, CancellationToken)

Reads what the dataprovider currently is: its dimensions, key figures, variables and state.

public static Task<DataProviderDefinition> GetDataProviderDefinitionAsync(this IOpenBiApiClient client, string dataProviderName, bool? withoutHierarchies = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

withoutHierarchies bool?

Leaves the hierarchies a dimension offers out. They are read from the source per dimension, which is the expensive part of this call and is wasted where a caller only wants the layout.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<DataProviderDefinition>

GetDataProviderF4ValuesAsync(IOpenBiApiClient, string, DataProviderF4ValuesRequest, CancellationToken)

Reads the value help under a filter context sent in the body - the variable answers to narrow the values by, where they are not the ones the dataprovider was executed with.

public static Task<DataProviderF4Values> GetDataProviderF4ValuesAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderF4ValuesRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
request DataProviderF4ValuesRequest
cancellationToken CancellationToken

Returns

Task<DataProviderF4Values>

GetDataProviderF4ValuesAsync(IOpenBiApiClient, string, string?, string?, string?, string?, bool?, bool?, CancellationToken)

Reads the values a dimension or a variable can be filtered on, under everything that is filtered already. Exactly one of dimensionId and variableId is given.

public static Task<DataProviderF4Values> GetDataProviderF4ValuesAsync(this IOpenBiApiClient client, string dataProviderName, string? dimensionId = null, string? variableId = null, string? variableLow = null, string? hierarchyName = null, bool? withAttributes = null, bool? withMaps = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

dimensionId string

The dimension to read the values of.

variableId string

The variable to read the values of.

variableLow string

The value to read the text of, for a variable that has no value help.

hierarchyName string

The hierarchy to read the values as a tree from.

withAttributes bool?

Include the dimension's attributes with every value.

withMaps bool?

Include the coordinates of every value.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<DataProviderF4Values>

GetDataProviderGridDataAsync(IOpenBiApiClient, string, int?, int?, int?, int?, int?, int?, bool?, bool?, bool?, CancellationToken)

Reads a window of the executed grid, headers included. The whole grid is returned where no window is given.

public static Task<DataProviderGridData> GetDataProviderGridDataAsync(this IOpenBiApiClient client, string dataProviderName, int? fromRow = null, int? fromCol = null, int? noRows = null, int? noCols = null, int? fromDataRow = null, int? fromDataCol = null, bool? withMaps = null, bool? withTuples = null, bool? suppressRepeatedText = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider.

fromRow int?

The first row of the window, 1-based and counting the header rows.

fromCol int?

The first column of the window, 1-based and counting the header columns.

noRows int?

The number of rows to return.

noCols int?

The number of columns to return.

fromDataRow int?

The first row of the window, 1-based and counting data rows only - the headers come with it.

fromDataCol int?

The first column of the window, 1-based and counting data columns only - the headers come with it.

withMaps bool?

Include the coordinates of every dimension value.

withTuples bool?

Include the row and column tuple every cell sits at.

suppressRepeatedText bool?

Leave a header text out where it repeats the cell above it.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<DataProviderGridData>

GetDataProviderNodesAsync(IOpenBiApiClient, string, bool?, bool?, bool?, bool?, CancellationToken)

Lists what the connected source offers: its cubes, queries and the views stored on them.

public static Task<OpenBiListResult<DataProviderNode>> GetDataProviderNodesAsync(this IOpenBiApiClient client, string dataProviderName, bool? withDashboards = null, bool? withScorecards = null, bool? withKpis = null, bool? withCombined = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider name a validate returned.

withDashboards bool?

Include the stored dashboards.

withScorecards bool?

Include the stored scorecards.

withKpis bool?

Include the stored key performance indicators.

withCombined bool?

Include the combined dataproviders.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<OpenBiListResult<DataProviderNode>>

GetDataProviderTextsAsync(IOpenBiApiClient, string, CancellationToken)

Lists the documents the source system attaches to the dataprovider's context - query documentation, key figure notes and the like. Independent of execute.

public static Task<OpenBiListResult<DataProviderDocument>> GetDataProviderTextsAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<DataProviderDocument>>

GetDataProviderViewAsync(IOpenBiApiClient, string, CancellationToken)

Reads the dataprovider's definition and wraps it in a DataProviderView - a handle that carries the definition as mutable client-side state and closes the dataprovider when it is disposed.

public static Task<DataProviderView> GetDataProviderViewAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
cancellationToken CancellationToken

Returns

Task<DataProviderView>

OpenDataProviderAsync(IOpenBiApiClient, string, DataProviderNode, CancellationToken)

Opens a catalog node on an already validated connection.

public static Task<OpenDataProviderResult> OpenDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, DataProviderNode node, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider name a validate returned.

node DataProviderNode

The node to open, from GetDataProviderNodesAsync(IOpenBiApiClient, string, bool?, bool?, bool?, bool?, CancellationToken).

cancellationToken CancellationToken

A cancellation token.

Returns

Task<OpenDataProviderResult>

Remarks

Only a query the source itself offers goes in Query. A node that came out of stored content - a saved view, a dashboard, a scorecard, a KPI - is opened by the element id its CubeName carries whatever its Type says, because a saved view is typed as a query too. The server tells the two apart the same way, by whether what it is given parses as a GUID.

OpenDataProviderAsync(IOpenBiApiClient, string, OpenDataProviderRequest, CancellationToken)

Opens a cube, query or stored view on an already validated connection. Returns the connections the dataprovider is built on - each one still has to be validated before data can be read.

public static Task<OpenDataProviderResult> OpenDataProviderAsync(this IOpenBiApiClient client, string dataProviderName, OpenDataProviderRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

dataProviderName string

The dataprovider name a validate returned.

request OpenDataProviderRequest

What to open.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<OpenDataProviderResult>

ResetDataProviderPlanBufferAsync(IOpenBiApiClient, string, CancellationToken)

Throws the buffered plan values away, so the grid shows what the source holds again.

public static Task ResetDataProviderPlanBufferAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
cancellationToken CancellationToken

Returns

Task

SaveDataProviderPlanValuesAsync(IOpenBiApiClient, string, CancellationToken)

Writes the buffered plan values to the source system.

public static Task SaveDataProviderPlanValuesAsync(this IOpenBiApiClient client, string dataProviderName, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
cancellationToken CancellationToken

Returns

Task

SaveDataProviderViewAsync(IOpenBiApiClient, string, SaveDataProviderViewRequest, CancellationToken)

Stores the dataprovider's current state as a view that can be opened again.

public static Task<SavedDataProviderView> SaveDataProviderViewAsync(this IOpenBiApiClient client, string dataProviderName, SaveDataProviderViewRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
request SaveDataProviderViewRequest
cancellationToken CancellationToken

Returns

Task<SavedDataProviderView>

SaveDataProviderViewAsync(IOpenBiApiClient, string, string?, string?, CancellationToken)

Stores the dataprovider's current state as a view that can be opened again.

public static Task<SavedDataProviderView> SaveDataProviderViewAsync(this IOpenBiApiClient client, string dataProviderName, string? id = null, string? description = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
id string
description string
cancellationToken CancellationToken

Returns

Task<SavedDataProviderView>

SetDataProviderPlanValueAsync(IOpenBiApiClient, string, SetDataProviderPlanValueRequest, CancellationToken)

Writes one planned value into the server-side buffer. Nothing reaches the source until SaveDataProviderPlanValuesAsync(IOpenBiApiClient, string, CancellationToken).

public static Task SetDataProviderPlanValueAsync(this IOpenBiApiClient client, string dataProviderName, SetDataProviderPlanValueRequest request, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
dataProviderName string
request SetDataProviderPlanValueRequest
cancellationToken CancellationToken

Returns

Task