With the recent security release we updated to 5.4.3.2; however this has caused an issue with exporting a file based on a query.
Previously, we used “Chr(13) & Chr(10)” to insert a new line (carriage return and line feed) within a tag. However, this no longer seems to work correctly post-upgrade. It no longer inserts subsequent rows on new lines, but rather it just continues on the same row. Has there been a change in this functionality in the recent upgrades?
Saw this: NewLine() :: Lucee Documentation, but that doesn’t seem to help.
Noticed this: solved https://luceeserver.atlassian.net/browse/LDEV-1957 · lucee/Lucee@366c49c · GitHub but that seems to be v6 only.
Any suggestions on how to return to previous behavior?
Don’t forget to tell us about your stack!
OS: Windows 2019
Java Version: 11.0.11 (AdoptOpenJDK) 64bit
Tomcat Version: Apache Tomcat/9.0.40
Lucee Version: 5.4.3.2
Can you give us a working code example where that is happening?
<cfset delimitChar = '#Chr(9)#">
<cfset endChar = #chr(13)# & #chr(10)#>
<cfsavecontent
variable="fileContent"> <cfoutput>DATE#delimitChar#ORDER
###delimitChar#NAME#delimitChar#BILL
COMPANY#endChar#</cfoutput></cfsavecontent> <cfsavecontent variable="newRow"> <cfoutput>#trim(now
())##delimitChar#1234#delimitChar#John Doe#delimitChar#COMPANY#endChar#</cfoutput></cfsavecon tent>
<cfsavecontent
variable="fileContent"> <cfoutput>#fileContent##newRow#</cfou tput></cfsavecontent>
<cfheader name="Content-Disposition" value="filename=order- export-#Date Format(Now(), 'yyyymmdd')##Time Format(Now
(),'HHmmss')#.xls">
<cfcontent type="application/msexcel">
<cfoutput>#fileContent#</cfoutput> <cfabort>
Roberto, there’s an error in your code that wouldn’t let it run in TryCF so I simplified it a bit to get around the error. Included that code below.
But… the problem still exists. There should be a new line created after the word Company and there’s not… the actual data just continues on the same line. That’s the issue.
If you ran this on ver 5.2.x.x it would work and include that line.
<cfset delimitChar = '#Chr(9)#'>
<cfset endChar = #chr(13)# & #chr(10)#>
<cfsavecontent
variable="fileContent"> <cfoutput>DATE#delimitChar#ORDER
###delimitChar#NAME#delimitChar#BILL
COMPANY#endChar#</cfoutput></cfsavecontent> <cfsavecontent variable="newRow"> <cfoutput>#trim(now
())##delimitChar#1234#delimitChar#John Doe#delimitChar#COMPANY#endChar#</cfoutput></cfsavecontent>
<cfsavecontent variable="fileContent"> <cfoutput>#fileContent##newRow#</cfoutput></cfsavecontent>
<cfheader name="Content-Disposition" value="filename=order-export.xls">
<cfcontent type="application/msexcel">
<cfoutput>#fileContent#</cfoutput>
<cfabort>
As far as I know there have been no intentional changes made, but 5.2 was released a long time ago
What would be great is if you could try a few stable releases to try and narrow down when the change occurred
Zach, we’ve coded around this issue, and since few others are complaining about it, I’m going to stop worrying about it.
I just can’t justify the time, loading versions until I find where it breaks, but completely understand your request.