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:
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.
Yes, there are several bindable properties in XamReportViewer (full list - see public members for dependency properties), such as:
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.
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 -- 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).
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.