(Tested for SP 2007 only)
A Data View Web Part (DVWP) is a web part created using SharePoint Designer that can display data from just about any kind of data source, inside or outside of SharePoint. Moving the web part from site A to site B or from server A to server B should be as simple as exporting it from one site and importing it into the other. Should be…
If the DVWP is not using data from a SharePoint list, then moving it is pretty easy.
From the site where you created and tested the DVWP:
- Click the dropdown arrow in the web part's title bar, click Export and save the file
- Move the file to the other server if needed
- Open the new site and the page for the web part
- Click Site Actions, Edit Page
- Click Add a Web Part
- At the bottom of the popup window click “Advanced Web Part gallery and options”
- Now for the tricky part… find the Import button!
In the “Browse” bar at the top of the panel there is a dropdown arrow. Click it and click Import
- Browse to your exported file and click Upload
- Drag the uploaded web part (usually a yellow bar with the name of the web part) to the desired web part zone
If the DVWP is using data from a SharePoint list then you have a little more work.
Your web part will have a Globally Unique ID (GUID) to indentify the list. This ID will be different for every list you create.
First get the GUIDs (There are several ways to do this, here’s one…)
- Go to the list in the site where you created the DVWP and go to the list or library
- Click Settings and List (or library) Settings
- Look in the browser’s address bar and you will see something like this:
- Copy everything after the “List=” and paste into Notepad
You should now have something like this in Notepad:
- The GUID you copied is encoded. You now need to clean this up
- Delete the “%7B” at the beginning
- Delete the “%7D” at the end
- Do a search and replace and change “%2D” to “-“ (a dash)
- Export the DVWP - click the dropdown arrow in the web part's title bar and click Export and save the file
- Open the exported file in another Notepad
- Search for the GUID you just cleaned up and replace with the name of your web part (“Announcements”)
- Search for “ListId” and replace with “ListName” (capitalization is important here)
- Save the file and then import the web part using steps 3-9 in the first set of instructions above.
If you see “Unable to display this Web Part. To troubleshoot the problem…” then you messed something up with the GUID, the ListId vs ListName, or maybe the source list has a column the destination list does not.