I am writing a component for getting the pdf form from a task id, I know how to get the form data(xml) from the task but how can I know which form template to use to render the it as pdf form?
Views
Replies
Total Likes
Anyone know how to get the form template from a task, so I can render it as a PDF form?
Views
Replies
Total Likes
I still can't find an answer yet, please advise if it's possible to get the form template from a task?
Views
Replies
Total Likes
You can do that!
Use the following method to get the XML data along with the Form Template:
TaskManager.getFormInstanceForTask(long taskId, long formInstanceId, boolean retrieveData)
The above method returns a Form Instance which consists of both Form Template and XML data (only if your thrid parameter is true)
If you would like to find the template path, you can use:
FormInstanceVariable.getTemplatePath();
which returns a template path string.
Nith
Views
Replies
Total Likes
Thanks Nith.
so if I use
TaskManager.getFormInstanceForTask(long taskId, long formInstanceId, boolean retrieveData)
and set the retrieveData to true, it will return a PDF?
Views
Replies
Total Likes
TaskManager.getFormInstanceForTask(long taskId, long formInstanceId, boolean retrieveData).getDocument();
The above code will return the PDF document.
Or if you want the XML data & template path separatelly, use the following expressions:
TaskManager.getFormInstanceForTask(long taskId, long formInstanceId, boolean retrieveData).getXFAData();
TaskManager.getFormInstanceForTask(long taskId, long formInstanceId, boolean retrieveData).getTemplatePath();
Nith
Views
Replies
Total Likes
Thanks Nith
Views
Replies
Total Likes
Sorry, a small mistake on my previous response..
The following code will return XML data and not the actual PDF! You will have to import it to the template to get the PDF result.
TaskManager.getFormInstanceForTask(long taskId, long formInstanceId, boolean retrieveData).getDocument();
Nith
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies