I have to believe this is a common request, but it is driving me crazy...
I have a grid, it is grouped by a column. When I export the grid to excel it puts the group by value in Column A and sets it width to the columns width. It then starts on the next row with the data rows. So when you look at the grid in excel you have a big column A and then your data is in column B and not under the group by column. Looks weird and I don't want my users to have to resize Column A everytime they open the spread sheet.
Ideally, I would like to merge the Cells in the group by row (just like it does it on the grid), in the Excel file. Failing that, at least set the width of column A to something small (like the indention width, and let Excel display over muliple cells if it has to.
Like I said, I'm sure I'm missing something because it does way to good of a job formating everything to not have consider what must be a pretty common occurance....
ravii said:but look at Line number 122 which is the grand total, which is not properly indended. This column should also be shifted to the previous column.
That looks like a bug to me. What version of the grid are you using? Do you have the latest service release?
How to get the latest service release - Infragistics Community
ravii said:Also I always get a blank row, next to the group header - line numbers 111 & 117, I need to remove these. Is there a way to do it ?
There's no easy way to prevent this. You might be able to handle the RowExporting event and try to detect when the first row in an island is exported under a GroupByRow and then subtract one from the CurrentRowIndex on the event args to shift everything up one row.
Hi Mike,
Please refer the attached image.
Here the rows are grouped by the column Sector. After using the above code, all the columns start at column A, but look at Line number 122 which is the grand total, which is not properly indended. This column should also be shifted to the previous column.
Also I always get a blank row, next to the group header - line numbers 111 & 117, I need to remove these. Is there a way to do it ?
Thanks.
Hi Ravi,
I'm afraid I do not understand what you mean. Can you post a small sample project demonstrating what is happening so I can see it in action? Or maybe some screen shots?
In my grid, I have grouped based on one column and have included the sub totals at the group level and also have a grand total.
When I use the above code, all the rows except the grand total row is prevented from shifting to column B, but the grand total row still starts at column B. How do I prevent that ?
Hi,
If you want to stop the child rows from shifting over into column B, try this:
private void ultraGridExcelExporter1_BeginExport(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.BeginExportEventArgs e) { foreach (UltraGridBand band in e.Layout.Bands) { band.Indentation = 0; } }