Focal Point
AS field name truncated the spaces

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

May 27, 2004, 05:35 AM
Ringo
AS field name truncated the spaces
I am a completely new on WEBFOCUS. I have a problem as below shown the code:



TABLE FILE TMPDATA3
SUM
VALUE AS 'BALANCE' OVER
CONNT AS 'SUMMARY BALANCE'
BY PYEAR NOPRINT
ACROSS PMONTH
ON PYEAR SUBHEAD
"
ON TABLE SET ONLINE-FMT HTML
END


How can I add a few spaces at the AS field (eg. VALUE AS '      BALANCE').

Can anyone help me !?

This message has been edited. Last edited by: <Mabel>,
May 27, 2004, 12:04 PM
jimster06
The label can be right-justified by adding /R following the variable name.

value/R as 'Balance'

HTH.
May 27, 2004, 12:09 PM
Bob Jude Ferrante
To do exactly what you asked...

If you look at the HTML source (View > Source in IE) you will notice that the spaces are being faithfully put into your HTML source by the WebFOCUS server. Then, what gives, you may well ask.

It's your browser that's closing up additional spaces. Standard browser behavior.

The way around it is to use the   entity, which tells the browser NOT to compress the spaces.

Use a DEFINE field:

DEFINE FILE xxx
NBSP/A5='' ';
END

Extra single quote at the start is to tell dialogue manager to ignore the ampersand and treat it as a literal.

BUT

I also sense you want to use the spaces to make something line up. Only heartache there. It will never line up if your browser is displaying standard proportional fonts.

Have a look at the section of the Creating Reports manual on "spot markers" or look into CSS formatting. There are tricks there to help you get things to line up in HTML.

Cheers.
May 27, 2004, 12:12 PM
Bob Jude Ferrante
Here is that code again, embedded in tags so it actually displays - the browser turned my code into spaces - as it was supposed to!

DEFINE FILE xxx<br />NBSP/A5='' ';<br />END
Cheers!
Bob
May 28, 2004, 02:26 AM
Ringo
Bob,

Thank you very much for your help!

But it seems cannot work and shown the error:
______________________________________________
0 ERROR AT OR NEAR LINE 59 IN PROCEDURE test.fex
(FOC295) A VALUE IS MISSING FOR: nbsp
______________________________________________
May 28, 2004, 12:17 PM
jimster06
Here is another approach:
DEFINE FILE CAR
AMPER/A1 WITH COUNTRY = HEXBYT(38,AMPER);
SEMI/A1 WITH COUNTRY = HEXBYT(59,SEMI);
NBSP/A6 WITH COUNTRY = AMPER | 'nbsp' |SEMI;
END

HTH
May 28, 2004, 01:27 PM
Roland
Try this one:
[qb]
DEFINE FILE xxx<br />NBSP/A5='&|nbsp;';<br />END
[/qb]
The vertical bar says Focus to not treat it as an amper variable but as a string instead !
May 28, 2004, 01:30 PM
Roland
quote:
Originally posted by Roland:
Try this one:
DEFINE FILE xxx<br />NBSP/A6='&|nbsp;';<br />END
The vertical bar says Focus to not treat it as an amper variable but as a string instead !
I only saw now, that the field is not long enough. Make it A6, as in the reviewed code above !
May 29, 2004, 04:35 AM
Ringo
Thanks, Roland

But it still cannot work, how can I pass the define field to the AS field ?




DEFINE FILE CAR
NBSP/A6='&|nbsp;';
CHGY/A50=NBSP|NBSP|NBSP|NBSP|NBSP|NBSP|'CHANGED';
END
TABLE FILE CAR
SUM VALUE OVER
CHGYOY AS CHGY OVER
BALANCE
BY PYEAR AS ''
ACROSS PMONTH
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET HTMLCSS ON
END

This message has been edited. Last edited by: <Mabel>,
June 01, 2004, 01:16 AM
Ringo
Can anyone tell me if it cannot do like this, so I need not to keep trying? Or this is the limitation for WEBFocus ?!
Confused Confused Confused Confused Confused Confused Confused Confused
June 01, 2004, 10:50 AM
<ineuxf>
You must divide between filling the AS text = column title (here use &variables) and the value of the field (columns, here use DEFINE):

This code works fine and does what you want:

-SET &ECHO=ALL;
-RUN

-* for the AS Text = column title
-SET &BLANK = '&'|'nbsp;';
-SET &BL5 = &BLANK | &BLANK | &BLANK | &BLANK | &BLANK ;
-RUN

DEFINE FILE CAR
-* FILL THE AMPERSAND & SIGN TO VARIABLE AMPER
AMPER/A1 WITH COUNTRY = HEXBYT(38,AMPER);
-* FILL THE SEMICOLON ; SIGN TO VARIABLE SEMI
SEMI/A1 WITH COUNTRY = HEXBYT(59,SEMI);
-* CREATE THE STRING  
NBSP/A6 WITH COUNTRY = AMPER | 'nbsp' |SEMI;
-* create the string with two blanks and the field COUNTRY
STRING/A25 = NBSP| NBSP| COUNTRY ;
-* create the string with five blanks and the field COUNTRY
STRING5/A60 = NBSP|NBSP|NBSP|NBSP|NBSP| COUNTRY ;
END
TABLE FILE CAR
SUM DCOST
STRING AS &BLANK|&BLANK|twoBLANKSWITHCOUNTRY
STRING5 AS &BL5|FiveBLANKSWITHCOUNTRY

BY COU

ON TABLE SET ONLINE-FMT HTML
END

-EXIT

hope this helps

Udo
June 01, 2004, 01:06 PM
Mikel
This example also works fine:

-SET &NBSP = '&' | 'nbsp;' ;
-SET &TITLE1 = 'Model' ;
-SET &TITLE2 = &NBSP | 'Car' ;
-SET &TITLE3 = &NBSP | &NBSP | 'Country' ;
-SET &TITLE4 = &NBSP | &NBSP | &NBSP | 'Sales' ;

TABLE FILE CAR
PRINT
MODEL AS '&TITLE1' OVER
CAR AS '&TITLE2' OVER
COUNTRY AS '&TITLE3' OVER
SALES AS '&TITLE4'
BY MODEL NOPRINT SUBFOOT
" "
END
-RUN

Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
June 01, 2004, 01:22 PM
Mikel
And another interesting approach.

In my opinion...
In order to give any kind of style to WebFOCUS reports or, in this case, align anything in HTML/xhtml, the best way is the use of CSS (Cascading Style Sheets).

In this case, text-indent is the property we need.

Try the following example:


-* Report. Business logic.
TABLE FILE CAR
PRINT
MODEL AS 'Model' OVER
CAR AS 'Car' OVER
COUNTRY AS 'Country' OVER
SALES AS 'Sales
BY MODEL NOPRINT SUBFOOT
" "
ON TABLE HOLD FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=TITLE, COLUMN=P2, CLASS=indent1, $
TYPE=TITLE, COLUMN=P3, CLASS=indent2, $
TYPE=TITLE, COLUMN=P4, CLASS=indent3, $
END
-RUN

-* Output - Presentation logic.
-HTMLFORM BEGIN

!IBI.FIL.HOLD;
-HTMLFORM END

Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
June 01, 2004, 06:08 PM
susannah
Ringo, what about just a simple adjustment to your style sheet?
TABLE FILE TMPDATA3
SUM VALUE AS 'BALANCE' OVER CONNT AS 'SUMMARY BALANCE' BY PYEAR NOPRINT
ACROSS PMONTH
...etcetera
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET STYLE *
TYPE=TITLE,COLUMN=VALUE,JUSTIFY=RIGHT,$
---or
TYPE=TITLE,COLUMN=VALUE,JUSTIFY=CENTER,$
ENDSTYLE
END
June 02, 2004, 01:32 AM
Ringo
Mikel,

Thank you very much. I am very happy that you DO help me to solve this problem. It works now.


FOR susannah,

If use the JUSTIFY can solve my problem, I needn't to post this for help. Anyway, Thanks a lot.


Best Regards,
Ringo