Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Detecting empty blob/string

edited August 2002 in RAP
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

Comments

  • edited August 2002
    Hi Jim,

    if Questionnaire_Result.FieldObjects['User_Question'].IsNull then ...

    regards,
    Chris Ueberall;

  • edited August 2002
    Chris,

    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.

  • edited August 2002
    Hi Jim,

    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;

  • edited August 2002
    Thanks Chris,

    I think you must be right, there is a character in the supposedly empty
    field. I am pursuing that angle.

  • edited September 2002
    Hey, man

    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

  • edited September 2002
    Hi Filipe,

    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;

This discussion has been closed.