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

Passing array of arrays to report

1 Answer 502 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eimantas
Top achievements
Rank 1
Eimantas asked on 16 Feb 2018, 10:11 AM

Hello,

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:

DetailSection:

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!

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 21 Feb 2018, 04:43 PM
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.

Regards,
Todor
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
Tags
General Discussions
Asked by
Eimantas
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or