Hello,
In an Excel Export of a ultrawingrid, I have to group by one special column to get "sub headlines".
The solution I found is: ugMygrid.DisplayLayout.Bands[0].SortedColumns.Add("group colxx", false, true);
The output I get now is (I played a bit with Colors in Export_Started-Event)
means I get empty lines above and below a group and all other columns are shifted one column to the right.
What i'd like to get is (group Headlines to a merged cell and no empty lines):
is that possible??
I see that my screenshots are gone.
Try to show it here:
What I get
A B C
+Name
COL1 COL2
COL12 COL22
<emptyline>
+Name2
...
What I want
Col1 Col2 Col3
Col11 Col22 Col33
and without <emptyline>
Hi,
If I understand you correctly, you are exporting a grid with OutlookGroupBy and you want to eliminate the extra space (line) that appears in Excel between the GroupByRow and its first child row and also the space before the GroupByRow (after the first one).
This is a bit tricky and you have to make some assumptions about the data, but I believe it can be done using the events of the UltraGridExcelExporter to change the CurrentRowIndex at certain key points.
I was able to get it working in a simple sample which I have attached here. It requires hooking a number of different events in order to keep track of when the last row exported WAS a GroupByRow and also to adjust the CurrentRowIndex before the export of the first item after that GroupByRow.
Hi Mike,
thanks for the answer so far, that solves one thing I need.
The other thing is, to have the data exported starting in column A, not B. I don't know if this is a restriction caused by Excel if grouping data or if it can be "overwritten" by the export.
Do you have an idea here?
Thx,
Beissi
Hi Beissi,
Yeah, that's easy:
private void ultraGridExcelExporter1_ExportStarted(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.ExportStartedEventArgs e) { e.Layout.Bands[0].IndentationGroupByRow = 0; }
Great! thanx very much!