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?
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?
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.
Geraldine,
What you say is that in the past you wrote:
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 ""
Code:Set psFunction of oReport sReportId "<name of function>" to "return 0.00"
Regards,
Data Access Worldwide
Vincent Oorsprong
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
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
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
Geraldine,
Tried to duplicate the case but the preview does show the "£0.00" when I have:
in my code and I formatted the field as custom currency.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
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
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
Geraldine,
Duplicated, I will log it.
Regards,
Data Access Worldwide
Vincent Oorsprong