MS Word document checkbox issue

Pavan Dev
Tera Contributor

Hi All,

 

We are generating a Word document with the data from the form in one of our custom applications. The checkboxes in some MS Word versions are not displayed in the generated document. I'm using the simple HTML checkbox code to populate the checkbox in the document.

 

<p style="vertical-align: middle; text-indent: 21.1pt; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: \'Times New Roman\', serif;"><input type="checkbox" id="test">Test Checkbox</input></p>

 

Any help is appreciated!

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Pavan Dev 

unless you share some more details on what script it is and how it's done we won't be able to help.

Please share the complete script etc

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Below is the script:

 UI Action (Word document script)

new GlideSysAttachment().write(current, current.parent.type.getDisplayValue() + ' ' + current.parent.parent.getDisplayValue() + ' ' + component + '.doc', 'application/msword', current.document.replace(/\s/g, ' '));

 

Display Business Rule script:

var document = '<p style="text-align: center; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: \'Times New Roman\', serif;" align="center"><strong>&nbsp;</strong></p><p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: \'Times New Roman\', serif;" align="center"><strong>Document Template</strong></p> <p ><input type="checkbox" id="test">Test Checkbox</input></p>';

 

I'm previewing the template we generate in ServiceNow's HTML field. The only issue is that the checkbox does not appear in the document after generating the word.