- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2016 06:18 AM
Hi all,
I have a UI page that uses the HR_PDF_template to generate a pdf document from record producer form.
the pdf is generated with values and fields I want but it is not attached to the record producer form.
Can you Help on that, please?
UI Page Jelly/html part
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:requires name="html2pdf.jsdbx" />
<div id='printable'>
</div>
<button type="button" onClick='downloadPDF()'>
${gs.getMessage('Generate PDF')}
</button>
</j:jelly>
On the cleint script part I managed fields that needs to be part of the pdf and have following fucntion and they work fine
//Printing on the Screen |
document.getElementById("printable").innerHTML = this.body;
//Downloading the file
html2pdf(jQuery('#printable'),'letter','Sample.pdf',['a','button']);
}
function setParamenter(parameter,value){
this.body = body.replace('{'+parameter+'}', value);
}
Now, What should I do to get the generated document attached to the record producer?
Add something in the jelly part or a function to the client script part.
Thanks in advance for your answer,
Regs,
Lô Mouhamadou
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 07:03 AM
Finally, I made the variables visible on the hr_case form and make them read-only.
This way, pressing the button generate the pdf and it is not stored what mean no waste of story usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2020 12:01 AM
Hi Lomouhamadou,
I have similar requirement.
I have to create a button on record producer and when click on that button a pdf file to be generated. Please help me on this as you have already achieved this.