Export a Dataview as part of a Site Template

Out of the box, if you use a list-bound dataview as part of a Sharepoint Site Template, you’ll get a grumpy message when creating a new site

“Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator.”

How helpful.

The issue is the dataview has a hard-coded reference to the list guid on the original site. To resolve this, simply wrap curly braces “{” and “}” around all instances of the guid. This tells Sharepoint to refer to the newly created list when deploying the site template.

Granted this seems like a bug, but it works.

There should be 6 or 7 references to the listID in any dataview. Just hunt through the code and you should find it fairly easily.

Leave a Reply

Your email address will not be published. Required fields are marked *