Partager via


Modifying the ProjectStatus Call

I got an interensting question that I thought would be a good entry:

I want to change the ProjectStatus method to display the name of the Project from the MSP_WEB_Projects table rather than the MS_Projects table because I want to get rid of the version.

There is no way to modify the ProjectStatus call... what you see is what you get. Depending on the final goal there are a few ways to accomplish getting just the project name. The first key is that the period is an invalid character in a project name... it ONLY delimits between project name and version. Therefore the returned string for project name can be easily truncated by looking for the period. If you want a call that returns the project name sans version, you could create a PDS extension. Create an extension called ProjectStatusEx. The big thing to remember is you can call the PDS from PDS extensions. The order would be something like this:

- Receive the call to the extension

- Connect to the PDS

- Call ProjectStatus on the PDS with the XML you received

- Parse the returned XML to remove the version from the ProjectName parameter

- Return the modified XML as part of your ProjectStatusEx extension.

Comments

  • Anonymous
    May 18, 2006

    Of course, it depends on where this will be used, but for reports (SRS) I've handled this at the presentation layer:
    For example, a cell expression could be:
    =IIF(Right$(Fields!PROJ_NAME.Value,10)=".Published",LEFT$(Fields!PROJ_NAME.Value,LEN(Fields!PROJ_NAME.Value)-10),Fields!PROJ_NAME.Value)

    This should handle periods and template names without problems. For reports, where this function is not being called too many times, I like the general purpose nature of this function for the trade-off of performance.

    -j