我们继续前面的介绍,前面提到可以很容易的读取到任务审批历史纪录,那么任务提交注释同样可以很方便的拿到,并且下载下来:

Project Server PSI的简单调用方式:读取和下载工作分配备注

前提是选择了"发送注释"框,默认都是选中的,赶紧看看代码实现吧:

if (Request["taskid"].Length > 0)

{

Guid taskid = new Guid(Request["taskid"]);

 

byte[] rtfbytes = PJContext.Current.PSI.StatusingWebService.ReadPublishedNoteForTask(taskid);

if (rtfbytes != null)

{

string rtftext = new String(new ASCIIEncoding().GetChars(rtfbytes));

Response.Write(rtftext);

}

}

如上,代码段需要任务ID号,直接拿到了byte[]数组,我们提前在页面上加入:

<%@ Page Language="C#" Inherits="###你的项目Namespace" Debug="true" ContentType="application/msword" %>

即可实现Word下载!

相关文章:

  • 2021-12-04
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-02-27
  • 2021-11-20
猜你喜欢
  • 2021-06-23
  • 2021-09-15
  • 2021-11-26
  • 2021-10-05
  • 2022-02-09
  • 2022-12-23
相关资源
相似解决方案