Passing array of arrays to report

2 posts, 0 answers
  1. Eimantas
    Eimantas avatar
    1 posts
    Member since:
    Feb 2018

    Posted 16 Feb 2018 Link to this post


    I'm having an issue displaying data on the report I have.

    I am using ReportDesigner tool to create report file which I want to be rendered however, when If I add text =Fields.WeekStartDate or =Fields.Lines im not getting anything.


    This what I have:

    Report is rendered by using ReportResolverBase class method: ReportSource ResolveReport()

    protected override ReportSource ResolveReport(string reportId)
        return reportHelper.GetReportSource(reportId);
    public ReportSource GetReportSource(string reportId)
        var reportSource = new InstanceReportSource();
        reportSource.ReportDocument = Telerik.Reporting.Report Report;
        report.DataSource = new ObjectDataSource(model, null); // model structure below
    var model = new List<Foo>();
    class Foo {
        public string WeekStartDate { get; set; }
        public string Year { get; set; }
        public string WeekOfTheYear { get; set; }
        public IEnumerable<Bar> Lines { get; set; }
    class Bar {   
        public string DueDate { get; set; }
        public string EQCode { get; set; }
        public string EQDescription { get; set; }
        public string WSDescription{ get; set; }


    My ultimate goal is to display Foo items on separate pages something like that:


    WeekStartDate ........................................ Year ....................... WeekOfTheYear............................

    DueDate EQCode EQDescription WSDescription

    DueDate EQCode EQDescription WSDescription

    DueDate EQCode EQDescription WSDescription

    DueDate EQCode EQDescription WSDescription (for each Line)

    is there a way to achive that?


    Thanks in advance!

  2. Todor
    Todor avatar
    538 posts

    Posted 21 Feb 2018 Link to this post

    Hi Eimantas,

    If I understood correctly, you have implemented custom report resolver, where you change the report definition by modifying Report's DataSource, and return it in an InstanceReportSource.

    The parts of the code you share seem correct.

    Provided that there is data added to the 'model', it should be assigned to the DataSource of the Report.
    The problem could occur If the report items displaying the data are placed inside another data item (Table, List, etc).

    Note also that 'Lines' is a field that should be used as a data source for another data item - for example Table or List inside the Report, where to display 'Lines' content.

    If you share the report definition with us (for example upload it in the web and send us the link) we might be able to come up with more specific advice.

    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top