Have some hierarchical data that I have been trying to format in a specific manner and have not been able to get a report layout to display it in the manner I am attempting. I have two-level hierarchical data, say an Order which contains multiple Items. What I would like to do is display the data in this way:
| Item columns | Order columns |
ProductId Quantity Price OrderDate OrderComments
1 1 10.0 3/1/2013 Customer has asked
2 2 21.5 for expedited delivery.
3 7 3.75
3 3 10.2 3/1/2013 Products not in stock as
4 2 17.3 of 3/1. Will backorder
and let customer know.
Where I am showing both the Order and Item data on a single line, and the Order data wraps into additional rows as needed. The Item level records start on the same line as the Order level record and takes up as many rows as is needed to show all Item records.
Is there any way to represent hierarchical data in this way using NetAdvantage Reporting?
Ok thanks. I have one more question for now -- thanks so much for the quick responses. I see that you can set up bindings using the expression assistant for specific fields in tables, etc. I was wondering what binding capabilities that the XamReportViewer exposed besides the data source. I really prefer to define my bindings and other configuration within XAML for some items as in that way I get to take advantage of styles and templates defined in my resource dictionaries.
jerry hikel said:I wasn't sure if it were possible to do it through the expression assistant or whether i would have to do that through binding.
Just in case, you can also edit the binding using the Expression Assistant, by expanding the the Visible property, clicking on the DataBinding property, then click on the ellipsis button to open the Expression Assistant.
jerry hikel said:In order for me to display the Order level data on the same row as the Item level data though I would need to be able to access the Order level fields from the Item level fields, which means I would need to have a reference in the Item class to it's parent Order object, correct?
That is one way to do it, but it is not really necessary. You can also have a two level table like the following (see image below). The table has the DataContext of Orders with just the headers, then add a subtable whose DataContext uses the item collection. From the items row, you can refer to fields of the Orders using the Parent prefix instead of the Fields prefix.
jerry hikel said:I have another question in regards to report composition -- is there any native ability in NetAdvantage Reporting to create composite reports that are made up of one or more sub-reports? I am wondering if that could be done at either report design time or through the XAML configuration in a WPF application.
We do not support subreports at this moment.
Ok I see -- I wasn't sure if it were possible to do it through the expression assistant or whether i would have to do that through binding. In order for me to display the Order level data on the same row as the Item level data though I would need to be able to access the Order level fields from the Item level fields, which means I would need to have a reference in the Item class to it's parent Order object, correct?
I have another question in regards to report composition -- is there any native ability in NetAdvantage Reporting to create composite reports that are made up of one or more sub-reports? I am wondering if that could be done at either report design time or through the XAML configuration in a WPF application.
You can use conditional formatting to hide the content for a given cell. Basically, on the cell that has content that needs hiding, add a binding to the Visible property that returns true if the Item record is the first. For instance, on the screenshot from the previous post, a property called Row was added, and with the expression =If(Row = 1; "true", "false"), only on the first Item the order data is displayed.
I see -- ok how would I be able to design the report in that way that the Order columns would only be populated for the first Item record?
Thanks.