English 中文(简体)
Reporting Services custom assembly: accessing report parameters
原标题:

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)

最佳回答

Reference these two dlls in your library: Microsoft.ReportingServices.ProcessingCore Microsoft.ReportingServices.ProcessingObjectModel

Put the following code in your library (as an example)

using Microsoft.ReportingServices.ReportProcessing.ReportObjectModel;

public static string Test(Parameters item)
{

    return item ["my_parameter_name"].Value.ToString();
}

Here’s an example expression to use in your RDL file:

=MyNameSpace.MyStaticClass.Test(Parameters)
问题回答

暂无回答




相关问题
An error has Occurred During Report proccesing

When I m running the report I m getting that message above. The Report Works fine when I press the "Run Report" Button but I want also to avoid that annoying message that appears when the page loads. ...

Reporting services only displaying the last row

I have built a report pretty basic just a table wiht 45 rows of data. Problem is its only showing one row of data and its the last row. It displays just fine in the dataset and proc. any ...

Show Parameters for Reports In SSRS

I m developing an SSRS in Visual Studio BIDS. In it, I have a link that links to another report (report A). Report A has 4 parameters (dates). When I click on that link, it goes to report A fine, but ...

How to add group, or page field in an existing .rdl report

I have several .rdl reports designed for our client. However, they need new ones, that are relatively similar to the old ones. Differences are in the "group" and "page fields" (these can be changed ...

Report rendering using SSRS in Google Chrome

Hey, In our project, we use SSRS integrated with asp.net forms to render reports. The report looks good in IE. when it comes to google chrome, there re some issues we face such as date picker not ...

热门标签