Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any reason this would crash report designer?

Status
Not open for further replies.

bobbyr

Programmer
Nov 30, 2000
66
0
0
US
Mid(Replace{sgpso203.DESC},".","",4)

I'm trying strip out any periods, then chop off the left three characters in the string. I can do the formula with just the Mid(), but when I add the Replace(), it causes Crystal Reports to crash. Any suggestions?

Thanks,
Bobby
 
<<Mid(Replace{sgpso203.DESC},&quot;.&quot;,&quot;&quot;,4)>>
You need another set of parens:
Mid(Replace({sgpso203.DESC},&quot;.&quot;,&quot;&quot;),4)

 
I actually do have the second parens, I made a typo when posting my message. My current formula looks like:
Mid(Replace({sgpso203.DESC},&quot;.&quot;,&quot;&quot;),4) and when I save the report, Crystal Reports actually crashes and closes. If I remove the Replace function and save, everything works fine. I wasn't sure about the function within a function, so I created one formula called Strip that contained Replace({sgpso203.DESC},&quot;.&quot;,&quot;&quot;). This worked fine. Then, I created a formula called CleanDesc and it contained Mid(@Strip,4), and this too caused Crystal to crash and close. In either case, when I go to open the report, it seems to immediately crash when it refreshes the data.

Dunno..
Bobby
 
What version of CR are you using? The replace function in some builds of v8.0 will not let you replace a character with an empty string. Instead download the StripString function which allows you to strip out your periods. You can get this function, and a few others by by downloading the file:

ufltech1.exe at:

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I'm not sure what build i'm using, but it's v8.0 Developer Edition. Perhaps the empty string problem is what I'm experiencing, I'll download the StripString Function and try that out..

Thanks,
Bobby
 
You could test a formula that just does the replace. When that fails you get an empty result. It may be the combination that causes the crash. If you are distributing this report with an app you will need to also distribute the dll for stripString. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
It seems to be the combination of the two. What I did instead is to replace the &quot;.&quot; with a space, then trimmed white space. I normally use v8.5, but needed the distribution expert that is in 8.0 developer. I hadn't noticed any problems like that in 8.5, which is why I was so confused at first.

Thanks for the help!

Bobby
 
You can add the same distribution function to v8.5 if you have developer. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top