We are developing a reporting system for an enterprise web application. The report definitions (*.trdx) are all being built using the stand alone Telerik Report Designer so there is no code behind pages associated with the definition files. One of the business requirements is to save sets of parameter values for each report. I have devised a way to show just the parameters area of a report, but I am not able to access the values set by the user. All the documentation and other forum threads state that I should be able to hook up listeners to the ReportDocument ItemDataBinding and ItemDataBound events. I have done that, but the event handlers are not being triggered when a user sets a value and the report viewer refreshed the data.
Here is the setup:
trdParameters is the report viewer control. reportDocument is a private variable at the Page level and has been hooked up the listener reportDocument_ItemDataBound:
When the page is called, the parameters are rendered properly and the report generates properly but event handler is never triggered. Any time a user changes a parameter, the report viewer makes an AJAX call to the Telerik reporting dll and I cannot find a way to intercept that.
I am using Q1 2013 version of Telerik Reporting.
Any ideas?
Here is the setup:
- A report viewer object is added to an .aspx page (C#).
- In the code behind, the report definition file is loaded, deserialized and attached to the report viewer via the ReportSource
var reportDefinitionFile = Server.MapPath(
"~/app/reports/repository/rpt/"
+ _reportPath);
var xmlSerializer =
new
ReportXmlSerializer();
reportDocument = (Telerik.Reporting.Report)xmlSerializer.Deserialize(reportDefinitionFile);
var reportSource =
new
InstanceReportSource();
reportSource.ReportDocument = reportDocument;
trdParameters.ReportSource = reportSource;
trdParameters is the report viewer control. reportDocument is a private variable at the Page level and has been hooked up the listener reportDocument_ItemDataBound:
protected
override
void
OnInit(EventArgs e)
{
reportDocument.ItemDataBound +=
new
EventHandler(reportDocument_ItemDataBound);
base
.OnInit(e);
}
private
void
reportDocument_ItemDataBound(
object
sender, EventArgs e)
{
Telerik.Reporting.Processing.Report rpt = (Telerik.Reporting.Processing.Report)sender;
var obj = rpt.Parameters;
}
When the page is called, the parameters are rendered properly and the report generates properly but event handler is never triggered. Any time a user changes a parameter, the report viewer makes an AJAX call to the Telerik reporting dll and I cannot find a way to intercept that.
I am using Q1 2013 version of Telerik Reporting.
Any ideas?