Sunday, March 25, 2012

Access data sources from Rendering Extension code

I am writing a rendering extension for reporting services (the one that
implements IRenderingExtension).
I need to be able to enumerate and access [populated] datasets that were
used in the report. I don't see any way of getting a reference to DataSets
from Report or createAndRegisterStream objects, or other any other way. Can
you recommend something, please?
On the same token, if more than one dataset was defined in the report
designer, but only one was actually referenced from report items (i.e. fields
referenced all belong to one ds), does RS optimize away the other datasets,
or does it still execute queries and populate them?
Thank you!
Denis (DenisL at softartisans dot com)Hi Denis,
you cannot access populated datasets in the RenderingObjectModel. Just
consider the cases where a report is rendered from an execution or a history
snapshot. In both cases no data set queries are executed, but just the
information stored in the snapshot is exposed in the RenderingObjectModel.
Snapshots typically *only* contain the processed report items (in an output
format independent format) but no data.
As processing a report has multiple phases, datasets only get populated if
dataset queries get executed. In any case, populated datasets will never be
accessible through the RenderingObjectModel.
Regarding optimization of dataset executions: if a dataset is not referenced
by any reportitem in the entire report, then the commandtext is not
executed. If however it is referenced by a reportitem that can e.g. be
shown/hidden dynamically based on a condition, the query has to be executed
at processing time.
Right now, only a custom assembly could indirectly access populated datasets
(by passing in field values as parameters) during report processing.
In the next version there will be a way ("CustomReportItem") to "plug in"
your own custom processing controls into the report server which will have
access to the data at processing time. However, the custom processing
control will not be able to generate any arbitrary output format independent
rendering object (at least for the next version) - but it could generate a
custom image object with custom properties during processing which are then
exposed during rendering to your custom rendering extension.
HTH,
Robert
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Denis Levin" <DenisLevin@.discussions.microsoft.com> wrote in message
news:5C708846-5796-4D11-B377-76A0A7B22513@.microsoft.com...
> I am writing a rendering extension for reporting services (the one that
> implements IRenderingExtension).
> I need to be able to enumerate and access [populated] datasets that were
> used in the report. I don't see any way of getting a reference to DataSets
> from Report or createAndRegisterStream objects, or other any other way.
Can
> you recommend something, please?
> On the same token, if more than one dataset was defined in the report
> designer, but only one was actually referenced from report items (i.e.
fields
> referenced all belong to one ds), does RS optimize away the other
datasets,
> or does it still execute queries and populate them?
> Thank you!
> Denis (DenisL at softartisans dot com)|||Ths helps a lot!
Thank you, Robert.
"Robert Bruckner [MSFT]" wrote:
> Hi Denis,
> you cannot access populated datasets in the RenderingObjectModel. Just
> consider the cases where a report is rendered from an execution or a history
> snapshot. In both cases no data set queries are executed, but just the
> information stored in the snapshot is exposed in the RenderingObjectModel.
> Snapshots typically *only* contain the processed report items (in an output
> format independent format) but no data.
> As processing a report has multiple phases, datasets only get populated if
> dataset queries get executed. In any case, populated datasets will never be
> accessible through the RenderingObjectModel.
> Regarding optimization of dataset executions: if a dataset is not referenced
> by any reportitem in the entire report, then the commandtext is not
> executed. If however it is referenced by a reportitem that can e.g. be
> shown/hidden dynamically based on a condition, the query has to be executed
> at processing time.
> Right now, only a custom assembly could indirectly access populated datasets
> (by passing in field values as parameters) during report processing.
> In the next version there will be a way ("CustomReportItem") to "plug in"
> your own custom processing controls into the report server which will have
> access to the data at processing time. However, the custom processing
> control will not be able to generate any arbitrary output format independent
> rendering object (at least for the next version) - but it could generate a
> custom image object with custom properties during processing which are then
> exposed during rendering to your custom rendering extension.
> HTH,
> Robert
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Denis Levin" <DenisLevin@.discussions.microsoft.com> wrote in message
> news:5C708846-5796-4D11-B377-76A0A7B22513@.microsoft.com...
> > I am writing a rendering extension for reporting services (the one that
> > implements IRenderingExtension).
> > I need to be able to enumerate and access [populated] datasets that were
> > used in the report. I don't see any way of getting a reference to DataSets
> > from Report or createAndRegisterStream objects, or other any other way.
> Can
> > you recommend something, please?
> >
> > On the same token, if more than one dataset was defined in the report
> > designer, but only one was actually referenced from report items (i.e.
> fields
> > referenced all belong to one ds), does RS optimize away the other
> datasets,
> > or does it still execute queries and populate them?
> >
> > Thank you!
> >
> > Denis (DenisL at softartisans dot com)
>
>

No comments:

Post a Comment