Tuesday, January 10, 2006

 

A web part for rendering Gantt charts

I promised a month ago that I would post a web part for charting WSS data into a Gantt chart. Well, here it is. It looks somewhat like this:

The part allows you to specify a list and view to render. You select the fields from the view that will indicate the start and end date of an item. The third required field is the title field. Because the part works with view fields, you can also use calculated fields to specify the start date, end date or title of the item.

Because I was too lazy to create a custom designer, you have to enter the names of the list, view and fields in a textbox. When you specify incorrect values, the part will show you the available options in it's error message.


So you want to use it? I put up a zip file containing both the sources and binaries. I haven't made an installer, but I suppose that most of you know what to do with a dll and dwp file (otherwise, check here). In your web.config you'll have to add a line for trusting the part like this:

The web part is actually more of a sample of using the underlying GanttCharting library. This will render VML that can be directly included into the HTML (IE only!). The charting library has some features that are not used by the web part, but that you may want to build on:

Download installer here

Labels:


Comments:
This post has been removed by a blog administrator.
 
I can't get the Gantt Chart to work. It won't take my custom list details. You said in your post, "the part will show you the available options in it's error emssage." I am trying to add the StartDate field and get this as the error: "Start field StartDate is not known. Try one of these: Attachments, LinkTitle, AssignedTo, Status, Priority, DueDate, PercentComplete" How can I confirm I have the correct field names?
 
As you can see, the field StartDate does not appear in the field list in the eror message. This indicates that the view (!) you are trying to report does not include this field. When you leave the view blank, the default view of the list will be used.

So add the StartDate field to your view.
 
The view I was using did have StartDate in it, but I just tried using a different view to see if it made any difference. Now it goes to an error screen and displays, "The "GanttPart" Web Part appears to be causing a problem." Any idea where to begin troubleshooting this?
 
I have the same problem with my Start Date, the column is included in the view andI get the same error message.

The only time it worked was when I used the default "Event" webpart included in WSS. But since that webpart is not very flexible I would like to create my own task-list.

Each time there is a trouble with by start and due date.
 
I have also experienced the problem with the Start Date field not being "recognised" even when it was in the view.

It seems to only happen when you have a ListView of the list open on the page itself. As a workaround, I totally removed any reference to the lists. (In SPPS 2003, add the parameter "?contents=1" to the URL to see a list of all the webparts on the page.)

Once the references were totally removed and not just hidden, the gantt chart worked as expected.
 
I had this working pretty good and am fooling/tweaking to understand how it will work when my list has MANY fields.

One question. After I set up the fields as you show, I would get an error like:

Start field StartDate is not known. Try one of these: Attachments, LinkTitle, Start_x005f_x0020_Date, DueDate

Changing my 'StartDate' field to match what is in the error resulted in it working. But why the funny field name requirement?

I tried it using a different list and received an error where more fields had the _xxxx_xxxx_ inserted in the error.

What's up with that?
 
@Ray: Please check out the latest version of the part, which includes an installer and a UI for selecting views and fields:
http://www.teuntostring.net/blog/2006/07/at-last-ganttchart-web-part-with.html
 
I worked out the issue I had earlier, but am still confused by the naming of fields. It seems _x0020_ replaces spaces; other values replace periods (.).

I'll pull down the new file and see if that resolves anything.

Curious, any intent to incorporate color?
 
These strange names are the names the Sharepoint uses internally. They escape the non alphanumeric characters.

Color is an interesting thought. Would you want to specify the color globally or per bar?
 
Excellent web part, does what it says on the tin!
Some basic colour to blend with the site theme would be neat.
Thanks
 
Will you be upgrading the webpart to work with MOSS 2007 or do you know of another way to get Gantt charts in MOSS?
 
Have you released a version of this that will work with WSS 3.0?

My administrator says it cannot be installed because it's designed for 2.0.

Thanks,
Jim
 
I have created a version for WSS 3. You can read about it here:
http://www.teuntostring.net/blog/2007/03/gantt-chart-for-wss-3.html
However, read the comments, as it does not seem to work for everyone.
 
If one item has two date-ranges, is it possible to display both ranges next to each other (in stead of below)?
 
This post has been removed by a blog administrator.
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?