flipandboef
Posts: 107
|
Posted: 02/16/2009, 1:15 PM |
|
I have a page that displays data from the DB and exports to Excel via a link (used as in the example from CC).
There is one field (memo), that has line feeds added via Javascript (\r or \n) on the input page, that I can not modify.
Now when I export it to Excel, this line feed has to be removed.
How can I do this?
I have tried to place any of these lines in the Before_Show for that field:
X.Y.value = Replace(X.Y.value, "\\n", "") and
X.Y.value = Replace(X.Y.value, "\\r", "") and
X.Y.value = Replace(X.Y.value, vbCrLf, ""), but the lines are not removed.
Any ideas?
CC Studio 3.2
Access DB
ASP 3.0 with templates / VBscript
|
|
|
jjrjr1
Posts: 942
|
Posted: 02/17/2009, 11:45 AM |
|
hi
Try "\n" "\r" instead of "\\n" "\\r". I think you are escaping the escape character..
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
|
|
flipandboef
Posts: 107
|
Posted: 02/18/2009, 7:01 AM |
|
Thanks for your reply!
I actually also tried that, without success...
|
|
|
flipandboef
Posts: 107
|
Posted: 02/18/2009, 7:44 AM |
|
Actually I just found it
Perhaps it's not the best way (or the cleanest way) to do this, but it works!
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "(\r|\n|<BR>)*"
RegEx.Global = True
RugsShop.DescLong.Value = RegEx.Replace(X.Y.Value, "")
Only issue left is that it now gives me extra rows that are merged in Excel.. I'll post that issue in a new topic.
|
|
|
|