Edward Boyle-478467 (10/8/2013)
Try thisDECLARE @PDFFileName VARCHAR(8000) =
(
SELECT STUFF(( SELECT ', ' + PDF_FileName + '.pdf' + char(13) + char(10)
FROM @PDFResult
ORDER BY 1 ASC FOR XML PATH(''),type).value('(./text())[1]','Varchar(8000)'),1,1,'')
)
Select @PDFFileName
hmmm, it didn't work still displays in my email as a long concatenated string " a.pdf,b.pdf,c.pdf "
I'm not too fussed about getting it working as it doesn't look too bad but now I'm just curious for a solution.
mister.magoo (10/8/2013)
It sounds to me like your email may have an html body, in which case, replace the char(13), char(10) combination with a '< br / >' (remove the spaces) tag, which has the same effect on an html page.
Yeah it is HTML body, I've tried using the br or p syntax and no difference.
I can only think there was a problem with the way you tried?
Perhaps if you generate some sample html and post it here we can see what is wrong?
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
mister.magoo (10/8/2013)
I can only think there was a problem with the way you tried?Perhaps if you generate some sample html and post it here we can see what is wrong?
This is my HTML template
<html>
<head>
</head>
<body>
<p style="font-family: arial, verdana, times; font-size: 12px; color: #000000;">Original Zip Filename.<br/><br/>[[FileName]]<br/><br/>Missing PDF File.<br/><br/>[[PDF_FileName]]
</p>
</body>
</html>
This is my HTML Code, [[PDF_FileName]] is replaced with the string...
by putting the '< br/ >' (spaces were removed) it generates this
<html><head></head><body><p style="font-family: arial, verdana, times; font-size: 12px; color: #000000;">Original File.<br/><br/>test.zip<br/><br/>PDF Filename.<br/><br/> abc123.pdf<br/>, test.pdf<br/>, test123.pdf<<br/></p></body></html>
when i execute it i can see now its got weird characters " & lt ; br / & gt ; "
edit: had to put spaces in otherwise it was correctly showing br br
When you replace [[PDF_FileName]] does the rendered html have <br/> between each file name?
Can we see the final html (redacted)?
edit:
I see you have posted further ...
Get the html right and it will work
MM
select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);
sorry, IE crashed as i edited the reply
ummm, when i select my variable i get the wierd characters etc.... but when the email generates it shows BR.
how can i pass through BR if it keeps getting translated?
Viewing 15 posts - 1 through 15 (of 19 total)
You must be logged in to reply to this topic. Login to reply