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

crosstab databinding (in subreport)

1 Answer 113 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Koen L
Top achievements
Rank 1
Koen L asked on 28 Mar 2012, 02:44 PM
I am trying to bind a type CustomerInvoiceLogs ( : List<CustomerInvoiceLog>) to a crosstab in a subreport.
I start by passing on the data in to the subreport in the subreports NeedDataSource event in the main report design window.

private void subPortfolioStatistics_NeedDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.SubReport subReport = (Telerik.Reporting.Processing.SubReport) sender;
 
    CustomerPortfolios custPortfolio = (CustomerPortfolios) subReport.DataObject.RawData;
    _customerPortfolio = custPortfolio.customerPortfolios;
 
    if (_customerPortfolio != null && _customerPortfolio.Count > 0)
    {
        CustomerInvoiceLogs customerInvoiceLogs = new CustomerInvoiceLogs();
 
        foreach (CustomerPortfolio cp in _customerPortfolio)
        {
            customerInvoiceLogs.AddRange(DFInvoiceStats.InvoicesByCustomerIdWithoutTaxNumberRelation(cp.CustomerId, _startYear, _endYear));
        }
 
        subReport.InnerReport.DataSource = customerInvoiceLogs;
    }
}

In the NeedDataSource above I pass on the customerInvoiceLogs collection class to the subreport. Which I can use if I drag properties from the ObjectDataSource to the Design detail section of the subreport.

If I try using the same ObjectDataSource to fill in values in the crosstab control the cells stay blank (they don't contain values like the textboxes, however there is a crosstab created for every value in customerInvoiceLogs (the headers are displayed). Could anyone let me know why this is and how I can resolve this problem.

1 Answer, 1 is accepted

Sort by
0
Koen L
Top achievements
Rank 1
answered on 29 Mar 2012, 08:59 AM
I've managed to resolve this issue.
Instead of binding the collection object to the subreport I've bound it directly to the crosstab (changed it's modifier to public). This seems to work.
Tags
General Discussions
Asked by
Koen L
Top achievements
Rank 1
Answers by
Koen L
Top achievements
Rank 1
Share this question
or