A Better Sharepoint Web Part for showing Workflow Tasks

ScreenShot114In my most recent Captaris Workflow class in Bendigo one of the students asked about solving a problem with our implementation of our Sharepoint Web Part. The issue was that we have one web part that does everything. This is great if you want it to do everything, but sometimes you just want a task list like the one that shows up in our web access product. Well, its actually really easy to create one in less than 10 minutes. The one shown in the picture shows my task list, the processes they come from, and the due date. Since my locale is US, I have US dates. If I had a different locale, they would be shown correctly for the locale.

ScreenShot115To get this web part, first take a look at the full WebAccess client. The web part is just the task list portion of the WebAccess client, with a few columns removed. If you look in the web\TeamplateWebServer \TeamplateWebAccess under the Teamplate program directory (it becomes the workflow directory in 6.0), there is a file called tasklist.aspx. Make a copy of it and edit to look something like this:

 

<%@ Register TagPrefix="teamplatewebcontrols" Namespace="Teamplate.Web.UI.WebControls" Assembly="Teamplate.Web.UI.WebControls" %>
<%@ Page language="c#" AutoEventWireup="false" Inherits="Teamplate.Web.WebAccess.TaskList" %>
<%@ Register TagPrefix="cc1" Namespace="Teamplate.Web.Controls" Assembly="TeamplateWebAccess" %>
<HTML>
 <body>
  <form id="TaskList" method="post" runat="server">
   <TeamplateWebControls:TaskList id="TaskListCtrl" style="Z-INDEX: 102; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server" ShowTaskProperties="False" ShowViewProperties="False" ShowStartDateColumn="False" TaskListWidth="550" ShowMarkAsViewed="False" ShowPriorityColumn="False" ShowResponsibleColumn="False" ShowCompletionDateColumn="False" ShowStatusColumn="False" ShowStatusColor="True" Pagesize="4" HeaderBackColor="124, 163, 208" HeaderForeColor="White"></TeamplateWebControls:TaskList>
  </form>
 </body>
</HTML>

This will get you a page that has the contents of the webpart. To find what the properties mean, look to the help files and search for showtaskcolumn. Now click the link on the page that comes up and you will see all the properties for that control. To turn it into a webpart, go to you Sharepoint site and add a Page Viewer Web Part. Since I set the control to 550 pixels wide, I set the web part to 570 pixels wide. Then I turned off the border to make it look a bit better.

I think the results are pretty good. You could customize this even more by making your own tasklist programmatically and building a real web part, but this may be good enough for most of your needs.

Sorry, comments are closed.