CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2004
    Posts
    17

    Question about Null value in cross tab

    Dear all,

    I have a question about formula in crystal report.
    I have created a cross tab. In the group field, the null value will display blank.
    How can it display other text if it is null instaed of blank?
    Thanks alot

  2. #2
    Join Date
    May 2003
    Posts
    163
    Hi,

    Right Click the summary field, select "Format Field", go to "Common" Tab.

    You can find X-2 for "Display" String option. Click that button and write the following formula

    If IsNull(CurrentFieldValue) = True then
    0.00
    else
    CurrentFieldValue

    This will display 0 if that field contains Null and the actual value if it is not null.

    Hope this will work.

  3. #3
    Join Date
    Aug 2004
    Posts
    17

    Unhappy

    Hi
    Thank you for your reply
    I have modify the formula from you and place it in the right place.
    However, it doesn't work.
    The blank group title has not be changed to the text that I expected.
    Do you have any suggestion?

  4. #4
    Join Date
    May 2003
    Posts
    163
    Is that field is blank or null? If it is blank, just check with blank space instead of checking null.

  5. #5
    Join Date
    Aug 2004
    Posts
    17
    I have checked both of it
    but still cannot work
    Here is my code
    for the null value:
    if IsNull({table.field}) then
    "Unspecific"
    else
    CurrentFieldValue

    for checking space
    if {table.field}=" " then
    "Unspecific"
    else
    CurrentFieldValue

    both of them are shown nothing is the cross tab field
    Do u have any other suggestion?
    Thanks for your help!!!!

  6. #6
    Join Date
    Aug 2004
    Posts
    17
    I have an other question to ask you
    I want to change the subtotal to other currency
    and the exchange rate is store in other table
    I don't know how to get the exchange rate for each of the countries
    How can i do this by the formula?

  7. #7
    Join Date
    Aug 2004
    Posts
    17

    Smile

    you are so nice and very helpful~~~

  8. #8
    Join Date
    May 2003
    Posts
    163
    Thanks,

    For the first question, Hope you have written the formula in "Display String" (Format)section.

    Try to check CurrentFieldValue instead of {table.field}.

    I checked with zero, it worked.

    For the second question, if you have any linking field like country code, country name use that field to link with the other table which contains the exchange rate. Write the formula by using that field.

  9. #9
    Join Date
    Aug 2004
    Posts
    17
    Thank you for reply!
    I also check it with non-null value
    it also works!
    however, when I check it with null value, it shows nothing~
    I have check it with sql statement, it is null value in the database

    How come this happens??

    Thanks~

  10. #10
    Join Date
    Aug 2004
    Posts
    17
    I have a new question again.

    The crystal report have not show the record that is zero
    How can I show the zero record??

    Thanks very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured