Hi there,
we are using the ExcelExporter engine to export our grid into an excel file.
Everything works fine except the layouting for the exported header row (I mean the column headers ;) ). It doesn't set its height correct to show the complete text content!
All other rows will increase their height automatically if its content need more space than the column width can provide. But not so the row for the header.
Currently we set the WrapText property of the CellFormat property to True (also for the header cells) to enable the increasing of the rows height inside the table.
If we set it to False it seems working correct because the rows doesn't increased their height and don't shows the complete cell content.
WordWrap property it self seems also to work correct as you can see inside the pictures, e.g.. in column 'Problem'.
Any idea why the row for the column header doesn't increase their height or how we can increase it manually?
Here is the header row with WordWrap = False:
Here is the header row with WordWrap = True:
Hello,
Excel columns should be be automatically sized. I believe the answer to your question has been discussed here:
http://es.infragistics.com/community/forums/t/60381.aspx
Let me know if calling PeformAutoResize with IncludeHeaders = True does the trick.
Hi,
if I understand the discussion correct the PerformAutoResize will layout the UltraGrid before the exporting starts.
If I use it maybe it will works fine but after exported the grid the grids layout is also changed in my application.
But the Layouting of the grid (inside the application) is correct at this time and shouldn't be changed (also because the user sets the layout to its own needing).
The exported grid layout it self (in excel) is also correct because there are rows present that contains more content then the current height can display and so the rows height will be increased correct.
But this ins't working only for the header row and you can see in the pictures. There are two column were the text is wrapped into a second line inside the cell but the height of that row ins't updated to show the complete cell content.
It seems that the layouting isn't completely done for all exported cells or the layouting of the header row is implemented different
Hi , In the exported excel - Text is not wrapping for the first 2 rows -cells. From the 3rd rows onwards the text is wrapping up.
My requirement is to wrap the text in the entire excel. For the header I no need to wrap the text.
I am using infragistic v11.1.
Thanks,
Ravi
Great! Let us know if you have any additional questions.
Thank's that worked :)
TS said: if I understand the discussion correct the PerformAutoResize will layout the UltraGrid before the exporting starts. If I use it maybe it will works fine but after exported the grid the grids layout is also changed in my application.
That is not correct. When you export, the grid creates a clone of the DisplayLayout for exporting. This is to you can change the export layout without affecting the on-screen grid. So you call the PeformAutoResize on the columns in the export layout, not the grid's DisplayLayout:
void ultraGridExcelExporter1_ExportStarted(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.ExportStartedEventArgs e) { e.Layout.PerformAutoResizeColumns(false, Infragistics.Win.UltraWinGrid.PerformAutoSizeType.AllRowsInBand, true); }