Hi,
I am attempting to reference hierarchical data from within a 2011.2 report. This is something that I think was missing from the CTP versions and I was expecting it to be possible in the released version.
From reading the documentation it appears that you can create data that is relational in the report but it appears to work from the detail level up to a single parent rather than from a parent down to multiple detail levels.
An example would be where you have a top level (a project) which relates to multiple customers that each have zero or more addresses and communication methods. Like this;
Project
/ \
Customers Stages
Addresses Communication Methods
In the sample code, the hierarchy always seems to start at a detail level and then work backwards up the data-tree.
Here is some sample code to create the hierarchical data described;
[ReportDataSourceExport(ReportSearchPattern = "PrintProject.*")]
public class PrintProjectDataProvider : IReportDataSourceProvider
{
public object GetDataSource(string name, IDictionary<string, ParameterValue> reportParameters)
switch (name)
case "Project":
LoadProjectDetails();
return Projects;
default:
return null;
}
private void LoadProjectDetails()
Projects.Clear();
var toAdd = new ProjectDetailsViewModel
ProjRef = "ProjRef",
Description = "Project Description",
Date = DateTime.Now.Date
};
toAdd.Stages.Add(new ProjectStageDetailsModel {StageNo = "1"});
toAdd.Stages.Add(new ProjectStageDetailsModel {StageNo = "2"});
toAdd.Stages.Add(new ProjectStageDetailsModel {StageNo = "3"});
var customer1 = new CustomerDetailsViewModel { Name = "Mr Jim Elf Exit" };
var customer2 = new CustomerDetailsViewModel { Name = "Mrs Main Tester" };
var customer3 = new CustomerDetailsViewModel { Name = "Miss Final Customer" };
toAdd.Customers.AddRange(new []{customer1,customer2,customer3});
customer1.Addresses.Add(new AddressViewModel { Line1 = "Road Name", PostCode = "PO573DE" });
customer1.Addresses.Add(new AddressViewModel { Line1 = "Test Street", PostCode = "TE571NG" });
customer1.CommunicationMethods.Add(new CommunicationMethod { Description = "Email", Detials = "first.last@domain.ext" });
customer1.CommunicationMethods.Add(new CommunicationMethod { Description = "Mobile", Detials = "07890 123456" });
customer1.CommunicationMethods.Add(new CommunicationMethod { Description = "Work", Detials = "01234 567890"});
Projects.Add(toAdd);
private List<ProjectDetailsViewModel> _projects = new List<ProjectDetailsViewModel>();
public List<ProjectDetailsViewModel> Projects
get { return _projects ; }
set { _projects = value; }
public class ProjectDetailsViewModel
public String ProjRef { get; set; }
public String Description { get; set; }
public DateTime Date { get; set; }
private List<ProjectStageDetailsModel> _stages = new List<ProjectStageDetailsModel>();
public List<ProjectStageDetailsModel> Stages
get { return _stages; }
set { _stages = value; }
private List<CustomerDetailsViewModel> _customers = new List<CustomerDetailsViewModel>();
public List<CustomerDetailsViewModel> Customers
get { return _customers; }
set { _customers = value; }
public class CustomerDetailsViewModel
public String Name { get; set; }
private readonly List<AddressViewModel> _addresses = new List<AddressViewModel>();
public List<AddressViewModel> Addresses
get { return _addresses; }
private readonly List<CommunicationMethod> _communicationMethods = new List<CommunicationMethod>();
public List<CommunicationMethod> CommunicationMethods
get { return _communicationMethods; }
public class AddressViewModel
public String Line1 { get; set; }
public String PostCode { get; set; }
public class CommunicationMethod
public String Detials { get; set; }
public class ProjectStageDetailsModel
public String StageNo { get; set; }
Using this data, I would hope to be able to produce a report that looks like this;
Thanks in advance for your help.
Best regards,
Timothy.
Hi Timothy,
Yes, hierarchical data has been already implemented and will be released in our 12.2 release, due mid november.
Please let us know if you are interested in a preview build.
Regards,
Andres
Hi Andres,
Any more news on this? It has been the best part of a year since your previous answer.
Thanks,
Timothy
I was not clear in my previous answer, as hierarchical data was not in our plans for v1. We know it's a very important scenario, and as you said, it's more important if we don't support subreports.
It's one of the top features for our 12.1 release. As soon as we have a version of it that we can share we'll let you know.
Thanks in advance for your patience,
Hi Leonardo,
It is disappointing that there is no support for hierarchical data. As far as I understood (after reading this post from Andres (http://forums.infragistics.com/forums/p/58396/308113.aspx#308113), hierarchical data would be supported in Infragistics reporting. This was especially important, as there was not going to be support for sub-reports.
As it is not possible to do either of these things, do you have a timescale for when the product might start to support some of these features?
Many thanks.
We don’t support hierarchical data sources in 2011.2; it is very possible that they will be included for next version. Currently the only way to display hierarchies inside a report is by grouping data. i.e. data must be flat and you build the hierarchy by grouping. If you have only one child you would be able to build the hierarchy, but since you have two children for the project that will not be possible.
Leo