I'm creating a form in asp.net (Visual Studio 2003), the form then will be used to generate a CrystalReport (Crystal Report XI) by using CrystalReportViewer.
The form is quite simple that used to stored data in database, I'm using multiline textbox in the form. I also using the following code to replace the newline in the textbox into html <br> tag
.Replace(Environment.NewLine, "<br>")
The code is working fine, the newline is changed into <br> in the database. Then I need to fetch the stored data back into the form for editing purpose. I then use the following code to replace the <br> back into a newline in the textbox.
.Replace("<br>", Environment.NewLine)
Then I generate the CrystalReport in the asp page. It's successfully generated, the problem occurs when I try to export the report. It doesn't pop out an export window as it has to be, it returns an
Unterminated string constant
error message.
I then tried to change the code that used to replace the <br> into something like the following
.Replace("<br>", " ")
And the export function is working fine, so I think the problem is related to the
Environment.Newline
. But I was having a very hard time finding another way to replace the <br> tag except by using the
Environment.Newline
in the ASP. Do you guys can help me dealing with this issue ?