Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Does JavaScript works in HTML Nprinting

Hi,

am trying to embed a straight table in email body by using Nprinting,

for merging rows am using JavaScript.its working fine in preview but when i trigger the mail its not working.

Need Help Regarding this.

1 Solution

Accepted Solutions
Highlighted
Employee
Employee

Hi,

I think you are creating an HTML template with Javascript in the header section. When you embbed it into the email body Qlik NPrinting will send only the <body></body> part and delete the <head></head>. This is for security reasons and to be sure that the email client will be able to render the report in the message body.

If you move the code into the body part of the HTML report Qlik NPrinting will send it but it could be removed by the SMTP server or by the email client.

I suggest to avoid to use Javascript in email bodies.

Best Regards,

Ruggero

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

2 Replies
Highlighted
Employee
Employee

Hi,

I think you are creating an HTML template with Javascript in the header section. When you embbed it into the email body Qlik NPrinting will send only the <body></body> part and delete the <head></head>. This is for security reasons and to be sure that the email client will be able to render the report in the message body.

If you move the code into the body part of the HTML report Qlik NPrinting will send it but it could be removed by the SMTP server or by the email client.

I suggest to avoid to use Javascript in email bodies.

Best Regards,

Ruggero

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

Highlighted

Java script will not work on HTML report embedded in email body as all mail clients are switching it off so it does not carry any harmful scripts. Therefore even if you have correct html code with JS it will still not work in mail client, but you might be able to use:"open mail in browser" function to preview it.

On the code side - Ruggero is right, you need to have your script in BODY section for it to be moved to email content

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.