Hello,
I am having some problems getting the column headers on an exported UltraWebGrid to be multiple lines high and wrap as needed.
Here is what I am doing:
I have multiple data tables of data to be exported onto one worksheet. To accomplish hits, I first create a new Workbook and Worksheet object. Then, for each data table, I am binding the data table to an UltraWebGrid that is on the form and is set to auto generate columns. I then call the Export method of an UltraWebGridExcelExporter specifying a row for it to export to as well as the grid to export and the sheet that I created earlier. I then repeat this process using the same grid for each data table. Once all of the data tables have been exported, I stream the Excel workbook out to the browser using the Save method of the Workbook, passing it the Page’s OutputStream. Other than the header heights, this is working beautifully.
A few other things that I am doing, in case it matters, are:
Things I have tried:
How can I get the header cells in the exported file to be taller and to word wrap?
Thanks Glenn
Ok, I did finally get this to work, just not as "cleanly" as I had hoped. After I call the Export command of the UltraWebGridExcelExporter, I run the following lines:
sheet.Rows[currentRow].Height = 602;sheet.Rows[currentRow].CellFormat.WrapText = ExcelDefaultableBoolean.True;
This sets the height and wrapping of the curent row, which is where I exported to, so it is the "header" row. Remember that Excel sets the height in Twips, so that is 602 twips, or about a value of 30 as seen in Excel.
Hope this helps someone...
Glenn
Hello Glenn,
thank you for sharing this with the community.