1,804 articles and 14,821 comments as of Friday, May 6th, 2011

EndUserSharePoint has combined resources with NothingButSharePoint.com. You can now find End User (Mark Miller), Developer (Jeremy Thake) and IT Pro SharePoint 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
Tuesday, August 24, 2010

SharePoint: Extending the DVWP – Part 30: Using EasyTabs with Filtered DVWPs to Make Data Manageable

Author: Jim Bob Howard

If you’ve been following along with the Extending the DVWP series, you might be wondering, "Why is he doing all of this?" The whole point of this project was to make things easier for managers to update the number of full-time employees in their department. The administrative assistant who is collecting that data for reporting needs it all in one Excel spreadsheet to run some percentages, etc.

But the managers themselves only need to update their own site, so they don’t need the Excel spreadsheet with access to the other 14 locations just to be able to update their own.

Making it Easy with EasyTabs

Now that we have this robust DVWP, wouldn’t be great to break each location out into its own tab so the managers can just edit their own?

Well, no it’s actually not that great. There’s so much data that the overhead involved to load it all in multiple tabs, so that a manager can just pick their own tab, is completely overwhelming. Plus, in my requirements, several of the managers are responsible for staffing at multiple locations. Additionally, there are categories of employees that are not "really" full-time employees, but count as a fraction of a person, or not at all but still need to be maintained in the same list.

All that to say, that the better implementation for our purposes is to create multiple pages with multiple (though a subset of the whole) tabs.

Like this:


A page with one tab


A page with a few tabs


A page with several tabs

… etc.

So, what I’m going to do is use Christophe Humbert’s EasyTabs to stack multiple DVWPs on a page, each filtered on a subset of the FTE data.

Easy Part – Filtering

To filter a DVWP:

  1. In SharePoint Designer (SPD), hover over the DVWP in the Design pane and click the chevron (right arrow), and click on the Filter: link.

  2. This will bring up the Filter Criteria dialog box:

  3. To add a new filter clause, simply do as it says and "Click here…"

  4. Select the Field Name you want to filter, the comparison you want to make, and the value

  5. Click OK and your DVWP will be filtered.

Let’s do one more filter and then we’ll stack them with Easy Tabs.

More Complicated Filters

In my implementation, I have several categories of employees that count as a portion of an FTE, but aren’t supposed to be included with the rest; they’re all supposed to be grouped together. Here’s how I filter them:


Location columns are grouped

Notice that all of the Location filters are OR’ed together and grouped. The result of that is AND’ed with Group = ‘ACB’.

To group them:

  1. Click the arrow next to the top clause
  2. Holding down the Shift key, click the arrow next to the bottom one
  3. The Group button will now be clickable

  4. Notice that the Filter setting now begins with ( Location Equals ‘Float’ Or …)

  5. Filter: ( Location Equals ‘Float’ Or Location Equals ‘Trainee’ Or Location Equals ‘Temp’ Or Location Equals ‘PT’ ) And Group Equals ‘ACB’

Your filter on this DVWP now will show all list items with Group=’ACB’ and Location one of: ‘Float,’ ’Trainee,’ ’Temp,’ or ’PT.’

The Need for Tabs

Without Easy Tabs, my DVWPs just stretch down the page:


With Easy Tabs, they’re stacked for easy readability and accessibility:




Implementing Easy Tabs is extremely easy:

  1. Download the javascript from Christophe Humbert’s Path To SharePoint site (at this writing, 5.0 beta is the current version)
    1. At the link above, choose your options:

    2. As soon as you check the License box, your version of the code will appear in the box at the bottom of the page
  2. Copy it and paste it into the Source Editor of a CEWP on your page
  3. Click OK and Exit Edit Mode

All of a sudden, all of the webparts in the same zone as the Easy Tabs webpart will be stacked with tabs.

Next time: A little more clean-up of our DVWPs are necessary; we need to fill in default data for the page/tab, activate the cascading dropdowns with default data, modify the Total and Subtotal rows… we’ll cover those over the final few articles of Extending the DVWP.

Author: Jim Bob Howard

Jim Bob Howard is a web designer / webmaster in the healthcare industry. He has been working with SharePoint since March 2009 and enjoys sharing what he has learned. He is a moderator and frequent contributor to Stump the Panel, and answers SharePoint questions on Twitter (@jbhoward) and via email ([email protected]).

View all entries in this series: Extending the DVWP»
Entries in this series:
  1. SharePoint: Extending the DVWP - Part 1: Layout Enhancement - Rearranging Columns - Default and Edit Templates
  2. SharePoint: Extending the DVWP - Part 2: Layout Enhancement - Rearranging Columns - Insert Template
  3. SharePoint: Extending the DVWP – Part 3: Getting it All on One Line - DVWP Function Action Links
  4. SharePoint: Extending the DVWP – Part 4: Turning DVWP Action Links into Buttons
  5. SharePoint: Extending the DVWP – Part 5: Doing Stuff Before Save on Submit - PreSaveAction()
  6. SharePoint: Extending the DVWP – Part 6: Examining the Form Action Links
  7. SharePoint: Extending the DVWP – Part 7: Creating a Form Action Workflow
  8. SharePoint: Extending the DVWP – Part 8: Creating a Form Action Workflow - The After Math
  9. SharePoint: Extending the DVWP – Part 9: Oops! Failed Setting Processor Stylesheet
  10. SharePoint: Extending the DVWP – Part 10: Passing Workflow Variables to a Form Action Workflow
  11. SharePoint: Extending the DVWP – Part 11: Getting More Form Fields to the Workflow
  12. SharePoint: Extending the DVWP – Part 12: Adding More Form Fields from the Data
  13. SharePoint: Extending the DVWP – Part 13: Putting PreSaveAction() to Work – Creating Variables
  14. SharePoint: Extending the DVWP – Part 14: Putting PreSaveAction() to Work with jQuery
  15. SharePoint: Extending the DVWP – Part 15: User-Managed Dropdowns with Site Columns
  16. SharePoint: Extending the DVWP – Part 16: User-Managed Dropdowns - Loading Data
  17. SharePoint: Extending the DVWP – Part 17: User-Managed Dropdowns – Creating a Relationship list
  18. SharePoint: Extending the DVWP – Part 18: User-Managed Dropdowns – Loading the Relationship list – Part 1
  19. SharePoint: Extending the DVWP – Part 19: User-Managed Dropdowns – Loading the Relationship list – Part 2
  20. SharePoint: Extending the DVWP – Part 20: Cascading Dropdowns - Applying the jQuery
  21. SharePoint: Extending the DVWP – Part 21: Cascading Dropdowns - Three-tier Cascade
  22. SharePoint: Extending the DVWP – Part 22: Creating Title Based on Other Fields with jQuery
  23. SharePoint: Extending the DVWP – Part 23: Creating Title Based on Other Fields with a Workflow
  24. SharePoint: Extending the DVWP – Part 24: A Note to Readers
  25. SharePoint: Extending the DVWP – Part 25: Using an Audit Trail by Creating List Items with SPServices
  26. SharePoint: Extending the DVWP – Part 26: Modifying the Edit Template
  27. SharePoint: Extending the DVWP – Part 27: Adding an Alternate Edit Template to a DVWP
  28. ExSharePoint: Extending the DVWP – Part 28: Massage the Remove Template
  29. SharePoint: Extending the DVWP – Part 29: Modifying Form Action Workflows on the remove Template
  30. SharePoint: Extending the DVWP – Part 30: Using EasyTabs with Filtered DVWPs to Make Data Manageable
  31. SharePoint: Extending the DVWP – Part 31: Filling in Default Data on the insert Template with jQuery
  32. SharePoint: Extending the DVWP – Part 32: Filling in Default Data on the insert Template with Multiple DVWPs
  33. SharePoint: Extending the DVWP – Part 33: Modifying Total and Subtotal Row Layouts in DVWP
  34. SharePoint: Extending the DVWP – Part 34: Using Icons for Form Action Links
  35. SharePoint: Extending the DVWP – Part 35: Putting it All Together
  36. SharePoint: Extending the DVWP – Bonus: Fixing the Insert Form Action When "No Matching Items"
  37. SharePoint: Extending the DVWP – Bonus: Creating a Title Based on Dropdowns with jQuery
 

Please Join the Discussion

5 Responses to “SharePoint: Extending the DVWP – Part 30: Using EasyTabs with Filtered DVWPs to Make Data Manageable”
  1. Richard says:

    Hi Jim,

    The link that you posted for easy tabs no longer works. This one looks current: http://sp2010.pathtosharepoint.com/SharePoint-User-Toolkit/

    Thanks.

    • Thanks Richard. Christophe has been VERY busy, starting to rework his solutions for 2010. I really like the way he’s setup his tool-kit. I wish more people would do it that way. Really makes it easy when he upgrades his code base. — Mark

  2. Latte says:

    Hi,
    Thanks for posting this. I’ve tried but doesn’t seem to work, the issue I think is that EasyTabs works when the DVWPs are on the same Web Part Zone and I can’t figure out how to get all of them on the same zone.

    What am I doing wrong?

    Thanks.

    • That’s right; they do have to be on the same Web Part Zone. And that can be a bit tricky when adding them in SharePoint Designer.

      Here’s a trick that works for me:
      1. In the Design pane, click the existing web part in the zone
      2. In the Code pane, click once just before (or just after) the existing web part code
      3. Now, when you add your DVWP, it will be inserted within that zone.

      Hope that helps.

      Blessings,
      Jim Bob

Trackbacks

Check out what others are saying about this post...
  1. [...] displaying to disparate users, we’ll want to reuse the web part we’ve created using Christophe Humbert’s Easy Tabs code for the Content Editor Web Part (CEWP). For each page we create following the steps above, [...]




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!