1,804 articles and 14,809 comments as of Monday, May 2nd, 2011

EndUserSharePoint has combined resources with NothingButSharePoint.com. You can now find End User (Mark Miller), Developer (Jeremy Thake) and IT Pro SharePoint (Joel Oleson) content all in one place!

This site is a historical archive and is no longer being updated. Please update your favorites, bookmarks and RSS feeds.

NothingButSharePoint.com
Thursday, February 19, 2009

How the Data View Web Part Can Enhance the Quality of Your Life

A note from Mark Miller, Founder and Editor of EndUserSharePoint.com
At the SharePoint conference last March in Seattle, I had the pleasure of attending Asif Rehmani’s session on exposing database information in SharePoint without the use of the BDC (Business Data Catalog). I liked his style, the clarity of his presentation and the subject matter. We have been in touch ever since.

I asked Asif to provide a series for EndUserSharePoint.com to talk about his use of the Data View Web Part. This is the first article in the series. He and I are both excited about the possibilities when using the Data View Web Part, and I hope that enthusiasm comes through in this series.

Data View Web Part

Introduction

In 2005, I built an application for SharePoint (WSS v2) using custom web parts. I built these web parts using C# code that used the SharePoint API. My end deliverables were 3 separate web parts named Customers,Orders and Order Details. As the names suggest, these web parts fetched and displayed customer order data. In addition to displaying the data, I also enabled editing functionality so I could write back to my data source (which by the way was a Sql database). To create this solution, it took me three days (I was not a very fast developer). When I create a SharePoint application today to accomplish the same goal, it takes me a few minutes and I do it without code using the Data View web part. So less time and less effort for the same end result means more time I can spend with my wife and two boys thus enhancement in the quality of life.

Some Technical Jargon

There are 66 web parts that come with the Enterprise license of MOSS. None of these web parts come even close to the power provided by the Data View web part (DVWP). Officially called the “XSLT Data View web part” (also known as the “XSLT Data Form web part”), this web part has the ability to fetch data from a variety of sources as XML and then use the eXtensible Stylesheet Language Transforms as the markup language to format that data and present it on a page. DVWP can get data from any of the following sources:

Data View Web Part
Snapshot of the Data Source library for the DVWP

What do I need to get started?

The Data View web part is available currently only through SharePoint Designer which means that to create and configure this web part, you would need at least one licensed copy of SharePoint Designer. Once the web part is created and deployed on a SharePoint page, it can be easily exported if needed and imported at another site or page. At the server level, you only need Windows SharePoint Services to deploy this web part.

Imagine the Possibilities

Once you start thinking about the possibilities of what you can accomplish with the Data View web part, it is hard to imagine how you had done without it for so long. Consider the following solutions:

  • Convert a List View web part into a Data View web part to customize the presentation of your list data on a page
  • Create a view of Lists or Libraries on another SharePoint site
  • Manage the data in your custom Sql database
  • Connect to the web service provided by Amazon.com to show a list of books on a certain topic within your SharePoint site
  • Show a RSS blog feed on any page on your site
  • Create a unified view of your Customer data being fetched from a List and also a table in the Database

The possibilities are truly endless for what you can accomplish with this extremely powerful web part.

Where we go from here

This is the first article/post in a series of posts that I’ll be writing from time to time to show the different aspects of data fetching and manipulation using the Awesome Data View web part. You will see how easy it is for a Power User to implement a robust solution using this web part. So first order of business for you, if you want to take advantage of this functionality, is to go out and purchase a copy of SharePoint Designer. Until next time…

Asif RehmaniAuthor: Asif Rehmani – SharePoint Server MVP, MCT
Website: SharePoint eLearning

Asif has over 10 years of training and consulting experience in the IT industry. He has been training and consulting on primarily SharePoint technologies for over 4 years. He is a SharePoint Server MVP and MCT. 

Asif is the co-author of the book Professional SharePoint Designer 2007 by Wrox publications. He has also been a speaker on SharePoint topics at several conferences over the years including Microsoft’s SharePoint Conference, SharePoint Connections, Advisor Live, and Information Workers Conference. 

Asif runs a SharePoint eLearning website (http://www.sharepoint-elearning.com) which provides dozens of SharePoint Video Tutorials. He was the co-founder and is currently one of the active leaders of the Chicago SharePoint User Group.

 

Please Join the Discussion

16 Responses to “How the Data View Web Part Can Enhance the Quality of Your Life”
  1. Asif,

    I had been looking for a solution which will help me to fetch and update my list data from and in SQL database. Looks like this Data View we part can help me to faciltate the data intergration in my list

    One question: can you also show how to initiate the worklow based on data in the list and update a column in the list which will then update in sql database.

    Thank you & Appreciate your help

  2. Ben says:

    Hi Asif,
    I can’t wait for this next post on this. I am currently struggling with updating a SQL Server table from a DataView web part.

    I can display the data just fine but I am obviously missing something as I don’t get the normal options I’d expect to see with a DataSource around inserting a single item form or multi item form – only display options.

    Best regards
    Ben

  3. Tom Resing says:

    Asif,
    Can’t wait to see your next post. Bummed I missed you at SPC2008. I’ll have to check out your session on the DVD sometime.
    -Tom

  4. Asif Rehmani says:

    Another article coming very soon folks. Thanks for the encouragement.

    -Asif

  5. The next article in this series goes live on Thursday morning, March 5, and I think you are REALLY going to like it… stay tuned.

  6. Nancy says:

    I have been requested to “learn how to use SQL data in a SharePoint site.”

    Obviously I know that means using BDC and the dataaview web part… but that’s about all I know.

    I think (if I understood it all better) I would get much more out of these posts.

    Can you point me to a book, class, webinar, or other training that will give me from-the-ground-up education? I am NOT a developer or a database person so I will need to get (probably) a more basic level in this area. I know I am depriving our users of a lot of functionality by remaining ignorant of what is possible. THANKS!!

  7. Husain Taiyebi says:

    Nancy,

    BDC Meta Man for SharePoint can give you more insight

    http://www.lightningtools.com/bdc-meta-man/default.aspx

    They just published a book through Manning Publication
    SharePoint 2007 Developer’s Guide to Business Data Catalog

    Hope you get some help from above guide

    Regards
    Husain

  8. Joseph says:

    I am using data view web part for displaying the data from SQL server. I used a stored procedure with no parameters to get the data and worked fine. Later I added a parameter to the stored procedure for filtering the data. I mapped the parameter value to Form element. I am getting the following error in the Designer.
    The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again.

  9. Nancy says:

    Thanks- I just bought the book!

  10. bilal ahmad says:

    I have found some really nice posts here…

    Can you please give me some hint, how can I deploy a DataView webpart as a feature ?

    I developed a DataView webpart which customizes the display of a List. Many of my List will use this display. I am looking for some mechanism of registering a single Dataview web part used by multiple lists on my production server. I also want to be flexible in modifying the appearance after system goes live.

    Thanks

  11. Pradeepti says:

    Hi,

    The requirement that we have to implement is to pull the data from SQL database and store it in a custom list.

    We would like to know how can we store/save the data from DataView web part to a custom list.

    Is there any other way through which we can implement this.

    Kindly help us as we are stuck with this.

    Thanks in Advance
    Pradeepti

  12. Suresh says:

    Asif,
    Can we work on data view web parts just by installing WSS 3.0 and with out having any MOSS license?
    Can we get designer without MOSS license?

  13. Janardhan says:

    Hi,
    I have learnt to create ‘DataView’ web part in the SharePoint designer by adding new ASPX page. Can anyone tell how to add C #code to it?

Trackbacks

Check out what others are saying about this post...
  1. How Data View web part can Enhance the Quality of Your Life…

    Body: <Cross posted at Endusersharepoint.com > In 2005, I built an application for SharePoint …

  2. How Data View web part can Enhance the Quality of Your Life…

    Body: <Cross posted at Endusersharepoint.com > In 2005, I built an application for SharePoint …

  3. [...] How the Data View Web Part Can Enhance the Quality of Your Life [...]




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!