A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
How to Export Text file without CRLF on very last data record
I have a data-driven subscription that writes a text file to a shared file area. Everything is fine. However, I added custom code in VB to see if I could strip the very last CRLF at the end of the file (EOF). The report ran, but it didn't remove CRLF.
I Called the VB Function from the 1st data row/cell in the table. Maybe change that?
Public Function RemoveEOF()
Dim filePath As String = "X:\Auto Generated Reports\Eligibility\MSO_MemberFile.txt"
If System.IO.File.Exists(filePath) Then
Dim fileContent As String = System.IO.File.ReadAllText(filePath)
fileContent = fileContent.TrimEnd(ControlChars.Cr, ControlChars.Lf)
System.IO.File.WriteAllText(filePath, fileContent)
End If
End Function
SQL Server Reporting Services
1 answer
Sort by: Newest
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more