Hi, can some-one please help me with the following issue re passing parameters.
I have created a new trivial report and setup two report parameters
1) StartDate (Type DateTime)
2) EndDate (Type DateTime)
What I would like to be able to do is set the report parameters from inside the codebehind of the webpage which will display the report.
e.g.
The report object is in a seperate class library called ProductOrders
public partial class ProductOrders : Telerik.Reporting.Report
{
public ProductOrders()
{
try
{
this.dsAllOrdersTableAdapter1.Fill(this.dsAllOrders.dsAllOrdersTable);
}
catch (System.Exception ex)
{
// An error has occurred while filling the data set. Please check the exception for more information.
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
}
In another .NET website project I have a report viewer called ReportViewer1 and I have the following code
protected void Page_Load(object sender, EventArgs e)
{
// New instance of the ProductOrders report
ProductOrders _report = new ProductOrders();
// Set the report parameters here
_report.ReportParameters["StartDate"].Value = Convert.ToDateTime("01-jun-2009");
_report.ReportParameters["EndDate"].Value = Convert.ToDateTime("30-jun-2009");
// associate the report with report viewer
ReportViewer1.Report = _report;
}
The problem that I am having is that the report paramaters are *always null* when I set them from the website page.
If I place them inside the constructor of the ProductOrders they work fine.
I do not want to pass through this information in the QueryString but would prefer to pass them through programatically. Again the above is a trivial example :)
Thanks in advance
Mark
I have created a new trivial report and setup two report parameters
1) StartDate (Type DateTime)
2) EndDate (Type DateTime)
What I would like to be able to do is set the report parameters from inside the codebehind of the webpage which will display the report.
e.g.
The report object is in a seperate class library called ProductOrders
public partial class ProductOrders : Telerik.Reporting.Report
{
public ProductOrders()
{
try
{
this.dsAllOrdersTableAdapter1.Fill(this.dsAllOrders.dsAllOrdersTable);
}
catch (System.Exception ex)
{
// An error has occurred while filling the data set. Please check the exception for more information.
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
}
In another .NET website project I have a report viewer called ReportViewer1 and I have the following code
protected void Page_Load(object sender, EventArgs e)
{
// New instance of the ProductOrders report
ProductOrders _report = new ProductOrders();
// Set the report parameters here
_report.ReportParameters["StartDate"].Value = Convert.ToDateTime("01-jun-2009");
_report.ReportParameters["EndDate"].Value = Convert.ToDateTime("30-jun-2009");
// associate the report with report viewer
ReportViewer1.Report = _report;
}
The problem that I am having is that the report paramaters are *always null* when I set them from the website page.
If I place them inside the constructor of the ProductOrders they work fine.
I do not want to pass through this information in the QueryString but would prefer to pass them through programatically. Again the above is a trivial example :)
Thanks in advance
Mark