SharePoint lists have the ability to export their contents to an Excel Workbook.
This is quite cute – it gives the users a way to get the data out into something they’re familiar with, can manipulate and can print. However, I was having an issue. Using a list based on a Custom List (above), one of my columns (Enquiry) wasn’t exported:
I wondered at first if this was because of it’s column type (Hyperlink), or because I’d created the column programmatically. Then, on a hunch really, I tried changing the column order. I added another column before it in the list view. I used the ID column, but any should work. When I exported the list – all the columns I wanted came through (but the ID column didn’t).
What I think is going on here is that if you used the same export on a document library then typically – though not always – the first column is an icon for the type of file it is. My suspicion is that some muppet, when writing the export to excel, realised that they’d have these icons, and decided to avoid them by excluding the first column. This is unfortunate for two reasons:
- Not all lists have icons – witness my Custom List
- Not all document libraries have the file icon as the first column.
For now the resolution would be to have another column as the first on your list.
That certainly is a Muppet like way to deal with the fact that ‘computed’ columns don’t always render as text. (always exclude the first one.) I wonder if that’s what the $FreeForm variable means in the XSL rendering, because all of the built-in file name related ones just print raw text if $FreeForm is set.