0
我正在使用Windows窗体应用程序,在窗体应用程序中单击按钮后,要将报告加载到报告查看器中。 这是获取由代码按下按钮上的Windows窗体的背后触发事件:Telerik将WindowsForm Codebehind中的参数报告到报告
private void button1_Click(object sender, EventArgs e)
{
Telerik.Reporting.InstanceReportSource reportSource = new
Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = new Reportlibrary.Report1();
reportSource.Parameters.Add(new Telerik.Reporting.Parameter("OrderNumber","123456789"));
reportViewer1.ReportSource = reportSource;
reportViewer1.RefreshReport();
}
现在的问题是,我不知道我怎么能访问/获取我刷新之前添加参数Reportviewer。 报告已经设置了数据源。我不知道这是否重要。 这就是我现在所拥有的。我试过了所有的东西,我只是没有进一步。
public Report1()
{
InitializeComponent();
Position[] all = new Position[]{
new Position("Test", "Test","test"),
};
this.DataSource = all;
MessageBox.Show("Number: " +
this.Report.ReportParameters["OrderNumber"].Value.ToString());
}
有没有什么办法让InitializeComponent(); ? 我是否需要向报告添加其他事件才能访问它?如果是,哪一个是最好的办法呢?
任何帮助非常apreciated。 谢谢