Detecting empty blob/string
I am trying to detect when a string is nul. The field type I am working with
is actually a blob but is apparently treated as a string by RB. Thats Ok.
But the detection scheme does not work.
When the empty value prints it appears as a box symbol.
In the calc event:
psuedo code:
if Questionnaire_Result['User_Question'] is nul then
value := 'N/A'
else Value := Questionnaire_Result['User_Question'];
Its the is nul detection that I can't find a solution for.
I've tried:
Isnul - won't compile
CompareText - ?
compare to char (221) - won't compile
= '' did not work
Thanks,
Jim Garrity
is actually a blob but is apparently treated as a string by RB. Thats Ok.
But the detection scheme does not work.
When the empty value prints it appears as a box symbol.
In the calc event:
psuedo code:
if Questionnaire_Result['User_Question'] is nul then
value := 'N/A'
else Value := Questionnaire_Result['User_Question'];
Its the is nul detection that I can't find a solution for.
I've tried:
Isnul - won't compile
CompareText - ?
compare to char (221) - won't compile
= '' did not work
Thanks,
Jim Garrity
This discussion has been closed.
Comments
if Questionnaire_Result.FieldObjects['User_Question'].IsNull then ...
regards,
Chris Ueberall;
I have tried exactly what you suggest but it isn't working.
Here is my actual code:
if Questionnaire_Result.FieldObjects['User_Question'].Isnul then Value :=
'N/A'
else Value := Questionnaire_Result['User_Question'];
With this I get the small box symbol when the User Question is empty.
Hope this helps define the problem better.
I guess the BLOB isn't null and contains a non displayable character.
Did you see any 'N/A' values? You should if there are NULL values.
Assign a simple string constant for the case the value is not NULL to verify
that the content does garbage the output.
The code works fine for me.
HTH,
Chris Ueberall;
I think you must be right, there is a character in the supposedly empty
field. I am pursuing that angle.
Unfortunatelly, Report Builder don?t like to have null in the fields he
works. So, RB put '' (empty string) in the field that have the NULL value. I
cracked my brain to find this and, to make my work easyer, I registered a
RAP function VarIsNull that tests if the field is '' and returns true.
Hope this can help.
Filipe Bortolini
pls see my answer to Jim, you don't need an additional RAP function to test
for NULL values.
You can use the following ...
myDataPipeline.FieldObjects['myFieldName'].IsNull
... to test for NULL values.
regards,
Chris Ueberall;