Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Left(str, #) w/CrystalReportViewer when 2nd arg is a variable?

Using the VS2005 CrystalReportViewer control, this field formula should return "Linkoln, NE". Instead I get blanks.

Using Crystal Syntax in my report.

If I comment out the last three, lines, I get junk symbols.

(Note, I always get the expected result in Crystal Report Developer, it's only in the web control that the field doesn't display.)


StringVar bankTown ;

NumberVar positionOfLastChar ;

bankTown := "Linkoln, NE 12345" ;

positionOfLastChar := InStr (1, bankTown, ",") + 3 ;

"the last char is at" + CStr(positionOfLastChar) ;

left(bankTown, positionOfLastChar) ;

left(bankTown, 11) ;

positionOfLastChar := 11 ;

left(bankTown, positionOfLastChar) ;

Any workarounds? (I'm going to try using basic syntax first)

Former Member
Not what you were looking for? View more on this topic or Ask a question