Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Zero values not showing in specified format

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Zero values not showing in specified format

    I have a problem with DR8 reports, where a zero currency value is showing as 0, rather than £0.00.

    I attach 2 versions of the same report to demonstrate the issue.

    Any ideas, anyone?
    Attached Files Attached Files

  2. #2

    Default Re: Zero values not showing in specified format

    I think I have narrowed the problem down to function fields. The zero values in the example report that I sent are all coming from function fields, rather than database fields. This version of the report only prints when there are no records entered yet.

    If I enter "return 0.00" in the function field as a default value, and don't pass anything to the function from my program if the value is 0, then it works.

    But I will need to change all my programs that pass a numeric value to a function, to pass nothing for zero, and I will need to change all my reports to have "return 0.00" as the value for these functions.

    I didn't need to do this in DR7.

  3. #3
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Zero values not showing in specified format

    Geraldine,

    What you say is that in the past you wrote:
    Code:
    Set psFunction of oReport sReportId "<name of function>" to ""
    and that this resulted in the v7 PDF and that in v8 you need to write:
    Code:
    Set psFunction of oReport sReportId "<name of function>" to "return 0.00"
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  4. #4

    Default Re: Zero values not showing in specified format

    No, Vincent.

    In the function itself within DR7, I had nothing for the formula and in my program I had Set psFunction of oReport sReportId "<name of function>" to ("return " + nValue) where nValue could be any decimal value including zero.

    However, now in DR8, a value of 0 for nValue, shows as 0 on the report as opposed to £0.00.

    I have now recorded "return 0.00" in DR8 for the formula of the function and in my program, I only set psfunction if nValue is not zero. So now the report always shows "£0.00" instead of just 0.

    I hope that makes sense!

    I am happy enough that I have worked around it, but others may run into the same problem.

    Thanks
    Geraldine




  5. #5
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Zero values not showing in specified format

    Geraldine,

    I would think this is a undesired and unexpected change so we need to make a test workspace to see what is going on.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  6. #6
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: Zero values not showing in specified format

    Quote Originally Posted by Vincent Oorsprong View Post
    a undesired and unexpected change
    Is that a long word for "bug"?

    Mike

  7. #7
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    5,446

    Default Re: Zero values not showing in specified format

    kkkkkkkkkkk

    good one mike

    this makes me to remember a phrase from a old Db2 Developer that he sated on his profile.

    My code do not have any bugs! They evolved to have free will !
    Last edited by Samuel Pizarro; 9-Apr-2021 at 02:49 PM.
    Samuel Pizarro

  8. #8
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Zero values not showing in specified format

    Geraldine,

    Tried to duplicate the case but the preview does show the "£0.00" when I have:
    Code:
    Procedure SetFunctions
        String sFunctionBody sReportId
    
        Get psReportId to sReportId
    
        Get psFunction sReportId "Function2" to sFunctionBody
        Move "Return 0.00" to sFunctionBody
        Set psFunction sReportId "Function2" to sFunctionBody
    End_Procedure
    in my code and I formatted the field as custom currency.

    Let's move this issue to HDE. Please create a ticket with a test workspace to illustrate the problem and then we look into this.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  9. #9

    Default Re: Zero values not showing in specified format

    Hi Vincent

    If you try it with "Return 0", I don't think it will work, even though you have the field in DR formatted as custom currency.

    Geraldine

  10. #10
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    10,869

    Default Re: Zero values not showing in specified format

    Geraldine,

    Duplicated, I will log it.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

Page 1 of 2 12 LastLast

Posting Permissions

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