title: Reporting Services custom assembly: accessing report parameters
body: <p>I'm writting a custom assembly to be referenced in a report. I'd like to be able to access the <code>Report</code> 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 <code>Report.stuff</code>.</p>
  
  <p>I obviously need to reference some reporting services assembly to do this, yet I can't figure out which. I tried <code>Microsoft.ReportingServices.ProcessingCore</code>, since it has a class <code>Report</code> with various properties like <code>Parameters</code> etc., but when I tried to pass the <code>Report</code> object from the RDL custom code section to my class, I got this error:</p>
  
  <blockquote>
    <p><code>Unable to cast object of type 'ReportExprHostImpl' to type 'Microsoft.ReportingServices.ReportRendering.Report'.</code></p>
  </blockquote>
  
  <p>There's also an assembly which exposes various interfaces and an abstract class <code>Report</code>, but it doesn't seem to have the parameters as a property.</p>
  
  <p>So the question is, how could I achieve this, what assembly do I have to reference ? And if possible, can I access the <code>Report</code> 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: </p>
  
  <blockquote>
    <p><code>=Utils.DoStuffWhileReferencingReportParameters(Fields!field.Value)</code></p>
  </blockquote>