Hello everyone,
I have a XamGrid in that state.
And here is my problem : when i export the XamGrid with the export function from the samples everything is fine, but when i apply more than one group i have only the fisrt group expandable in the Excel file.
As we can see we can collapse/expand the first group by the second is just indent.
Is someone knows how can I do to collapse the next groups ?
HI,
I am reviewing your issue
Sincerely, Matt Developer Support Engineer
The OutlineLevel controls the grouping of the rows in the Excel. The following code shows how this property is used.
Workbook wb = new Workbook(); Worksheet ws = wb.Worksheets.Add("MySheet"); ws.Rows[0].OutlineLevel = 1; ws.Rows[0].Cells[0].Value = "Level 1"; ws.Rows[1].OutlineLevel = 2; ws.Rows[1].Cells[1].Value = "Level 2"; ws.Rows[2].OutlineLevel = 3; ws.Rows[2].Cells[2].Value = "Level 3"; ws.Rows[3].OutlineLevel = 3; ws.Rows[3].Cells[2].Value = "Level 3 Row 2"; ws.Rows[4].OutlineLevel = 1; ws.Rows[4].Cells[0].Value = "Level 1 - Row 2"; ws.Rows[5].OutlineLevel = 2; ws.Rows[5].Cells[1].Value = "Level 2 - Row 1 of Row 2"; ws.Rows[6].OutlineLevel = 3; ws.Rows[6].Cells[2].Value = "Level 3"; ws.Rows[7].OutlineLevel = 3; ws.Rows[7].Cells[2].Value = "Level 3 Row 2"; SaveFileDialog sd = new SaveFileDialog(); if (sd.ShowDialog() == true) { Stream s = sd.OpenFile(); wb.Save(s); s.Dispose(); }
I don't understand your problem. In the XamGrid, you have a GroupByRow with value 1, 2 groupby rows with Value 2, and then a few child elements below that. The excel looks the same to me.
I don't understand what you are looking for. Do you expect the "Group 2" text to also be in Column "A" in excel?
Excuse me i miss something in my post.
The Excel is exactly what i want but it's for the left part where we can collapse or expand the groups.
In this section each group of elements of each group has a higher outlinelevel, for example for the group 2 the first elements have points under the third column in the left section and the second elements hav points under the fourth column.
And this is my problem, i would like the elements of gorup 2 under the same column in left section.
I don't think there is any way to control the indentation of the group markings.
I really think it's an algorithmic problem, when i passed throught the function in debug mode the outilne level increments with no reasons. I pretty sure the problem come from the récursive call but i can't see it if someone could look that way and tell me if it's really impossible or else.
Thanks
HI Cosoluce,
I noticed that you are increasing the OutlineLevel every time you encounter a child GroupByRow. What happens if you move the OutlineLevel increment to somewhere outside the foreach loop for the GroupByRowChildren?"
Sinc erely, Matt Developer Support Engineer
Hello,
I made you a solution, let me know if you have further questions.
Stones:
Can you share the export to excel complete code
I do have a similar need, xamgrid has 2 grouped columns ,and user clicks Export need the excel in the same format they see on screen, right now i get row data in excel without groupings.
thanks
Thanks for your reply i reviewed the code and finally found the soution. The problem was on the recursive call, i increased the outlinelevel instead of passe the outlinelevel value plus one.
To solve the problem i replaced the parameters in the recursive call :
IterateGroupByRow(child as GroupByRow, outlinelevel+1);
And that's it!
Thanks to everybody for the replies.
Regards