I am using the UltraGridExcelExporter to create an excel worksheet. The grid I am exporting has multiple bands, the column collections in all of the bands are the same and in the same visible order and the column width are aligned. See attached screenshot.jpg.
In the exported file the cells are not aligned properly (the headers are correct). The first band is offset by 6 cells, i.e. what should be in cell A2 is in cell G2. For the remaining bands the cells are offset by a number corresponding to the band index, the first cell of band index 1 is in column B, for band index 2, column C, etc. See attached export.xlsx.
Is there anything I can do to make the exported cells appear in the same column they do in the grid?
[I am using version 10.3.20103.2094]
I'm pretty sure this is a known bug which is fixed. Try getting the latest service release - there was a newer one than the build you are using released in September.
How to get the latest service release - Infragistics Community
With the latest service release of v11 (11.1.20111.2030) this issue persists. The exported excel document was identically mis-spaced as with the older version of 10.3.
This issue was indeed corrected by the latest service release (11.1.20111.2042).
Correction, this has NOT been completely fixed under 11.1.20111.2042.
All bands are properly aligned except for the bottom-most level, which seems to be offset to the right by the number of parent bands above it.
EDIT: The same behavior exists with 11.2
Hi,
There are a whole lot of variables here, so it's really hard for me to see what you are referring to. Can you post a small sample project demonstrating the behavior you are now getting?
I was finally able to determine the necessary settings to reproduce this issue, please find the repro case attached.
To view the issue, run the program and click the 'export' button at the bottom. Open the exported excel document and drill down into one of the row until you reach the bottom-most band. Notice that all columns are properly aligned to the left except for rows in the bottom-most band, which is indented significantly; seemingly proportionally to the number of bands.
This was most recently run against the very latest 12.1 service release.
I ran your sample and there is definitely something weird going on. It's hard to tell from your sample since all of the rows have the same values in every cell. But when I played around with it and narrowed it down a bit, I can see that not only is the indentation wrong, but it's wrong for some rows in the same collection and not other.
For example, if I narrow the sample down to only 2 bands and a single root-level row, the first child row in the Excel sheet is not indented, but the other child rows are. So this is clearly a bug.
I have forwarded this thread over to Infragistics Developer Support and asked them to create a case for you so we can get this fixed.
How to get the latest service release - Windows Forms - Service Releases
We are also facing the same issue in 12.1.
Would like to know from where we could download the NetAdvantage® for Windows Forms 12.1 Service Release.
Regards
Mohideen
When I said "always" I was referring to the historical intended behavior of the control.
Yes, there was an aberration where this was broken in service release. But aside from that one small glitch, the behavior has always been to indent child rows in Excel just as they are indented on-screen by default. I tested this all the way back to v8.1 and it has always worked the same.
"This is the way Excel Exporting has always worked." Not true. Please see the attached screenshot showing an export from the 12.1 2008 build. The columns are properly aligned except for the bottom-most band (not pictured), and no manipulation of the layout at export time is performed. That was the issue I have continued to follow up on this thread about.
My experience with the exports is that the column alignment was respected (for the most part). If the choice has been made to no longer attempt to respect that alignment, then I will accept that as the new normal.
However, setting the indentation to 0 at export time (on the layout passed into ExportStarted) has proven to break other aspects of the grid when the bands have not been expanded... Once I am able to isolate this behavior in a sample project I will provide it, but until then we're stuck in broken service release limbo.
As for #2, yes that has been fixed in the upcoming release as I mentioned.
1) the indentation of each child band is correct. There is an indentation visibly on the screen and so there is a similar indentation in Excel. This is the way Excel Exporting of the grid has always worked and it is the correct behavior. The cells in each column are aligned with the column headers for that column.
If you want the columns in each band to line up with the columns in other bands, you can easily achieve this by setting the Indentation on each band in the export layout to 0. You can do this in the ExportStarted event.
2) This is a bug. I am pretty sure it is fixed in the latest service release which was posted last week. If it's not in that one it will be in the next one.