Normal Topic MergeFilePrint and @Newline() (Read 11802 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
MergeFilePrint and @Newline()
Jan 31st, 2020 at 8:43pm
Print Post Print Post  
Hey folks!

Small issue (I hope).  I'm using MergeFilePrint to built an HTML file to send out via email, but one of my values isn't showing properly.

I have a string value (vStatement) that has TAB(1) and @NEWLINE() values in it, but in my HTML doc, the line breaks aren't showing (the tabs appear to be fine).

Any way to work around this?
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: MergeFilePrint and @Newline()
Reply #1 - Jan 31st, 2020 at 9:37pm
Print Post Print Post  
Hey Blair,

You can use the Matches string to force HTML Line breaks into the output. For Example

Code
Select All
MergeFilePrint("MyFile.html", "html", "", "", "MyField=" + @Replace(MyField, @Newline(), "<BR>"), "result", 0) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: MergeFilePrint and @Newline()
Reply #2 - Jan 31st, 2020 at 10:02pm
Print Post Print Post  
That worked thanks!

OK ... next issue. Smiley

HTML doesn't like TAB characters, so I'm trying to translate my data into a table (which I have been successful with).  However, I have not been able to successfully left justify my headers or add a thin border around the table boxes.  How would I insert that into my existing code?

Code
Select All
	// CHECK FOR STATEMENT INVOICES

	vStatement2 =
		 		"<table style=" + @chr(34) + "width:80%" + @chr(34) + ">" +@newline() +
				"<tr>" + @newline() +
    				"<th>" + "DATE" + "</th>" + @newline() +
				"<th>" + "INVOICE AMT" + "</th>" + @newline() +
				"<th>" + "INVOICE NO" + "</th>" + @newline() +
				"<th>" + "HEADER 4" + "</th>" + @newline() +
				"<th>" + "HEADER 5" + "</th>" + @newline() +
				"</tr>" + @newline()

[[A BUNCH OF LOOKUP CODE THAT'S NOT RELEVANT]]

		vGrpCount9 = @countstringarray(vPmtNote9)

		for vLoop = 1 to vGrpCount9

			else vStatement = vStatement + @newline() + vTempstring9

			vStatement2 = vStatement2 + @newline() +
  				"<tr>" + @newline() +
				"<td>" + vTempDate + "</td>" + @newline() +
				"<td>$" + @decimals(@accessstringarray(vTempstring9,2),2) + "</td>" + @newline() +
				"<td>SECTION 3" + "</td>" + @newline() +
				"<td>SECTION 4" + "</td>" + @newline() +
				"<td>SECTION 5" + "</td>" + @newline() +
				"</tr>"
		Next

		vStatement = vStatement + @newline() + "</table>"
 

  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: MergeFilePrint and @Newline()
Reply #3 - Feb 3rd, 2020 at 2:54pm
Print Post Print Post  
Hey Blair,

Something like:
Code
Select All
// CHECK FOR STATEMENT INVOICES

	vStatement2 =
		 		"<table border=1 style=" + @chr(34) + "width:80%" + @chr(34) + ">" +@newline() +
				"<tr>" + @newline() +
    				"<th align=left>" + "DATE" + "</th>" + @newline() +
				"<th align=left>" + "INVOICE AMT" + "</th>" + @newline() +
				"<th align=left>" + "INVOICE NO" + "</th>" + @newline() +
				"<th align=left>" + "HEADER 4" + "</th>" + @newline() +
				"<th align=left>" + "HEADER 5" + "</th>" + @newline() +
				"</tr>" + @newline()

[[A BUNCH OF LOOKUP CODE THAT'S NOT RELEVANT]]

		vGrpCount9 = @countstringarray(vPmtNote9)

		for vLoop = 1 to vGrpCount9

			else vStatement = vStatement + @newline() + vTempstring9

			vStatement2 = vStatement2 + @newline() +
  				"<tr>" + @newline() +
				"<td align=left>" + vTempDate + "</td>" + @newline() +
				"<td align=left>$" + @decimals(@accessstringarray(vTempstring9,2),2) + "</td>" + @newline() +
				"<td align=left>SECTION 3" + "</td>" + @newline() +
				"<td align=left>SECTION 4" + "</td>" + @newline() +
				"<td align=left>SECTION 5" + "</td>" + @newline() +
				"</tr>"
		Next

		vStatement = vStatement + @newline() + "</table>" 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged