Do More Than Manage
Gord Schmidt's Ideas for Doing More with Microsoft Project Server
Summary Task

A Handful of Issues When Working with the MSPJGrid

Many of my customers have existing project management reporting systems that contain "essential" reports they wish to replicate in Project Server. I do my best to steer them away from long, printed reports. (Shouldn't one of the points of an on-line EPM system be the delivery of on-line reports?)

I have found that providing reports in the MSPJGrid is a great away to return on-line reports via a recordset to the user and gain a whole lot of extra features with only a little coding effort.

That said, I have run across several small but finicky issues when working with the control:

  1. The columns used in the Filter property should not have spaces. As a general rule now, I avoid spaces in the column names. (Note: the customer facing column headings can definitely have spaces.)
  2. When setting the AutoFilterList property or Filter property, there needs to be spaces around the comparison operator. The first example will work but the second will not.
       // This will not work
       MSPJGrid.Filter = "Name='Gord'";
    
       // This will work
       MSPJGrid.Filter = "Name = 'Gord'";
    
  3. Several of the properties of the MSPJGrid are finicky about whether they are set before or after the Refresh method. Specifically I have had problems with the Filter and AutoFilterList properties.
    CodeResult
    MSPJGrid.AutoFilter = 1;
    // MSPJGrid.Refresh();
    MSPJGrid.AutoFilterList="WORK > 1";
    // MSPJGrid.Refresh();
    You have to issue at least one Refresh or your grid is displayed as an empty rectangle.
    MSPJGrid.AutoFilter = 1;
    // MSPJGrid.Refresh();
    MSPJGrid.AutoFilterList="WORK > 1";
    MSPJGrid.Refresh();
    The result of only using the Refresh after setting the AuotFilterList property might make you think your filter value is wrong. Essentially the grid displays with all of the values. No values are filtered out.
    MSPJGrid.AutoFilter = 1;
    MSPJGrid.Refresh();
    MSPJGrid.AutoFilterList="WORK > 1";
    //MSPJGrid.Refresh();
    The grid displays data and the data is even filtered, but the number of rows displayed is wrong. It is like the data is displayed for the appropriate records, but the grid lines render for all of the records.
    MSPJGrid.AutoFilter = 1;
    MSPJGrid.Refresh();
    MSPJGrid.AutoFilterList="WORK > 1";
    MSPJGrid.Refresh();
    This is how it has to be. This works just as expected.
What tidbits and nuggets have you discovered working with the MSPJGrid?
Posted by Gord Schmidt on Tuesday, January 18, 2005 | Permalink | Extend | Resolve

Milestone