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?
Hi Jerry,
Yes, you can make a report with hierarchical sections and/or tables to represent your data.
You can look at the Nested Sections and Hierarchical Table sample, and the following help topics:
Note: the Order Comments will make the rows grow, but rows will not overlap with each other.
Let us know if you have any questions!
Regards,Héctor
But that's exactly what I am trying to do as illustrated in my initial email. I want to be able to show the higher-level Order data and the Item data in the same set of rows so that the Order Comments that you mentioned and other Order level fields will wrap as far into the rows beneath as necessary. Again it would look something like:
It is not possible for rows of different levels to wrap into each other, the closest you can get is the following;
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.
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.
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 set PageFit to FitToPage or FitToWidth, there is a small margin in those cases (between the page and the edge of the control) that is there by design to support touch scenarios.
EDIT: In case you want the viewer control dimensions to expand automatically, it behaves like a standard control, if you remove its dimensions it should expand, otherwise you need to check wether the stackpanel itself is expanding.
I see -- I didn't think about utilizing parameters as data that can be used to define expressions.
When I am placing a XamReportViewer inside of a control, is there any method available to have it automatically take up all available space that that control provides? I have been able to set the PageFit to ZoomScale and then set ZoomScale to the exact right percentage to have the viewer take up the entire available space, however if I don't set that it will only take up a certain amount of width within the control according to the PageFit attribute. I am wondering if it is possible to force the viewer control to take up all available space in it's containing control (in this case i have it as one item in a horizontally-oriented StackPanel).
Many of the properties you mention are bindable to expressions, so you can either pass the desired values as parameters to your report or as a data source. Defining the layout of the report per se is not possible though. You can then bind parameters and data sources through XAML.
I see that -- actually I'm wondering if it would be possible to define something like a table row-level binding on properties like color, font etc. through the XAML. That would require the ability to define the layout of the report through XAML though so it most likely is not available. I understand that I can get binding for those properties by using the expression assistant which would then store that information to the igr table.
Yes, there are several bindable properties in XamReportViewer (full list - see public members for dependency properties), such as: