- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2016 01:09 PM
Hey,
I used this approach and able to generate PDFs. Thanks for all the help.
But, I have few issues in setting Header and Footers.
Header:
Need to add dynamic text in Header on Left side, apart from the company logo on Right Side.
Footer:
Text on Left Side and Page Numbers on Right Side.
Has anyone able to get these working?? I tried a lot, but cannot achieve text on Header and Page Numbers on Footers.
Any help is appreciated.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2016 03:24 PM
Hi Sriddhar
I added dynamically generated Letter ID to the letter by adding following code to _getDocTempleInfo function in script include. Just added these lines.
| this.footnote= gr.template.footnote + ''; // existing line | |||
| // add document number | |||
| var gdt = new GlideDateTime(); | |||
| this.letterid=gdt.getNumericValue(); | |||
| this.fileName = current.number+'-'+gdt.getNumericValue(); | |||
| this.footnoteleft = this.letterid + ' '+gdt.getDisplayValue() ; | |||
| var n=100-(this.footnoteleft.length+this.footnote.length); | |||
| this.footnote=this.footnoteleft + repeat(' ',n)+ this.footnote; | |||
| this.headerPosition = gr.template.header_position + ''; // existing line |
Cheers
Syed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 08:02 AM
Hi Syed,
I tried your solution, but I am getting the following error. Apparently, it doesn't know what the "repeat" is.
org.mozilla.javascript.EcmaError: "repeat" is not defined.
Caused by error in Script Include: 'QA_WO_PDF_Form' at line 136
==> 136: this.footnote=this.footnoteleft + repeat(' ',n)+ this.footnote;
Also, I noticed that "footnoteleft" and "letterid" variables are not present in GeneralForm, So I presume there is some supporting code to handle this in GeneralPDF or GeneralForm script includes ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 02:52 PM
Hi Sridhar
You will need to add below function to define repeat.
function repeat(str, num) {
var holder = [];
for(var i=0; i<num; i++) {
holder.push(str);
}
return holder.join('');
}
Cheers
Syed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2016 06:24 AM
syed.faheem Do you have any plans to release an update set for document template table and script include ? If you already have can you share with us?
also, I assume your solution will work without HR plugin right as long as we have both table and script and PDF generator plugin activated ?