Changing report display decimals at runtime

  • Thread starter Frosty the Coder
  • Start date

Frosty the Coder

Legendary Poster
Ok, here's an "old dog looking for
new tricks question"....

W/in WORLD, you could override the
#of display decimals (report or screen)
at RUNTIME by programatically changing
the appropriate field (I _think_ it was
##DCOR). This would allow a pgm to display
0 decimals under some conditions and
2 under other conditions.

IS IT POSSIBLE, w/in an XE UBE to do so?
I've got a report that MOST OF THE TIME
displays w/0 decimals on the dollar fields.
HOWEVER, in one instance the values represent
a percent, and they want to show 2 decimals.

I realize that I could add a second set of
controls (for the percents), and hide/show
the dollar and percent controls as needed,
but was wondering if there was a better
(or at least different) method.

TIA

Gene

Gene Piekarski, Jr

AS/400, B733, SP11.2, NT client
AS/400, B733, SP14, W2000 client
XE, SP15.1
 
Hi Gene,

Try to use B0000164 "Display Decimals, Set" Business Function.
Although it hasn't any attachment, its usage is obvious.

Please, let us know your results! Thanks!

Good luck,

Zoltán

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 
Zoltan,

I looked in the KG and found doc OTT-00-0063 that
describes the bsfn you suggested. It SOUNDED LIKE
it would do as I wanted. It didn't.

My ube control is defined as 11,2 (999,999,999.99)

Normally passing 123.456 into this get 123.46 (rounding)

I did a DISPLAY DECIMAL, SET to zero and got 123,456.00
I did a DISPLAY DECIMAL, SET to one and got 12,345.60

I _want_ to set to zero and get 123,
set to one and get 123.5 (rounding).

Short of a _lot_ of additional controls, defined as
9,0 (999,999,999), placed in the same spots as the
existing controls, and hidden/shown as needed, is
there are way to accomplish this?

Am I (somehow) using B0000165 wrong?

Your guidance is greatly appreciated.

Thanks

Gene

Gene Piekarski, Jr

AS/400, B733, SP11.2, NT client
AS/400, B733, SP14, W2000 client
XE, SP15.1
 
Res: Changing report display decimals at runtime

After much discussion w/help desk it seems as though
the DISPLAY DECIMALS, SET portion of BSFN B0000164 doesn't work.

They found that when this BSFN _is_ used,
it the the CURRENCY DECIMALS, SET that is called.
Also, there are disclaimers as to multi-currency
being on/off (the clients is off).

The RVs that I am using are _not_ based
on "currency" dd items.

SO, if you have an NON-currency numeric,
that you wish to change decimals on the
fly, you're SOL (somewhat out of luck).

A SAR has been added to address this issue.
I'd wager that it ends up as
"Returned - redesign not planned".

I can (and will) add a bunch of RVs
that have the correct decimals, and
add code to hide/show these as needed.



Gene Piekarski, Jr

AS/400, B733, SP11.2, NT client
AS/400, B733, SP14, W2000 client
XE, SP15.1
 
Back
Top