Hello,
using Infragistics 2016.1's Documents.Excel Reference, I managed to export data from a datatable to a new Excel file and to create outlining.
Here's a code snippet:
qryGroupHeadersOfCurrentPackage.ForEach (r => { var StartRow = r.RowNumberWithinPackageName; var EndRow = r.RowNumberWithinPackageName + r.DescendantsCount-1; for (var x = StartRow; x <= EndRow; x++) { xlWksPackageTree.Rows[x].OutlineLevel += 1; } } );
This works well and fast. :)
But is there a way to make sure that Excel's group headers (the "+" row headers) are above the Details? In Excel's VBA, I'd ensure that this way:
'still unclear ow to do this (Excel Automation) in Infragistics Excel document: xlWksPackageTree.Outline.AutomaticStyles = false xlWksPackageTree.Outline.SummaryRow = XlSummaryRow.xlSummaryAbove xlWksPackageTree.Outline.SummaryColumn = XlSummaryColumn.xlSummaryOnLeft
Thanks for any hint.
Regards
Martin
Hi Teodosia,
this Excel file below (without any code) demonstrates my concerns. In my hierarchy, I have parents and children present, and it's guaranteed that the parents are above their children. If Excel group Default is "Group above Details", this works fine. If the Default group position is "Group below Details", it fails. And to ensure that Excel puts the Groups above the details, I'm trying to influence this. In Excel-VBA, this can be controlled using the VBA Code in my original post. But in Documents.Excel, there seemes not to be any eqivalent.
The Excel dialogue affected is shown in this Picture (sorry, German Excel Version, hope you can recognize the command):
teodora.xlsx
Thanks