Jump to content

When using this code, I get some nice traffic lights TABLE F...


Ben Maxwell

Recommended Posts

Hi Ben

First, thanks for taking the time to make a CAR example so we can more easily help.

What release are you running If you add your release to your signature line, well always be able to see it.

Which tool are you using that truncates the fex (like the web interface or App Studio)

Then well need to narrow down what part of your code is tripping up whatever editor youre using.

I would suggest that youve got a lot of code going on there there could be hard for WebFOCUS to treat correctly. All the & and ; and even the HTML tags with <> could mean something when you dont want it to.

Try swapping out your new moon Ascii code for just a letter (like an X) and see if your problem goes away.

Example

<span style=color : yellow;> X;

The other thing is - if its AppStudio thats your problem editor, maybe try editing these in the web interface instead.

Remember AppStudio actually uses HTTP to communicate with the Client. That might be significant to keep in mind while youre sending focexecs that have HTML code buried inside them.

Its a slick idea youve got going on there!

Let us know about your release and which tool youre using when you hit the truncation.

Link to comment
Share on other sites

Hi Toby,

Im running this code in APP Studio 8.206.

The highlighted area in yellow disappears upon reopening of the fex.

 

Before :

 

image.png696534 23.8 KB

 

After

 

image.png750531 34.2 KB

 

I tried some of your solutions, but I was still running across a similar issue.

Link to comment
Share on other sites

Seems like the FML tool always assumes that a semi-colon ends a recap expression. I was able to work around it this way:

-DEFAULTH &Circle = '&|#x1F311;';

TABLE FILE CAR

SUM

LENGTH

COMPUTE TL1/A100 = '<span style="color:yellow"> &Circle.EVAL '; AS ''

FOR

CAR

'JAGUAR' AS 'JAGUAR' LABEL R0010 OVER

'BMW' AS 'BMW' LABEL R0020 OVER

RECAP R1000=R0010;

AS 'Jaguar' OVER

RECAP R1010(1)=R0010+R0020;

AS 'Jaguar and BMW' OVER

RECAP R1010(2)=IF R1010(1) GT 0 THEN '<span style="color:green"> &Circle.EVAL ' ELSE IF R1010(1) LT 0 THEN '<span style="color:red"> &Circle.EVAL ';

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

Link to comment
Share on other sites

Hi Ben

Yeah, I have to think App Studio is stopping at the ; thinking that its the end of the IF statement in the RECAP. So lets find something the editor is okay with and use that.

How about this - since it seems like the editor is okay with the COMPUTE above, how about faking these literals for the different colors in RECAP Then set the color in the RECAP youre using. I couldnt get the little round lights to work right, so I just stuck in an X for the traffic light.

TABLE FILE CAR

SUM

LENGTH

COMPUTE TL1/A100 = '<span style=color : yellow;> x '; AS traffic,light

FOR CAR

-*

JAGUAR AS JAGUAR LABEL R0010 OVER

BMW AS BMW LABEL R0020 OVER

-*

RECAP YELLOW1 = '<span style=color : yellow; > X '; NOPRINT LABEL YELLOW1 OVER

RECAP GREEN1 = '<span style=color : green; > X '; NOPRINT LABEL GREEN1 OVER

RECAP RED1 = '<span style=color : red; > X ; NOPRINT LABEL RED1 OVER

RECAP R1000 = R0010; AS Jaguar OVER

-*

RECAP R1010(1) = R0010+R0020; AS Jaguar and BMW OVER

RECAP R1010(2) = IF R1010(1) GT 0 THEN GREEN1 ELSE RED1 ;

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

You get the idea.

See if getting away from the combination of the IF THEN ELSE with the ascii code for the moon helps avoid truncating.

Let us know.

Link to comment
Share on other sites

I played with both David and Tobys examples, and I was more successful with Davids.

My only issue would be is there an easy way to have these traffic lights translate correctly in Excel

I had some sort of solution using WingDings, but I havent tried to get that fancy with the FML quite yet!

-DEFAULTH &Circle = &|#x1F311;;

TABLE FILE CAR

SUM

LENGTH

COMPUTE TL1/A100 = &Circle.EVAL '; AS

FOR

CAR

JAGUAR AS JAGUAR LABEL R0010 OVER

BMW AS BMW LABEL R0020 OVER

RECAP R1000=R0010;

AS Jaguar OVER

RECAP R1010(1)=R0010+R0020;

AS Jaguar and BMW OVER

RECAP R1010(2)=IF R1010(1) GT 0 THEN &Circle.EVAL ELSE IF R1010(1) LT 0 THEN &Circle.EVAL ';

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

Link to comment
Share on other sites

When using this code, I get some nice traffic lights

TABLE FILE CAR

SUM

LENGTH

COMPUTE TL1/A100 = '<span style=color : yellow;> &|#x1F311; '; AS

FOR CAR

-*

JAGUAR AS JAGUAR LABEL R0010 OVER

BMW AS BMW LABEL R0020 OVER

-*

RECAP R1000 = R0010; AS Jaguar OVER

-*

RECAP R1010(1) = R0010+R0020; AS Jaguar and BMW OVER

RECAP R1010(2) = IF R1010(1) GT 0 THEN '<span style=color : green;> &|#x1F311; ELSE

IF R1010(1) LT 0 THEN '<span style=color : red;> &|#x1F311; ';

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET ASNAMES ON

ON TABLE NOTOTAL

ON TABLE PCHOLD FORMAT HTML

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,

$

ENDSTYLE

END

But when I close the fex and reopen it, the code truncates everything after the 1st semicolon in RECAP R1010(2).

 

&|#x1F311; ELSE IF R1010(1) LT 0 THEN '<span style=color : red;> &|#x1F311; ';

 

Is there some way to tweak the code so I can maintain consistent code every time I go into the fex

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...