Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] excel report in webfocusv8.2.02
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] excel report in webfocusv8.2.02
 Login/Join
 
Gold member
posted
Hi All ,

i have a problem in excel report report output in
webfocusv8.2.02

i have a 2 column and cal ROW-TOTAL
the ROW-TOTAL column is cal and decimal is showing as ".01000001" it should show as ".01"

COL1 COL2 TOT
-846.50 247.49 -599.01000001

Need help in resolving this
Thank you

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8202
 
Posts: 56 | Location: India | Registered: March 24, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Hi,

First when posting sample code or result, please use the code tag.
It's the last icon on the ribbon :
</>

Secondly, what is the COL1 & COL2 format ? That can make the whole difference.
Thirdly, are you 100% sure that COL1 & COL2 have the sample value you shown us ?
Fourth, always a good idea trying to reproduce with IB file such as CAR
Fifthly, always a good idea to share your code


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2076 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Gold member
posted Hide Post
the format column is "D20S"


WebFOCUS 8202
 
Posts: 56 | Location: India | Registered: March 24, 2014Reply With QuoteReport This Post
Master
posted Hide Post
Is D20S the ACTUAL or USAGE format? D20S as a USAGE format should only print the integer portion of the value. The one thing to keep in mind with F and D formats is that internally (memory and FOCUS file) they store every significant digit. So if COL1 is a computed field or a field in a FOCUS/XFOCUS file, -846.50 is really -846.50000001, which is why you are getting the result your are getting. Try the following:
 DEFINE FILE CAR
   VAL1/D20S WITH COUNTRY=-846.50000001;
 END
 TABLE FILE CAR
 PRINT VAL1 VAL1/D20.8S
       COMPUTE VAL2=VAL1;
       COMPUTE VAL3/D20.2S=VAL1;
       COMPUTE VAL4/D20.8S=VAL1;
       COMPUTE VAL5/D20.8S=VAL2;
 IF COUNTRY EQ 'ENGLAND'
 END


In this example, you can see how VAL1 with a D20 format (no decimal) really stores all the significant digits and what is printed is based on the USAGE format. Notice VAL2. If a variable is given no format, the default field format is D and the default USAGE is D12.2. When doing computations with D fields, what is used in the internal value not the "USAGE" value.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 905 | Location: Oklahoma City | Registered: October 27, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Conver the field to Packed Decimal instead of Decimal.
That will round the values and hold it.
I have just changed the format of Define Field from D to P

  DEFINE FILE CAR
   VAL1/P20S WITH COUNTRY=-846.50000001;
 END
 TABLE FILE CAR
 PRINT VAL1 VAL1/D20.8S
       COMPUTE VAL2=VAL1;
       COMPUTE VAL3/D20.2S=VAL1;
       COMPUTE VAL4/D20.8S=VAL1;
       COMPUTE VAL5/D20.8S=VAL2;
 IF COUNTRY EQ 'ENGLAND'
 END


WF 8.2.04
Windows/Unix
All Formats
In Focus since 2006
 
Posts: 74 | Location: UK | Registered: September 17, 2018Reply With QuoteReport This Post
Expert
posted Hide Post
Simplify further by adding "D12.2" to the fields be ROW-TOTALed, like this:
TABLE FILE CAR
PRINT DCOST/D12.2 RCOST/D12.2
BY COUNT
ON TABLE ROW-TOTAL
END


   See you at Summit! In FOCUS Since 1983 ~ from PC FOCUS to WebFOCUS.
   Currrently using 8204 Gen 48 in Test and Production.
   KGPCo at CenturyLink. October 2017 to Present...
 
Posts: 2967 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] excel report in webfocusv8.2.02

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.