Posts Tagged ‘data view’

Obtaining a List’s Views

Tuesday, August 18th, 2009

This is another post of a solution related to Microsoft’s SharePoint Employee Training template, but this solution can be used on any list on your site.  Here’s the story…

We use this employee training template to set up various training series at work.  For example, if there’s some diversity training coming up, there will be a lot of different appointments for this training, and employees can pick a time that’s convenient for them, and sign up for one of them.  For each of these series, I’ve created a view in the Courses SharePoint calendar that filters by the name of that training course, and I’ve trained the other appointment creators to do the same each time they have a new series.  This makes it easy for them to send out an email, announcing the new training.  They put a link to the filtered view for that training, right in the email. 

If users simply went to a list of all courses, they may be overwhelmed, because their are so many different and varying courses in the calendar.  They only need to see the list of that one pertinent course at that time.  The payroll department may have a training series on how to use the new financials system, and the HR department may have some courses on diversity, and the community relations department may have some related to upcoming charity events.  So, VIEWS on the calendar allow users to see a list of the one type of training they’re looking for, which usually has eight to 10 different date/times that you can pick from to attend.

Anyway, so that’s pretty simple… views.  Well, I wanted to take it a step further.  I want the users to be able to go to the main event registration site, and immediately see a list of the types of training that they can register for, which is really just a list of the filtered views on the calendar.  Guess what… there’s a web service for that!!  There’s a built in web service called views.asmx, and we can tap into it.

First of all, here’s my 5 minute screencast, that teaches you how to connect to a web service from within SharePoint Designer.  In the screencast, I demonstrated how to connect to sitedata.asmx, and I also wrote a previous blog entry called “I Love the SiteData.asmx Web Service“.

In the example today, though, we’ll be connecting to the Views web service instead.  In the Service Description Location box, put in the URL of your site, and at the end of it, put /_vti_bin/views.asmx
For example, here’s what it would look like http://webapp/sites/sitenamehere/_vti_bin/views.asmx.  Click to <Connect>

Views Web Service

Views Web Service

 

  • For Operation, choose “GetViewCollection”.
  • Double-click on the ListName parameter, and type the name of your list.  In this example, it’s the Courses calendar.
  • On the Login tab, set it to Windows authentication.  Click OK.
  • When you click the name of the new web service source and choose “Get Data”, you will see the Data Source Details Pane.

As you will have already seen in my screencast, the data can then be placed on the page as a data view web part.  The Field that I displayed in mine is the “DisplayName”, and I used the “URL” field as the hyperlink.  Once you have created this web part on a regular web part page, you can then export it out, and then import it onto any page in your site.  For this example, I put this data view on the main welcome page of the events registration site.

End result? When the calendar owner adds a new series of events to the calendar, she has been instructed to create a view for that set of events, just using a filter by the title field in the view.  Once they have created this view, it will automatically be displayed in the new web part on the event home page!  Therefore, end users can now easily see the types of training available, and click to see the list for that particular type of training, and register for the time that is convenient for them.

July Diary

Sunday, July 26th, 2009

Dear Diary…

No, seriously.  This post is just a recap of what’s going on lately with me and the SharePoint community.

Last weekend, Lori Gowin, Cathy Dew and I took a 9 hour road trip from Birmingham, Alabama to Harrison, Arkansas, for SharePoint Saturday - Ozarks.  We recorded a set of “on the go” videos, again, as an homage to Michael Gannotti.  There is a set of 5 videos on the way there, totaling 50 minutes.  Then, there’s a set of 3 videos on the way back, total of 25 minutes.  Here’s my Flickr site, where I uploaded all (most) of the pictures that I took there.  SharePoint Kevin also took plenty of pictures.

In the video on the way back part 3, we talk about the SharePoint Saturday that’s going to be in Birmingham, Alabama on Nov 21, 2009.  How exciting!  We’re revved up, and looking forward to getting some great speakers to come down to our neck of the woods for this fabuous event.

Let’s see, what else… oh yeah, last week on July 21st, I did a presentation at SharePoint Nation’s virtual SharePoint user group meeting!  Amanda Murphy coordinated this, and Mark Miller was the host of the event.  My presentation was called “Making the most of out-of-box web parts”.  It was recorded on LiveMeeting, and you can view it anytime HERE.  You can tell that we all had a lot of fun doing this, and hopefully you’ll find it informative.

The next big event I’ll be attending will be the Best Practices Conference in Washington, DC on August 24-26, 2009.  Mark Miller of endusersharepoint.com and I will be a media sponsor for the event.  What does this mean?  Basically, Mark and I will have an “EndUserSharePoint” booth, and we be live streaming from the event, doing interviews, and coordinating live blogging in all of the sessions!  Here is the blog post where Mark announced this.  So, come to this conference, and stop by our booth to say “hi”!

What about data view web parts?  If you’re following my blog, you’ll notice that I talk about data view web parts a lot.  I’ve also done an entire data view web part series on endusersharepoint.com.  So, even though sometimes I forget to put those posts on my blog, a lot of my articles and screencasts are only on that site.  The latest screencast was how to do a join between 2 SharePoint lists, to show data from both of them in one list!

Finally, I thought I’d help promote the SharePoint Podshow.  There is going to be a RV road trip (”Road to the SPC”) the week before October’s big Microsoft SharePoint Conference.  The trip will start in Seattle on October 10th, and will end in Las Vegas around the time that the conference begins.  What the heck is the SharePoint Podshow?  It’s a monthly downloadable podshow, where Rob Foster, Brett Lonsdale and Nick Swan do interviews with big names in the SharePoint community.  This show has been around for about a year, and is getting more and more popular.  So, during the RV road trip in Oct., the plan is to make stops at SharePoint user groups along the way, meet people and make new SharePoint friends.  There will also be  stops at companies, and talk to them about SharePoint, and do demos, etc.  Contact Rob at Feedback@SharePointpodshow.com if your SPUG or company is along the general route and is interested in a visit.

“For Me” Web part in MOSS

Thursday, July 23rd, 2009

Cool stuff… data view web parts again!  So, here’s an idea for a main page for a SharePoint intranet.  This is using the data view web part (in Sharepoint Designer) and a web service.

First of all, for beginners, here’s my Data View Web Part, The Basics - Insert a DVWP on Your Page and there’s an associated screencast, too.  (There’s a whole series of mine on data view web parts on that site)

Business solution:  I’d like to have a web part on our main SharePoint intranet welcome page, that will show the current logged in user some links that pertain to them specifically.  What better to use than the “Personalization Site Links” that already exist in my SSP!?

Background: When you create Personalization Site Links in your SSP, you’re basically targeting specific links to specific audiences or groups of people.  The end result is that when users go to their My Site, there will be a tab at the top for each of the links that is targeted to them.  A good example is to set up a link for each major corporate department, and target it so that everyone in that department will see the link to their department’s portal or home page.

Here’s how to create a data view web part to utilize the personalization site links:

  1. Open up your site and a web part page in SharePoint designer, and in the Data Source Library, click to expand “XML Web Services”.  Click to “Connect to a web service”.
  2. In the “Service description location”, paste in the URL of your sharepoint site collection.  At the end of that URL, put a /_vti_bin/PublishedLinksService.asmx
  3. Go to the <Login> tab, and change it to “Use Windows Authentication”.  This, of course, will vary according to your authentication method in your own implementation.
  4. On the <General> tab, you can change the name to “Personalization”.
  5. Back on the <Source> tab, click the <Connect now> button.
  6. This is easy, there’s only one operation, “GetLinks”, so that’s the one that should be selected.  Click OK.
  7. Click the name of the new web service on the right, and click to “Show Data”
  8. I recommend putting all of the fields in a “Multiple item view”, just so you can see what all is in there. 
  9. All I really want is the Title of the item to show, as a hyperlink to that item, and I only want to see those personalization site links and I’d also like to go ahead and include the My Site link, just in case users don’t notice it already at the top right of the page.  You’ll notice that there may be other stuff in there, such as sites that you’ve saved as “My Links”.  I see that there’s a LinkType field that will help me do a filter, and I found a Microsoft PDF file that has (on page 22) a list of what these Link Types are.
  10. Anyway, In my Data view web part, I’m going to filter by LinkType = 4 OR LinkType = 2
  11. I went ahead and removed all of the columns except for Title, and I made the title a hyperlink to the URL field in there.  Here’s my screencast on how to do hyperlinks in a DVWP.
  12. Wow. Pretty!  Now, I have a cute little web part that I can export, and place it anywhere in my site collection, like the main welcome page! 

Data View Web Part, The Basics - Keep it Clean

Wednesday, May 27th, 2009

This was an article that I wrote on endusersharepoint.com

Data View Web Part, The Basics - Keep it Clean

Original Publication Date: Monday, May 18, 2009
SharePoint User Level: Power User
This is pretty easy, and is applicable in most scenarios when using the data view web part. Basically, you create a blank web part page on your site, open that web part page in SharePoint Designer, and create your data view web part. Then, you save your (temporary) web part page, and click YES to the site definition page warning….

Data View Web Part - Add a Hyperlink

Tuesday, May 19th, 2009

This is an article and screencast that I did on Endusersharepoint.com

Data View Web Part, The Basics - Add a Hyperlink (Article)
Original Publication Date: Thursday, May 14, 2009
SharePoint User Level: Power User
When a Data View Web Part is added to a page in SharePoint Designer, it is sometimes useful to include links to the content of the list. In a regular view of a list on your site in the browser, the list’s Title field is a link to open the item.

Original Publication Date: Thursday, May 14, 2009
SharePoint User Level: Power User
This screencast is a supplement to Laura Roger’s article, Data View Web Part, The Basics - Add a Hyperlink.  Yeah, I don’t know why my face was green.  Cheap camera?

Data view web part basics - Folders!

Tuesday, May 19th, 2009

I wrote an article, and did a screencast on Endusersharepoint.com

Original Publication Date: Wednesday, May 13, 2009
SharePoint User Level: Power User
When creating data view web parts in SharePoint Designer, and dealing with libraries or lists that contain folders, the Item and Folder Scope setting becomes pretty important. In SharePoint views, it’s always possible to create a new view of the list with no folders, by configuring the “Folders” section in your view settings. Unfortunately, the same functionality is not as obvious in SharePoint Designer. When you create a view with no folders, and then convert it to XSLT in SPD, the folders always reappear.
 
Original Publication Date: Wednesday, May 13, 2009
SharePoint User Level: Power User
This short screencast is a visual walk-through of Laura’s previous article, Data View Web Part, The Basics - Folders. In this session, she show how to display all files within a library, even when those files are stored in multiple folders.

Data View Web Part (DVWP) Series

Tuesday, May 12th, 2009

Good afternoon!

There is a new series of articles that I started writing, regarding the data view web part in SharePoint Designer.  These articles have been published on the endusersharepoint.com site, so I’ll just link to them from here.

New Article Series: Laura Rogers on Data View Web Part Basics - This article is simply an introductory article regarding this new series of articles

Data View Web Part, The Basics - Insert a DVWP on Your Page - This is a very simple set of instructions on how to insert a data view web part onto a web part page.  Future articles will go into more detail. 

6 Minute Screencast: Insert a Data View Web Part onto a SharePoint Page - Mark Miller steps through the instructions to insert a data view web part.

Thanks for reading, and stay tuned as we get into the nitty gritty with these super awesome fun web parts.  ;-)

I Love the SiteData.asmx Web Service

Monday, March 30th, 2009

Twitter users, you can Re-Tweet This Post.

There are a whole slew of SharePoint web services, but today I decided to try out the SiteData.asmx one, in a data view web part (the GetListCollection operation in particular).  As I’ve mentioned before, I’m not a developer, so in a lot of cases, the data view web part (DVWP) has become my best friend.

In various SharePoint discussion threads, message boards, and Q &A panels, there have been many people who have asked the following question:  How can I just display a list of my site’s document libraries in a web part?  There are varying reasons for this, such as just wanting to automatically have them all listed together somewhere other than the quick launch.  Good news!  It looks like there’s a way to do this, using the SiteData web service and the GetListCollection operation. 

  1. Create a blank web part page, and open it up in SharePoint Designer.  Click on “Click here to insert a Web Part”.  This is really just to make sure that you insert this web part into a web part zone, and not some random spot on the page.   
  2. On the <Data View> menu at the top, click <Insert Data View>
  3. In the Data Source Library pane on the right side, expand “XML Web Services” and click on Connect to a Web Service.
    Data Source Library
  4. Now, on the Data Source Properties screen, I always do this first, just so I don’t forget.  Go to the <Login> tab, and select Use Windows Authentication.  Of course, if you have Kerberos or some other security scenario, you’re welcome to pick something else. 
  5. Now, go back over to the <Source> tab.  Copy the URL of your site to the clipboard, and paste it into the Service Description Location box.  Then, after it, type:
    /_vti_bin/sitedata.asmx
  6. Click <Connect Now>
  7. Leave the default Data command as Select, and for the Operation, choose GetListCollection
    As far as the Port goes, if someone knows the difference between Soap and Soap12, please let me know. 

    Data Source Properties

    Data Source Properties

     

  8. Click OK
  9. Click the drop-down box on the name of the new web service (SiteData on…) and click Show Data.
  10. Now the Data Source Details task pane appears on the right, which lists all of the fields in the data source.  Select the following fields: Title, Description
  11. Click Insert Selected Fields as, and choose Multiple Item View.  Now, you see a list of all lists and libraries on your site, along with their descriptions, similar to what you see on your View All Site Content page.
  12. Now, before we filter it to just show document libraries, I want to show you a couple of other things.  Click inside your list, and click the little chevron at the top right of the list, which will show you a new menu. 
  13. Click Edit Columns, and add the following columns: Inherited Security, Internal Name
    See how cool!  Those of you that use the URL of the list settings page to obtain the list GUID may be relieved to see this method of getting it.  Also, wow, now we can see what lists and libraries are inheriting permission from the parent or not! 
  14. Just as a side note for fun, you can always click on the data in the first row of the InheritedSecurity column, and choose <Data View>, <Conditional Formatting> and create a new condition so that if the list doesn’t inherit permission, the text is red and in all caps:
  15. Now, getting back to the main objective here… to display a list of document libraries.
  16. Click inside your list, and click the little chevron at the top right of the list.  Click the word Filter:
  17. The filter needs to be BaseTemplate equals DocumentLibrary.  Click OK.
  18. Let’s change the way that this list is displayed.  On that same list fly-out menu (or whatever the official name is), click Data View Properties…, and go to the <Layout> tab.  Choose the bulleted list of titles, and click OK.
  19. Now, the title of the library needs to be a link to the library itself.  Click to select the title of the first document library.  Click the little chevron next to it.
  20. In the Format As field, select Hyperlink.  Click Yes at the prompt.
  21. Clear the Address field, and click the Function box next to it.  Chose the DefaultViewURL field.  Clear the Text To Display box, and choose the Title field for that one.   Click OK.

There’s your pretty little list of all of the document libraries in the site!  Save the web part page, and this is what it will look like in the browser.  Export the web part, save it, and then you can delete the web part page that you created it in.  Now, import this nugget into whatever page it needs to be displayed on.

As I showed him all of the coolness that I discovered in web services, my (developer) co-worker said “I hate to burst your bubble, but developers already know about what’s available in the API.  This is all pretty basic stuff”. 

I know, I know.  None of this is new to developers, but I’m not a developer, so I think it’s great.  It’s all new to me.  ;-)

Fun With Announcements - Part 2

Wednesday, March 4th, 2009

Today’s article that I wrote for the End User SharePoint site is called:

Create Alerts Based On Announcement Categories

Here is the link to it: http://www.endusersharepoint.com/?p=1402

Fix for the Custom Form Attachments Issue

Wednesday, February 18th, 2009

In my first blog post called Displaying SharePoint Fields by Permission level, I made a side note that said

Also, I’d like to note that when using custom forms like this, the Attachment button doesn’t work anymore.  I think there are blogs somewhere about this bug, but I’ve never tried fixing it.

Well, Microsoft finally has a fix for this.  So, aparently, as long as you do have the infrastructure update installed on your servers, and your SharePoint Designer is at SP1 level, you can install the following fix:

The following is the email directly from Microsoft about where to get the fix, and how to apply it:
__________________________________________

This is the client side fix:

http://support.microsoft.com/kb/960311

The server side fix you already have installed but that is the WSS 3.0 Infrastructure Update.

Download this and update your SPD. This will place the code needed to make attachment functionality work for new and edit forms.

For Display forms only, you need to add this:

  1. Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.
  2. Expand out Lists -> [List Name] -> open DispForm.aspx .
  3. Highlight normal list form by clicking on it. This will select the entire webpart.
  4. Right-click on selected web part, and choose Web Part Properties…
  5. Expand [+] Layout, check option for Hidden, click OK.
  6. With web part still highlighted, hit the right-arrow key once. Hit Enter. This creates some whitespace to insert.
  7. Go to File | Insert SharePoint Controls | Custom List Form…
  8. Select appropriate list or library, content type, and type of form to create. Click OK.
  9. Put cursor in the “Expires” table cell, right-click | Insert | Row below. There should now be a new table row with two column cells.
  10. Put cursor in the left table cell of the new row, type “Attachments”.
  11. Put cursor in the right table cell of the new row, go to Code view, and paste the following code:
    <SharePoint:AttachmentsField ControlMode=”Display” FieldName=”Attachments” runat=”server” Visible=”true”/>
  12. Save page.

In summary, in SharePoint Designer, when you insert a custom form (DVWP) to create your own custom EditForm.aspx, DispForm.aspx, and NewForm.aspx, the attachment functionality won’t break anymore.