This is a migrated thread and some comments may be shown as answers.

NavigateToReportAction DataSource not being set on server

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
KD
Top achievements
Rank 1
KD asked on 15 Jan 2015, 06:28 PM
I have a NavigateToReportAction assigned to a TextBox in a GroupHeaderSection of my report. In the code I assign the DataSource of my ReportSouce to this.DataSource. This works locally but the SubReports is blank on the testing server.

I am running an out-of-proc session. I made changes for other DataSource assignments to account for this but, no matter what I try, I can't seem to bind the NavigateToReportAction DataSource.

Here's what I have right now:

public ParentReport()
{
    InitializeComponent();
    ItemDataBinding += ReportDataBinding;
}
 
public void ReportDataBinding(object sender, EventArgs e)
{
    var processingReport = (Telerik.Reporting.Processing.Report)sender;
    var report = (Telerik.Reporting.Report)processingReport.ItemDefinition;
    GroupHeaderArea2 = (Telerik.Reporting.GroupHeaderSection)report.Items.Find("GroupHeaderArea2", true)[0];
    GroupHeaderArea2.ItemDataBinding += AssignSubReportDataSource;
}
 
public void AssignSubReportDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.GroupSection groupSection = (Telerik.Reporting.Processing.GroupSection)sender;
    Telerik.Reporting.Processing.TextBox txtName = (Telerik.Reporting.Processing.TextBox)groupSection.ChildElements.Find("txtName", true)[0];
    NavigateToReportAction action = (NavigateToReportAction)((Telerik.Reporting.TextBox)txtName.ItemDefinition).Action;
    InstanceReportSource subReportSource = (InstanceReportSource)action.ReportSource;
    ((Telerik.Reporting.Report)subreportSource.ReportDocument).NeedDataSource += subReport_NeedDataSource;
}
 
protected void subReport_NeedDataSource(object sender, EventArgs e)
{
    ((Telerik.Reporting.Processing.Report)sender).DataSource = this.DataSource;
}

I have tried to use a Binding in my SubReport to assign the DataSource as suggested in:
http://www.telerik.com/forums/how-to-bind-the-datasource-of-a-subreport-in-the-designer.

If anyone has any tips on how to do that properly that would be helpful. Any insight is appreciated as I have been working on this issue for a while. Again, this is working locally, but not on the server.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Hinata
Top achievements
Rank 1
answered on 20 Jan 2015, 11:12 AM
Hi KD,

Using events with out-proc session is a no go, because it is not correct to use report item definitions in the events. It is mentioned in the reporting documentation.
Unfortunately, you will have to think about an entirely different approach, such as setting what you need to in the designer via expressions/bindings/etc.
Tags
General Discussions
Asked by
KD
Top achievements
Rank 1
Answers by
Hinata
Top achievements
Rank 1
Share this question
or