Hello
I have been evaluating the Telerik-Reports and so far I find them very good. However, when it comes to hierarchical data, I just can't get the reports to work at all. I made up a simplified example, that would be very typical for our company. Should we be able to generate reports using such a hierarchy as datasource, I could convince my boss to purchase Telerik-Reports ;)
I have been trying with subreports as well as groups and tables. However, I can not get it to display any of the sub-classes if they contain either a dictionary or a list. I think the problem is, that it won't recognize the DataSource correctly.
Background for the problem:
I have a list with people (drivers) and I would want to display a report where you can see on what days the people worked and how much work they have done.
I use the free trial version (Q1_2012_v6_0_12_302) and .NET 4.0 and I am certain that my list contains valid test data. Note, that I have a dictionary as well as lists inside the Classes.
List<DriverDto> drivers; // this would be the DataSource
// the corresponding data structure
public class DayDto
{
public DateTime Day { get; set; }
public int CalendarWeek { get; set; }
public int Work { get; set; }
public int Break { get; set; }
}
public class YearDto
{
public List<DayDto> Days { get; set; }
public string Year { get; set; }
public YearDto()
{
Days = new List<DayDto>();
}
}
public class DriverDto
{
public string Surname { get; set; }
public string FirstName { get; set; }
public Dictionary<int, YearDto> Years { get; set; }
public DriverDto()
{
Years = new Dictionary<int, YearDto>();
}
}
Desired outcome:
The report should look something like this.
=============================================
Peter Parker
=============================================
2011
------------------------------------------------------------------------
January
Date Work (Hours) Break (Hours)
2011.01.01 2.5 1.0
2011.01.02 2.0 0.5
Total CalendarWeek 52 4.5 1.5
2011.01.03 3.5 0.7
2011.01.04 1.0 0.2
2011.01.05 3.0 0.2
2011.01.06 2.3 0.5
2011.01.07 2.5 0.2
2011.01.08 2.7 0.5
2011.01.09 3.2 0.2
Total CalendarWeek 01 18.2 2.5
2011.01.10 3.5 0.7
2011.01.11 1.0 0.2
2011.01.12 3.0 0.2
2011.01.13 2.3 0.5
2011.01.14 2.5 0.2
2011.01.15 2.7 0.5
2011.01.16 3.2 0.2
Total CalendarWeek 02 18.2 2.5
Total January 40.9 6.5
------------------------------------------------------------------------
=============================================
Bruce Banner
=============================================
2011
------------------------------------------------------------------------
January
Date Work (Hours) Break (Hours)
2011.01.01 2.5 1.0
2011.01.02 2.0 0.5
Total CalendarWeek 52 4.5 1.5
2011.01.03 3.5 0.7
2011.01.04 1.0 0.2
2011.01.05 3.0 0.2
2011.01.06 2.3 0.5
2011.01.07 2.5 0.2
2011.01.08 2.7 0.5
2011.01.09 3.2 0.2
Total CalendarWeek 01 18.2 2.5
2011.01.10 3.5 0.7
2011.01.11 1.0 0.2
2011.01.12 3.0 0.2
2011.01.13 2.3 0.5
2011.01.14 2.5 0.2
2011.01.15 2.7 0.5
2011.01.16 3.2 0.2
Total CalendarWeek 02 18.2 2.5
Total January 40.9 6.5
------------------------------------------------------------------------
2012
------------------------------------------------------------------------
January
Date Work (Hours) Break (Hours)
2011.01.01 2.5 1.0
Total CalendarWeek 52 2.5 1.0
2011.01.02 2.0 1.0
2011.01.03 2.0 1.0
2011.01.04 2.5 1.5
2011.01.05 2.0 1.5
2011.01.06 2.0 1.0
2011.01.07 2.0 1.5
2011.01.08 2.5 1.5
Total CalendarWeek 01 15.0 9.0
Total January 20.0 10.0
------------------------------------------------------------------------
Any hint about how to achieve this would be greatly appreciated.
I have been evaluating the Telerik-Reports and so far I find them very good. However, when it comes to hierarchical data, I just can't get the reports to work at all. I made up a simplified example, that would be very typical for our company. Should we be able to generate reports using such a hierarchy as datasource, I could convince my boss to purchase Telerik-Reports ;)
I have been trying with subreports as well as groups and tables. However, I can not get it to display any of the sub-classes if they contain either a dictionary or a list. I think the problem is, that it won't recognize the DataSource correctly.
Background for the problem:
I have a list with people (drivers) and I would want to display a report where you can see on what days the people worked and how much work they have done.
I use the free trial version (Q1_2012_v6_0_12_302) and .NET 4.0 and I am certain that my list contains valid test data. Note, that I have a dictionary as well as lists inside the Classes.
List<DriverDto> drivers; // this would be the DataSource
// the corresponding data structure
public class DayDto
{
public DateTime Day { get; set; }
public int CalendarWeek { get; set; }
public int Work { get; set; }
public int Break { get; set; }
}
public class YearDto
{
public List<DayDto> Days { get; set; }
public string Year { get; set; }
public YearDto()
{
Days = new List<DayDto>();
}
}
public class DriverDto
{
public string Surname { get; set; }
public string FirstName { get; set; }
public Dictionary<int, YearDto> Years { get; set; }
public DriverDto()
{
Years = new Dictionary<int, YearDto>();
}
}
Desired outcome:
The report should look something like this.
=============================================
Peter Parker
=============================================
2011
------------------------------------------------------------------------
January
Date Work (Hours) Break (Hours)
2011.01.01 2.5 1.0
2011.01.02 2.0 0.5
Total CalendarWeek 52 4.5 1.5
2011.01.03 3.5 0.7
2011.01.04 1.0 0.2
2011.01.05 3.0 0.2
2011.01.06 2.3 0.5
2011.01.07 2.5 0.2
2011.01.08 2.7 0.5
2011.01.09 3.2 0.2
Total CalendarWeek 01 18.2 2.5
2011.01.10 3.5 0.7
2011.01.11 1.0 0.2
2011.01.12 3.0 0.2
2011.01.13 2.3 0.5
2011.01.14 2.5 0.2
2011.01.15 2.7 0.5
2011.01.16 3.2 0.2
Total CalendarWeek 02 18.2 2.5
Total January 40.9 6.5
------------------------------------------------------------------------
=============================================
Bruce Banner
=============================================
2011
------------------------------------------------------------------------
January
Date Work (Hours) Break (Hours)
2011.01.01 2.5 1.0
2011.01.02 2.0 0.5
Total CalendarWeek 52 4.5 1.5
2011.01.03 3.5 0.7
2011.01.04 1.0 0.2
2011.01.05 3.0 0.2
2011.01.06 2.3 0.5
2011.01.07 2.5 0.2
2011.01.08 2.7 0.5
2011.01.09 3.2 0.2
Total CalendarWeek 01 18.2 2.5
2011.01.10 3.5 0.7
2011.01.11 1.0 0.2
2011.01.12 3.0 0.2
2011.01.13 2.3 0.5
2011.01.14 2.5 0.2
2011.01.15 2.7 0.5
2011.01.16 3.2 0.2
Total CalendarWeek 02 18.2 2.5
Total January 40.9 6.5
------------------------------------------------------------------------
2012
------------------------------------------------------------------------
January
Date Work (Hours) Break (Hours)
2011.01.01 2.5 1.0
Total CalendarWeek 52 2.5 1.0
2011.01.02 2.0 1.0
2011.01.03 2.0 1.0
2011.01.04 2.5 1.5
2011.01.05 2.0 1.5
2011.01.06 2.0 1.0
2011.01.07 2.0 1.5
2011.01.08 2.5 1.5
Total CalendarWeek 01 15.0 9.0
Total January 20.0 10.0
------------------------------------------------------------------------
Any hint about how to achieve this would be greatly appreciated.