For leading blanks when you got a number:
= CHOOSE(umD:patientId = 0 OR NULL(umD:patientId),‘’,FORMAT(umD:patientId,‘@N_7’))
IF you need the number left justified then TRIM(LEFT(FORMAT(umD:patientId,‘@N_7’))) without leading zeros or blanks
IF you need leading zeros FORMAT(umD:patientId,‘@N07’)
There is also a FORMAT(umD:patientId,‘@N07B’) This will print you a 7 digit number, leading zeros and blank it if zero, make sure it works with the nulls
Thanks for the suggestions, Roberto. But so far, not what I want.
The template code is using p_web.FormatValue, which leverages the StringFormat class and its extended pictures.
The numeric pictures you specify all seem to insert a separator - whether comma, period, or space. And that’s why I’m using an @S picture - I just want it displayed as a string. But blank if the number is 0 or NULL.
I haven’t taken the time to investigate, but I’m guessing that even though I specify a @String picture in the browse template, the templates are checking the dictionary and deciding that the underlying data is a LONG.
The built-in picture editor in the Embeditor doesn’t give that option, so I’m assuming that’s part of the extended pictures?
Now I just need John to finish his AI processing of all Capesoft docs so I can find such answers. (I did spend more than my standard 48 seconds parsing through them )
My second suggestion was:
TRIM(LEFT(FORMAT(umD:patientId,‘@N_7B’))) with umD:PatientID = 567
After FORMAT ’ 567’
After LEFT '567 ’
After TRIM ‘567’
Going from memory recall…
Not in the VM…
Doing an FORMAT(umD:patientId,‘@N07B’) with umD:PatientID = 12345
Will get you an ‘0012345’ and a blank with umD:PatientID = 0