This content has been marked as final. Show 14 replies
You get your information from where ever it's located. Then add it to the XML that gets merged with the form template on the RenderPDFForm and let Forms merge the data with the template before it's being served up.
Yes. It's the part "add it to the XML" I need help with.
the XML, is it the "inDocData" variable in the RenderPDFForm?
how do I add my data to it?
Use a setValue to put the document variable into a XML variable, then use xPath to manipulate the XML and put it back into the document variable.
Works! Thanks Jasmin!
i was trying to do something similar but found out something weird.
Objective too is to prepopulate the PDF form with information at the Initiator stage.
However I found out that under the workspace tracking section, the submitted data wasn't displayed/loaded inside the loaded initiator stage PDF form. Only the prepopulated data is displayed.
Does this happen on your side?
Any idea why?
Actually how does the tracking section's loading of PDF work?
Leia, we also encountered the same issue with Workspace Tracking section when we use our custom PDF render service (customised from Default Render service) to prepopulate PDF form. The prepopulated data is displayed instead of the submitted data
We realized a few things which cause this issue:
1. Our custom PDF render service will be invoked when we view the submitted PDF form in Workspace Tracking section.
2. In our custom PDF render service, we use a SetValue component which always replace the 'dataDoc' input variable with a new constructed xml document which contains prepopulated data.
Anyone can advice on how to solve this issue?
may be you can put a flag in the render service to indicate if the form is being opened from the tracking section of the workspace or not. I think when a form is opened from the tracking section, the taskID is null. you can then check for this taskID in render operation and render accordingly. I have not tried doing this,but well worth a try
Instead of using the TaskID as the 'flag', I'd like to use the data in a field on the form as the flag...
the form data is in the "inDoc..." input variable of the Render Service, is it not?
I tried to check the inDoc, but can't get it to work. Could you shed some lights on this?
When you configure the variable to use a render service you can pass it the Task->Form Data, which would contains the data from the sumitted form.
You could use xPath within the render service to check for your flag.
What variable type should I use for that input parameter? "Document" or "xml" or? I am not able to use XPath to drill down to my field in a Document...
I must be doing something wrong, can I send you my LCA to check?
It gives you a document. In your render service you can put the document content into an xml variable with a SetValue (process_data\myXML = process_data\myDoc) and then use xPath.
it's still not working (using the above SetValue operation)...
do you or anyone has a Render Service that does similar type of things? if you do, could you please send your LCA file to email@example.com ? maybe by looking at your LCA I could figure out what have I done wrong... TIA.
on a related subject:
I don't quite understand how the "SetValue" in the previous post works? I mean myDoc and myXML are of different variable types, how does SetValue handle the assignment of two different types of things? Is it documented somewhere?
I have tried the SetValue in the reverse direction, i.e. myDoc = myXML and that seemed to put the data in the xml into myDoc alright, although I don't understand how does it do that and why it works either.
WorkflowUser found the solution for fadly's question, and I have verified it:
use "Task Status ID" as the Flag,
when it's not 1, don't do that setValue/PrePopulation; and it will be fine in the Tracking.
Answering James's question about converting types...
So, for example, if you assign an int to a long, it will just work. And if you assign an int to a string, you'll get a string containing a representation of the int.
If you assign a Document to an XML variable, if the document actually contained valid XML, then you'll end up with an XML document. If it doesn't contain valid XML, then I think you'll get an exception.
Some coercions just don't work - for example, a list to a doc just doesn't make sense.
Hope this helps...