Focal Point
[CLOSED] Decimal values in headers add spaces before the number

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3087082196

May 06, 2019, 09:37 AM
Siva1925
[CLOSED] Decimal values in headers add spaces before the number
Hi
I am getting data from DB using SQL passthru and holding it in a hold file.Then I am using that hold file to print a WP format report.

When i use amount fields(D22.2 and D22.2cM) in my header there is a lot of space before the number.Earlier we used defines to convert into Alpha, used LJUST to left justify it and then use it in the headers.
Is there any other way to remove the spaces.I am trying to get rid of the defines.

WF8105

This message has been edited. Last edited by: FP Mod Chuck,
May 06, 2019, 10:18 AM
MartinY
You should not have to convert to Alpha then Justify your field to add it in a header.
Maybe just to set the proper display format.

Try below and share the result you have
TABLE FILE CAR
SUM COMPUTE TSAL/D8.2CM = SALES; NOPRINT
HEADING
"Display As Field Definition : <SALES"
"Desired Field Display : <TSAL"
ON TABLE SET PAGE-NUM NOLEAD
END



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
May 06, 2019, 10:36 AM
Siva1925
Hi Martin,
I already tried with car file.It is working fine in there.Something happens when i do this with using my DB table.

FLD1 E01 A9V
FLD2 E02 P17.2
FLD3 E03 A2V
FLD4 E04 P10
FLD5 E05 A52V
FLD6 E06 A10V
FLD7 E07 A20V
FLD8 E08 D20.2
FLD9 E09 A40V
FLD10 E10 D20.2
FLD11 E11 A40V

This is the structure of my hold file.
I first conver the decimals D20.2 to D22.2cM and then make them LJUST.

I tried computes and then use it header it is still the same.

This message has been edited. Last edited by: Siva1925,
May 06, 2019, 10:54 AM
srajeevan
Just try use || in the define you have and append a single white space.
|| will remove all white space.
This is not a solution it is a workaround if you are not finding any other solution.


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
May 06, 2019, 12:02 PM
Siva1925
Hi srajeevan,
The fields i am using are decimals so i cannot append string to it.

But i can convert the field to an Alpha.
I tried that and that also leaves some space before the number.

I guess this is because it is right aligned by default.Since my output is in WP format i cannot use style sheets .Is there a way to left align them without using defines?

This message has been edited. Last edited by: Siva1925,
May 06, 2019, 01:28 PM
Doug
What are the ACTUAL and USAGE formats as seen within the synonym?




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
May 06, 2019, 02:20 PM
MartinY
Sorry, haven't pay attention to your output format. But, you'll probably not be able to avoid defines/computes except if the USAGE may solve it

Maybe this may suit your need
TABLE FILE CAR
SUM COMPUTE TSAL/A20V = TRIM_(BOTH, ' ', FPRINT(SALES, 'D15.2CM', 'A20V')); NOPRINT
HEADING
"Display As Field Definition : <SALES"
"Desired Field Display : <TSAL"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS baseapp/testwp FORMAT WP
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
ENDSTYLE
END



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007