Focal Point
trying to display multiple usernames

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

January 27, 2009, 04:11 PM
Mayor
trying to display multiple usernames
TABLE FILE ALL_LOGS
PRINT
LOGIN_DATE
LOGIN_MONTH
LOGIN_YEAR
LOGIN_DAY
LOG_STATE
SORT_DATE
OS_USERNAME
USERNAME
ALPHA_MONTH
MONTH
COMPUTE LCOUNTER/I3 = IF LOG_STATE EQ 'ON' THEN (LAST LCOUNTER + 1) ELSE (LAST LCOUNTER - 1);
COMPUTE ALPHA_MONTH/A3 = EDIT(LOGIN_MONTH);
COMPUTE MAXCURUSER/D3= LCOUNTER;
-*BY LOGIN_DATE
BY USERNAME
BY SORT_DATE NOPRINT
BY LOG_STATE NOPRINT
-*WHERE USERNAME EQ 'LMGS_PROD_APPUSER' OR 'AERO_PROD_APPUSER'
ON TABLE HOLD AS SORTED_LOGS
END
-*
-*
-***************************************************
-* Set up counter for multi users
-***************************************************
-*
-SET &COUNTER=1;
-SET &Multischema=&MASTER_SCHEMA;
-*
-*
-IF &Multischema.EXISTS THEN GOTO CHK4MUTLI ELSE GOTO DONEWMUTLI;
-*
-SET &MMultischema=&Multischema | ' , ' | &Multischema0;
-SET &MMultischema=MAX.&MMultischema;
-TYPE &MMultischema
-*
-*
-SET &Multischema=&Multischemas;

-CHK4MUTLI
-*
-*
-***************************************************
-* Set up output display format
-***************************************************
-*
-*
-IF &MASTER_OPUT EQ 'PPT' THEN GOTO TABLEFLD1;
-IF &MASTER_OPUT EQ 'EXCEL' THEN GOTO TABLEFLD1;
-IF &MASTER_OPUT EQ 'HTML' THEN GOTO GRAPHFLD1;
-*
-***************************************************
-* Run the graph for the full year, multi BA-BU report
-***************************************************
-*
-GRAPHFLD1
-*
GRAPH FILE SORTED_LOGS
-*
-INCLUDE header
-*
SUM
MAX.LCOUNTER AS 'Concurrent Users'
BY USERNAME AS 'User Names'
-*ACROSS LOGIN_MONTH AS 'Month'
ACROSS MONTH COLUMNS JAN AND FEB AND MAR AND APR AND MAY AND JUN AND JUL AND AUG AND SEP AND OCT AND NOV AND DEC
-*WHERE OS_USERNAME GT 2
-*
ON GRAPH SET LOOKGRAPH LINE
-*
-INCLUDE stylegraphyr
-*
-*
-GOTO MUTLIUSERCHK;
-*
-***************************************************
-* Display as Table *
-***************************************************
-*
-TABLEFLD1
-*
TABLE FILE SORTED_LOGS
-*
-INCLUDE header
-*
SUM
MAX.LCOUNTER AS 'Concurrent Users'
BY USERNAME AS 'User Names'
-*ACROSS LOGIN_MONTH AS 'Month'
ACROSS MONTH COLUMNS JAN AND FEB AND MAR AND APR AND MAY AND JUN AND JUL AND AUG AND SEP AND OCT AND NOV AND DEC
-*WHERE OS_USERNAME GT 2
-*
-INCLUDE output1
-*
-*
-GOTO MUTLIUSERCHK;
-*
-*
-***************************************************
-* Looping condition check for multi users *
-***************************************************
-*
-MUTLIUSERCHK
-*
-IF &&Multischemas0.EXISTS NE 1 THEN GOTO OUTLOOP;
-SET &COUNTER= &COUNTER+1;
-REPEAT CHK4MUTLI FOR &COUNTER FROM 2 TO &Multischema0;
-IF &Multischema0 GE 7 THEN GOTO OUTLOOP;
-OUTLOOP
-*
-DONEWMUTLI
-IF &Multischema0.EXISTS NE 1 THEN GOTO SKIPME;
-IF &Multischema0 LT 8 THEN GOTO SKIPME;
-SET &Multischema='Cannot List More Than 7';
-SKIPME
-*
-*
-IF &MASTER_OPUT EQ 'PPT' THEN GOTO NOOPDSPL;
-IF &MASTER_OPUT EQ 'EXCEL' THEN GOTO NOOPDSPL;
-IF &MASTER_OPUT EQ 'HTML' THEN GOTO OPDSPL;
-*
-OPDSPL
-*
-INCLUDE output1
-*
-NOOPDSPL
-*
-***************************************************
-* Display buttons and output format *
-***************************************************
-*
-*
-INCLUDE toggle_button1
-*
-*NCLUDE output1
-*
-EXIT


This does display, however, I only get one value to display only. Any Suggestions?

Thank you.



Production & Development: WebFocus 7.6.4
January 27, 2009, 05:25 PM
j.gross
That is one very confused (or at least confusing) fex:

* There's no END after the GRAPH and TABLE requests. (Is it hidden in
-INCLUDE output1
? What else?)

* The -REPEAT directive appears after the label it references (with no GOTO to bring control there).


Have you looked at the HOLD file to verify that it indeed picks up multiple username values?
If you change GRAPH FILE to TABLE FILE, what do you get?
January 27, 2009, 09:25 PM
Mayor
I apologize for the missing information. This Fex is basically an include and I didnt put an exit because there is more, but does not really have to do with the issue I am having with this fex.

The output include is just a graph style code.

There are two buttons that allow for graph or table. I put GRAPH FILE because say if the user wanted a graph to be displayed, its there. If not, they would get a table.

I truly dont understand the way the counter is suppose to work. I just tried to follow the direction of coding I looked at and I am looking for guidance on correctly that.

no real different between Table and graph code, just being able to selection one or the other, I'm sure there are shorter ways to do that like another goto statement, but I choose to go this way for now.

So, again if you could help me straighten out the issue with the mutli-user selection field for this because right now, all I get is a single user display. When I check the source code, there are no errors either.



Production & Development: WebFocus 7.6.4
January 28, 2009, 04:42 AM
GamP
I'm trying to understand your situation. Below is what I think you're trying to do (please correct me if I'm wrong).
- you have an html selection page that will allow you to do a multi-select on a dropdown box containing usernames.
- on this same page there are some more buttons that allow for the selection of the output type as well as a submit button.
- this html page has not been made with the use of the html painter.
- in your fex you try to find out what userid's have been selected.
Correct so far?
If so, then the variables that contain the multiselection are called whatever the control is called on the html page, with a sequence number added to it. So if your html variable is called 'Multischema' you will get at least &Multischema and &Multischema0. The first one is the first value selected and the ...0 contains the number of selected values. If this number is greater than 1 then you will also receive &Multischema1 &Multischema2 ... etc up to the number of selected values.
The way I would process this situation:
-DEFAULT &Multischema = 'All'
-DEFAULT &Multischema0 = 0

...

-IF &Multischema EQ 'All' THEN GOTO NO_MULTI;
FILEDEF CHKMULTI DISK CHKMULTI.DAT
-RUN
-SET &TEL=2;
-WRITE CHKMULTI &Multischema
-LOOP
-IF &TEL GT &Multischema0 THEN GOTO NO_MULTI;
-WRITE CHKMULTI &Multischema.&TEL.
-SET &TEL=&TEL+1;
-GOTO LOOP

-NO_MULTI

...

TABLE FILE ALL_LOGS
PRINT ...
BY ...
WHERE USERNAME IN FILE CHKMULTI;
END

If your situation is different, let us know.

Hope this helps.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
January 28, 2009, 08:05 AM
Mayor
Okay Thank you!!

This message has been edited. Last edited by: Mayor,



Production & Development: WebFocus 7.6.4