Class ReportViewerSession
One viewer's session over a processed report: the current pagination, and the toggles applied to it.
public sealed class ReportViewerSession
- Inheritance
-
ReportViewerSession
- Inherited Members
Remarks
Where the state lives. Toggling a group changes what is on a page, so it changes pagination, and pagination is a pure function of the processed report plus the set of toggled keys. This class holds that set and nothing else derived: every answer it gives is produced by paginating again, so there is no second copy of the report to fall out of step with the first. A server that keeps no session at all gets the same answer by putting the keys in ToggledItems and calling ReportPaginator directly; the session exists to say which pages changed, not to make a stateless path impossible.
A session is not thread-safe, because toggling is a mutation. The ReportInstance it reads is not owned by it and is not disposed with it — several sessions over one processed report is the shape a server wants, and processing is the expensive half.
Interactive sort is not applied here, because it is not pagination. A textbox that offers one is reported by the page model (UserSort) and by the region map, so a viewer can show the affordance; applying it reorders the data, which is processing: the viewer puts a ReportInteractiveSort in InteractiveSorts, calls ReportProcessor again, and opens a session over the new instance. A session holds neither the definition nor the data provider, so it cannot do that itself.
Constructors
- ReportViewerSession(ReportInstance, FontEngine)
Opens a session over a processed report.
- ReportViewerSession(ReportInstance, FontEngine, ReportPaginationOptions?)
Opens a session over a processed report.
Properties
- Options
Gets the pagination options the session uses, including its set of toggled keys.
- Pages
Gets the report as it is now.
- ToggledItems
Gets the keys of the toggles the viewer has clicked, which is the whole of its state.
Methods
- Refresh()
Paginates again with whatever state the session now holds.
- Refresh(CancellationToken)
Paginates again with whatever state the session now holds.
- Toggle(string)
Applies a toggle and paginates again.
- Toggle(string, CancellationToken)
Applies a toggle and paginates again.