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.
Hi,
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.
Hello,
I have investigated your issue regarding incorrect row indentations when exporting Grid to Excel. I have asked our engineering staff to examine this further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 113828. The next step will be for a developer to review my investigation and confirm my findings or to offer a fix, or other resolution.
I will update you with any new information after the review. You can also update this forum post with any questions you may have.
Please let me know if you need more information.
Is a case number available for this issue yet and should I anticipate seeing it added to the 'my support activity' section of my account?
Hi rastedt,
As requested, I have created a case to update you via the "my support activity" section of your account. Please note that I will be updating this forum with the information needed to resolve this issue once our developers have completed their review of Development ID 113828.
Please letme know if you have any questions regarding this matter.
The fix for "Cell placement in multiband Excel Export" has been resolved in NetAdvantage 2011 Volume 2 and newer. To take advantage of this fix, please download the latest service release using the instructions found here: http://community.infragistics.com/forums/t/29398.aspx
Please let me know if you have any questions.
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.