on 2016 Jan 08 3:01 PM
Hello All,
I have a requirement which is as below.
1. Create a toolbar Script (Was able to create this by creating a script definition with 'toolbar' context)
2. When we click oh this Toolbar, it should generate a Word document with few fields (any) from Project and save it in a path.
3. At the same time the word document should be saved in the Project's attachments.
Please help me with this scenario.
Thanks in advance,
Raghav
Request clarification before answering.
Hi Raghav,
Your requirement is possible, but it does need a lot of work (about a month's worth).
I can only point you into the right direction; you will need to make use of a contract doc template and Apache POI library.
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bogdan...Thanks a lot for the answer.
Till now we were able to generate a Word document(With a hard coded String) and attach it in the project attachments.
The one main thing remaining is to generate the word document with a layout so that the field values from the project document can be auto populated as such.
Are you sure this needs Apache POI ? That is what I also could find when searching.
Will CLM support Apache POI libraries ?
Do we need to upload any jar files for the same ?
Thanks in advance,
Raghav
Hi Raghav,
The problem is that the system doesn't provide the tools to generate the Word document straight from the Project BO.
So, the solution is to get as much as the system can offer, and do 'manual' work on the rest. My proposed approach is to:
1. Create a Contract Document Template with your required word template for project (you could make it hidden or inactive, not to impact the standard CD process)
2. Fetch this CDT into your toolbar script.
3. Replace all the tokens in your template with current Project values. (Apache POI comes in handy here)
PS: POI is already included in the Sourcing classpath so you don't need to do anything much (just check which version is shipped with your installation)
Bogdan
Hi Bogdan,
Sorry to bother you again and again
We are going by your suggestion.
We have created a CDT and attached the Word template in its clauses attachments.
Now we are trying to fetch this attachment from the clause.
When we are trying so (by getting the data from collection named 'CONTENTS'), we are getting only Null value although it has a real doc file attached.
Are we really doing what you meant in your suggestion ?
Kindly suggest,
Thanks a lot,
Raghav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.