Table of Contents

Class ReportDataProvider

Namespace
DocWright.Reporting.Data
Assembly
DocWright.Reporting.dll

Supplies the rows of a report's datasets. DocWright executes no query, opens no connection and references no database library: every row a report reads comes through here, from the host.

public abstract class ReportDataProvider
Inheritance
ReportDataProvider
Derived
Inherited Members

Remarks

What the processor asks. For each dataset the report needs, the processor evaluates the query's command text and parameters and calls ExecuteQuery(ReportDataQuery, CancellationToken) once. The provider answers with a reader that states its schema — column names, CLR types and whether a column can be null — and then yields rows. What the command text means (SQL, a REST path, a key into a cache) is entirely the provider's business.

Why not IMergeDataReader. Mail merge's reader is forward-only values with no types, no nullability and no parameters. A report needs all three: a column's type decides whether Sum adds or fails, and a query parameter is how a report narrows its data.

Why an abstract class. Members can be added in a later version without breaking a provider; an interface on netstandard2.0 cannot grow.

Threads. The processor calls a provider from the thread that is processing the report. A host that processes reports concurrently with one provider makes the provider safe for that; the in-box ReportInMemoryDataProvider is safe once it is filled.

Constructors

ReportDataProvider()

Initializes the base class.

Methods

ExecuteQuery(ReportDataQuery, CancellationToken)

Runs one dataset's query.