Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Word document from request

SOLVED
Go to solution
Highlighted
Derek Giedd
Frequent Visitor

How to create Word document from request

When we reach a certain step in the workflow I have a requirement to create a word document that contains data from the request at appropriate points in the document. I would like to have this document created when the workflow step is completed. I would like the document automatically attached in the reference section. I need help with multiple parts of this.

1) How do you create a word document output from a PPM request?
2) How do you automatically create this - I am assuming with an execution step.
3) How can I automatically attach this document?
-- Remember to give Kudos to answers! (click the KUDOS star)
12 REPLIES
Sascha Mohr
Esteemed Contributor

Re: How to create Word document from request

Interesting requirement. First you need a tool or something that can create a word document on the server. PPM cannot do that ootb. Reporting tools usually can, so if you have integrated a reporting tool with PPM that would be a start.
The creation should be triggered by an execution step (you can start pretty much everything with ksc_local_exec).
Number three will be tricky. I don't know of a way to create an attachment in a request's reference section externally. The webservice interfaces do not support attachment afaik.
You could upload/save the file to a specific location and the have a link in a read-only field to that location though.
Kalin Petrov
Super Collector

Re: How to create Word document from request

Hi Derek,

You hadn't mentioned what mechanism you use to store the documents, but if it's Documentum you can't really automate the documents attachment process. If not then the solution offered by Sasha is the most relevant one - create/copy the file into the dedicated "attachments" directory and put the hyperlink pointing to it on the request form.

Regards,
Kalin
Derek Giedd
Frequent Visitor

Re: How to create Word document from request

Thanks for the input. #3 is not a hard requirement and after I have thought about it, not really necessary since the reason I need the document is so we have an approval document that the CIO and others (who don't use PPM) can sign. So, I don't need the signed document in PPM, but I need to scan it and then store the pdf file, which will be a manual process.

We do not use Documentum. All of our documents are stored in SharePoint.

I was thinking about this more last night and instead of creating a Word document, we could create a text file with just the data in it and use a mail merge in Word to create the document. So, I would just need a way to write out the data into a text file.
-- Remember to give Kudos to answers! (click the KUDOS star)
Sascha Mohr
Esteemed Contributor
Solution

Re: How to create Word document from request

OK,
this would write it to the report directory:
ksc_begin_script [AS.REPORT_DIR]my.txt
... the content ...
ksc_end_script
ksc_local_exec cat [AS.REPORT_DIR]my.txt
Derek Giedd
Frequent Visitor

Re: How to create Word document from request

Sascha,

Thank you. This works and I have been able to take this data and merge it with a word template. Is there a way to write this to a folder on the local drive instead of the report folder, which is on the server? My users do not have access to the server to use the file that is created.
-- Remember to give Kudos to answers! (click the KUDOS star)
Sascha Mohr
Esteemed Contributor

Re: How to create Word document from request

No, unfortunately not, because the step is executed on the server. Usually the servers are not allowed to connect to the client's local drives. In theory you could have PPM's user to be network-wide superuser that has read/write access also on all client machines, but I don't think it is a practicable idea for a production environment.
If you were using a report here instead of an execution step in a workflow you could just open the file in a browser window. In a workflow you can put a link to the generated file into a read-only field in the request though.
I used the report directory in the example to keep things easy, you can use others too. But if you are planning to do the link-think make sure web-users have read-access to that folder.
MaxH
Member

Re: How to create Word document from request

Derek,

Can you please tell me yor steps for doing this?  We have a task to create a Word document from data that will be stored in PPM.  similar to creating an Excel Report from PPM.  We'd like to do this with Word.  Any thoughts?  Thanks.

 

Max

Derek Giedd
Frequent Visitor

Re: How to create Word document from request

It has been a while since I looked at this.  There is no elegant solution.  If you just need to fill in some fields on the Word document, you could use Mail Merge in the Word document.  This is not the easiest solution to create or use, but it works.  

 

1) Create a view in the database containing the info you want to include.
2) Create a Word Template with the text you want to include.
3) Use Mail Merge, pointing to the PPM database view you created.
4) Insert fields in the Word document that refer to columns in the view.
5) Perform the Mail Merge.

If you need more than this, you can create a text file, but not a Word file.  This file will be saved on the app server.  Then you can have a backend procedure that updates a request field with a pointer to this file.  I have had mixed success with this approach due to timing issues copying a file to the attachment directories.

Another approach I have seen used was to create a Java report.  

-- Remember to give Kudos to answers! (click the KUDOS star)

Re: How to create Word document from request

I created an app a long time ago, using c# and dinamic querys, you could built any documents, simpke fields, tables, images, even Gantts! and updated the document to an attach field inside PPM or send it as an attachment but that took me almost 3 weeks to achieve it. The execution was made but a execution step inside PPM using ksc_local_exec.

Derek Giedd
Frequent Visitor

Re: How to create Word document from request

Wow! That sounds awesome.  Do you still have the code and if so would you mind sharing?

-- Remember to give Kudos to answers! (click the KUDOS star)

Re: How to create Word document from request

Sorry, I can give you the hints but not the code :(

Derek Giedd
Frequent Visitor

Re: How to create Word document from request

No problem. I understand. If you would prefer, you can send me a message with any hints.

Thanks,

Derek

-- Remember to give Kudos to answers! (click the KUDOS star)
//Add this to "OnDomLoad" event