Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I have a text file, I put it's content into a variable in QV (using Include Statement), and I want to display this variable in the body of an email in a task.
The problem is that the NP ignores new lines in a text file, all the text is displayed on the same line.
This is how it looks in the file, in QV and in the email.
Is there a way to solve this problem?
Maybe loading the file content differently to QV (I tried to use PEEK and it didn't work) or split each line in a variable into a new variable?
It is important to say that the content of the file may change in terms of the number of lines.
Many thanks!
Hi,
Instead of placing the variable directly you could try to develop an HTML template with the variable (and other fixed text of content from Qlik Sense app or QlikView document). Then embed the HTML template in the email body and remove it from the attached files. In this case you can use all HTML feature to format the content and you can test the results with a third party tool that renders the email as different clients.
Best Regards,
Ruggero
Hi,
Instead of placing the variable directly you could try to develop an HTML template with the variable (and other fixed text of content from Qlik Sense app or QlikView document). Then embed the HTML template in the email body and remove it from the attached files. In this case you can use all HTML feature to format the content and you can test the results with a third party tool that renders the email as different clients.
Best Regards,
Ruggero
Agree with Ruggero. I can se it only working if your text could be loaded with real html base line feeds so they are properly rendered as html.
this can easily be achieved if text is loaded to a table and html encoding is disabled. That way you can create your text in file an include required syntax to break lines.
i can provide example when i get access to my environment
Hi @Amit_B
So I have done some testing and it all works for me as I expected.
So yeah - as expected this can be easily done.
BY THE WAY - ignore my variable message (you dont need to use report at all) you just need to make sure your email is HTML
cheers
Thank you very much for the detailed answer!
Can the variable you created be dynamic?
The text and the positions of the blank lines (<BR>) can change.
My client updates the text, and the updated text is emailed to his clients through the NP. I'm using NP for the client, I don't want to update the email/variable every time he changes the text.
Of course it can. At the end it is very basic REPLACE() Qlik function, right? you replacing line carrier character with '<BR>' characters like below:
// Set variable text
Set vVariable = hello
123,
456,
789
xxx
best regards
NPrinting Qlikster;
//replace line carrier characters
Let vVariable = Replace('$(vVariable)',Chr(13),'<BR>');
In my testing both CHR(13) and CHR(10) were working the same way.
Thanks!