Hi I am having a grid which was binded with a hierarchical data and the number of maximum bands expected are 4.
On screen this is looking fine with a expanded +/- symbol. I am using UltraGridExcelExporter control to export to excel.
after I export to excel, in the excel sheet only the first band data are in proper places. the second or further band data (i.e child band data) or skipping one column from the parent row and the readability is lost.
attached the screenshot for your reference.
What we want is the + symbol should be expanded in the excel but all the child bands should be plotted from column A.this is applicable for all child bands. i.e all the child bands should be plotted from Column A.
any suggestion please.
Thanks,
Arun.K.S
oh shoot!! I didn't even realize, haha. Thanks!
Okay, it looks like the problem is that you are using WebGrid and this is the WinGrid forum. :)
You should post your question in the WebGrid forum and hopefully someone there can assist you.
Here is the code I am using:
Private Sub ExcelExporter_BeginExport(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.ExcelExport.BeginExportEventArgs) Handles ExcelExporter.BeginExport
For Each band As Infragistics.WebUI.UltraWebGrid.UltraGridBand In e.Layout.Bands band.Indentation = 0 band.IndentationType = IndentationType.Flat band.HeaderStyle.Font.Bold = True Next End Sub
The output of the export looks like this:
+UserName 1 +User 1 Data Line 1 User 1 Data Line 2+UserName 2 +User 2 Data Line 1 User 2 Data Line 2
Instead of this:
+UserName 1+User 1 Data Line 1User 1 Data Line 2+UserName 2+User 2 Data Line 1User 2 Data Line 2
Where the '+' sign indicates that expand/collapse functionality in Excel/the grid.
For whatever it's worth, the header of the band doesn't get changed to Bold either. I tried setting Indentation to 0 as well as setting the indentation type - I had started with just setting Indentation to 0 but when that didn't produce the desired results I also tried setting that IndentationType to Flat.
What am I missing?
I'm sure this works. Can you post the code you used? Are you using the correct layout - make sure you are using the layout passed into the event and not the grid's DisplayLayout.
sarunmphil,
Were you able to get this working? I'm having the same problem... in the export to excel, we would like to be able to expand/collapse the child rows but would like all child rows to start in column A and not be indented one column.
I tried the suggested solution, namely, handling the BeginExport event and looping through all the bands in the Layout and setting the indentation to 0, but this has not resolved the issue. In the resulting excel file, each child band is still indented by 1 column.
If anyone knows how to resolve this, please let me know!!