I'm writting a custom assembly to be referenced in a report. I'd like to be able to access the Report
object from that assembly, so that I could then access the report parameters and other stuff that I can access in custom RDL code by using Report.stuff
.
I obviously need to reference some reporting services assembly to do this, yet I can't figure out which. I tried Microsoft.ReportingServices.ProcessingCore
, since it has a class Report
with various properties like Parameters
etc., but when I tried to pass the Report
object from the RDL custom code section to my class, I got this error:
Unable to cast object of type 'ReportExprHostImpl' to type 'Microsoft.ReportingServices.ReportRendering.Report'.
There's also an assembly which exposes various interfaces and an abstract class Report
, but it doesn't seem to have the parameters as a property.
So the question is, how could I achieve this, what assembly do I have to reference ? And if possible, can I access the Report
object without passing it from the RDL, i.e. so that I could just register an instance of my class and later write expressions like:
=Utils.DoStuffWhileReferencingReportParameters(Fields!field.Value)