or
//by default standard portrait A4private void BuilderReport(Telerik.Reporting.IReportDocument report){ report.Width = new Unit(Columns.Count * 1.2, UnitType.Inch); // ≈ 20-25 Inch // ... foreach (var column in Columns) { var dataTextBox = new TextBox { /* Size, Location etc */ }; report.Items["detail"].Items.Add(dataTextBox); // ... var footerTextBox = new TextBox { /* Size, Location etc */ }; footerTextBox.Value = string.Format(@"=PageExec(""{0}"", Count(Fields.{0}))", column.Name); // pageFooter is Telerik.Reporting.PageFooterSection report.Items["pageFooter"].Items.Add(footerTextBox); }}<system.webServer><handlers> <add name="Telerik.ReportViewer.axd_*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.611, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" preCondition="integratedMode,runtimeVersionv2.0"/></handlers></system.webServer><system.web><httpHandlers> <add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.611, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" validate="false"/></httpHandlers></system.web>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();}
The problem now is that I have no Idea how I can access / get the parameter I added before Refreshing the Reportviewer.
The Report already has set a Datasource. I don't know if this matters.
This is what I have right now. I've tried everything and I'm just not getting further.
public Report1()
{
InitializeComponent();
Position[] all = new Position[]{
new Position("Test", "Test","test"),
};
this.DataSource = all;
MessageBox.Show("Number: " +
this.Report.ReportParameters["OrderNumber"].Value.ToString());
}
Is there any way to get this parameter straight after InitializeComponent(); ?
Do I need to add another Event to the report to access it? If yes which on is the best way to do this?
Any help very apreciated.
Thank you