我以这种方式传递参数:
public PrintReport()
{
InitializeComponent();
this.ReportViewer1.RenderBegin += new Telerik.ReportViewer.Silverlight.RenderBeginEventHandler(ReportViewer1_RenderBegin);
}
void ReportViewer1_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
{
args.ParameterValues["ObjectTypeId"] = 40;
args.ParameterValues["Page"] = 1;
args.ParameterValues["PageSize"] = 10;
}
在服务器中,我正在这样做:
public partial class ObjectInstancesReport : Telerik.Reporting.Report
{
private IEnumerable<ObjectInstance> _objectInstances;
public ObjectInstancesReport()
{
InitializeComponent();
var objectTypeId = this.ReportParameters["ObjectTypeId"].Value == null ? 40 : (int)this.ReportParameters["ObjectTypeId"].Value;
var searchText = (string)this.ReportParameters["SearchText"].Value;
var page = this.ReportParameters["Page"].Value == null ? 1 : (int)this.ReportParameters["Page"].Value;
var pageSize = this.ReportParameters["PageSize"].Value == null ? 20 : (int)this.ReportParameters["PageSize"].Value;
但我只得到空值