CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Removing Line feeds in memo field [RESOLVED]

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
flipandboef


Posts: 107
Posted: 02/18/2009, 7:01 AM

Thanks for your reply!
I actually also tried that, without success...
View profile  Send private message
flipandboef


Posts: 107
Posted: 02/18/2009, 7:44 AM

Actually I just found it 8-)
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.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.