Focal Point
populating variables in a report header

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

December 09, 2014, 08:36 AM
Geoff Fish
populating variables in a report header
We have a rather compex ad-hoc html page that we are buliding, it uses an external procedure to actuallu perform the computing and is passed from an HTML page built with HTML composer. Our problem is this we have probably close to thirty parameters to pick on this page, when the use picks them we want to display the parameter, when they dont we dont want to display anything

So if i have the code Major: &MAJR_DESC1 in my header and the user selects a Biology it will print Major: Biology in the header. no problem right but if the user does not pick a value we want it to not display anything, As things are now for us it prints Major:

We want to eliminate the print from the report header when the paremeter is not being selected from

WHERE EXT_ENROLL.SEG01.MAJR_DESC1 EQ &MAJR_DESC1.(OR(FIND EXT_CURR_MAJOR.SEG01.MAJOR,EXT_CURR_MAJOR.SEG01.MAJOR IN ext_curr_major)).Major.;


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
December 09, 2014, 09:58 AM
MattC
-SET Major: as a variable based on &MAJR_DESC1 existence. Then in your heading line, you will have the both variables or you can combine them into one.


WebFOCUS 8.1.05
December 10, 2014, 04:48 PM
Geoff Fish
MattC I got this far on my own but it still printingwhen i do not pick a value so i am missing something

-LOOP
-IF &MAJR_CODE1 EQ ' ' GOTO EARLY;
-SET &MAJOR = Major:;
-EARLY
TABLE FILE AS_STUDENT_ENROLLMENT_SUMMARY
PRINT
AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_CODE1
AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_DESC1
ON TABLE SUBHEAD
" &MAJOR &MAJR_CODE1 "
WHERE AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_CODE1 EQ &MAJR_CODE1.(OR(FIND STVMAJR.STVMAJR.STVMAJR_CODE,STVMAJR.STVMAJR.STVMAJR_DESC IN stvmajr)).MAJR_CODE1.;
WHERE READLIMIT EQ 50
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
December 10, 2014, 05:06 PM
susannah
What are your default values for these 30 variables?
Am i correct in assuming you don't want to see a blank line when one of the &vars is empty, you want to bypass that line?
Am i correct in assuming you want 1 subhead line per &var ?

this should give you some ideas.
you'll note i have a chronic aversion to FOC_NONE

-SET &ECHO = ALL ;
-DEFAULT &myvar1 = 'W GERMANY';
-DEFAULT &myvar2 = 'ALL';
-DEFAULT &myvar3 = 'ALL';
-*
-SET &cmt_myvar1 = IF &myvar1.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;
-SET &cmt_myvar2 = IF &myvar2.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;
-SET &cmt_myvar3 = IF &myvar3.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;
-*
-SET &filter_myvar1 = IF &myvar1.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF COUNTRY EQ '''| &myvar1 | '''' ;  
-TYPE &filter_myvar1
-SET &filter_myvar2 = IF &myvar2.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF CAR EQ '''| &myvar2  | '''' ;
-SET &filter_myvar3 = IF &myvar3.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF MODEL LIKE '| &myvar3 |'%' ;
-*
TABLE FILE IBISAMP/CAR
&filter_myvar1
&filter_myvar2
&filter_myvar3
SUM DCOST
BY COUNTRY BY CAR BY MODEL
ON COUNTRY SUBHEAD
" "
&cmt_myvar1.EVAL "MYVAR1 = &myvar1"
&cmt_myvar2.EVAL "MYVAR2 = &myvar2"
&cmt_myvar3.EVAL "MYVAR3 = &myvar3"
END

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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 18, 2014, 09:24 AM
Geoff Fish
Susannah I am not setting any defaults for the variables I am populating the HTML page with dynamic parameters from lookup tables

Any additional input would be appreciated.

Geoff


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
December 18, 2014, 09:50 AM
Danny-SRL
Geoff,

Tell me, are you getting your value for &MAJR_CODE1 when WF encounters the WHERE statement?
quote:
-LOOP-IF &MAJR_CODE1 EQ ' ' GOTO EARLY;-SET &MAJOR = Major:;-EARLYTABLE FILE AS_STUDENT_ENROLLMENT_SUMMARYPRINT AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_CODE1 AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_DESC1ON TABLE SUBHEAD" &MAJOR &MAJR_CODE1 "WHERE AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_CODE1 EQ &MAJR_CODE1.(OR(FIND STVMAJR.STVMAJR.STVMAJR_CODE,STVMAJR.STVMAJR.STVMAJR_DESC IN stvmajr)).MAJR_CODE1.;WHERE READLIMIT EQ 50ON TABLE SET PAGE-NUM NOLEADON TABLE NOTOTALON TABLE PCHOLD FORMAT HTML

If so, then I would write your code thus:
  
TABLE FILE AS_STUDENT_ENROLLMENT_SUMMARY
WHERE AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_CODE1 EQ &MAJR_CODE1.(OR(FIND STVMAJR.STVMAJR.STVMAJR_CODE,STVMAJR.STVMAJR.STVMAJR_DESC IN stvmajr)).MAJR_CODE1.;
WHERE READLIMIT EQ 50
PRINT
AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_CODE1
AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.MAJR_DESC1
-IF &MAJR_CODE1 EQ ' ' GOTO EARLY;
-SET &MAJOR = Major:;
-EARLY
ON TABLE SUBHEAD
" &MAJOR &MAJR_CODE1 "
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

December 19, 2014, 08:25 AM
Geoff Fish
Thanks Danny Thats kind of what I envisioned, I was hoping that there was something simpler that I could figure out because i have the follwing variabales that I am working with and I would have to figure out how to loop these all together.
I think I will have to write GOTO1, GOTO2, GOTO3, ..... and so on for each one of these prompts

WHERE EXT_ENROLL.SEG01.ETHN_CODE EQ ÐN_CODE.(OR(FIND STVETHN.STVETHN.STVETHN_CODE,STVETHN.STVETHN.STVETHN_DESC IN stvethn)).ETHN_CODE.;
WHERE EXT_ENROLL.SEG01.LEVL_CODE EQ &LEVL_CODE.(OR(FIND STVLEVL.STVLEVL.STVLEVL_CODE,STVLEVL.STVLEVL.STVLEVL_DESC IN stvlevl)).LEVL_CODE.;
WHERE EXT_ENROLL.SEG01.TERM_CODE_KEY EQ &TERM_CODE_KEY.(OR(FIND SUBTERM.SEG01.STVTERM_CODE,SUBTERM.SEG01.STVTERM_DESC IN subterm)).TERM_CODE_KEY.;
WHERE EXT_ENROLL.SEG01.RESD_CODE EQ &RESD_CODE.(OR(FIND STVRESD.STVRESD.STVRESD_CODE,STVRESD.STVRESD.STVRESD_DESC IN stvresd)).RESD_CODE.;
WHERE EXT_ENROLL.SEG01.COLL_CODE EQ &COLL_CODE.(OR(FIND STVCOLL.STVCOLL.STVCOLL_CODE,STVCOLL.STVCOLL.STVCOLL_DESC IN stvcoll)).COLL_CODE.;
WHERE ( EXT_ENROLL.SEG01.MAJR_DESC1 EQ &MAJR_DESC1.(OR(FIND EXT_CURR_MAJOR.SEG01.MAJOR,EXT_CURR_MAJOR.SEG01.MAJOR IN ext_curr_major)).Major. ) OR ( EXT_ENROLL.SEG01.MAJR_DESC2 EQ &MAJR_DESC1.(OR(FIND STVMAJR.STVMAJR.STVMAJR_DESC,STVMAJR.STVMAJR.STVMAJR_DESC IN stvmajr)).MAJR_DESC1. );
WHERE (ATTR_STUACC EQ &STUDENT_ATTRIBUTE) OR
(ATTR_STUDL EQ &STUDENT_ATTRIBUTE) OR
(ATTR_STUEWC EQ &STUDENT_ATTRIBUTE) OR
(ATTR_STUGEN EQ &STUDENT_ATTRIBUTE) OR
(ATTR_STUHON EQ &STUDENT_ATTRIBUTE) OR
(ATTR_STUREN EQ &STUDENT_ATTRIBUTE) OR
(ATTR_STUGS EQ &STUDENT_ATTRIBUTE) OR
(ATTR_STURNBS EQ &STUDENT_ATTRIBUTE);
WHERE J6.SEG01.ALL_RACES CONTAINS &ALL_RACES.(OR(FIND GORRACE.GORRACE.GORRACE_DESC,GORRACE.GORRACE.GORRACE_DESC IN gorrace)).ALL_RACES.;
WHERE EXT_ENROLL.SEG01.STYP_DESC EQ &STYP_DESC.(OR(FIND STVSTYP.STVSTYP.STVSTYP_DESC,STVSTYP.STVSTYP.STVSTYP_DESC IN stvstyp)).STYP_DESC.;
WHERE EXT_ENROLL.SEG01.CLAS_DESC EQ &CLAS_DESC.(OR(FIND STVCLAS.STVCLAS.STVCLAS_DESC,STVCLAS.STVCLAS.STVCLAS_DESC IN stvclas)).CLAS_DESC.;
WHERE EXT_ENROLL.SEG01.GENDER EQ &GENDER.(OR(,,)).GENDER.;
WHERE J0.SEG01.SPRADDR_STAT_CODE EQ &SPRADDR_STAT_CODE.(OR(FIND STVSTAT.STVSTAT.STVSTAT_CODE,STVSTAT.STVSTAT.STVSTAT_DESC IN stvstat)).SPRADDR_STAT_CODE.;
WHERE EXT_ENROLL.SEG01.DEGC_CODE EQ &DEGC_CODE.(OR(FIND STVDEGC.STVDEGC.STVDEGC_CODE,STVDEGC.STVDEGC.STVDEGC_DESC IN stvdegc)).DEGC_CODE.;


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
December 19, 2014, 08:32 AM
Geoff Fish
so Danny this is where I am headed

WHERE EXT_ENROLL.SEG01.ETHN_CODE EQ ÐN_CODE.(OR(FIND STVETHN.STVETHN.STVETHN_CODE,STVETHN.STVETHN.STVETHN_DESC IN stvethn)).ETHN_CODE.;
-IF ÐN_CODE ' ' GOTO EARLY1;
-SET ÐN = Ethnicity:;
-EARLY1
ON TABLE SUBHEAD
" ÐN ÐN_CODE "

WHERE EXT_ENROLL.SEG01.LEVL_CODE EQ &LEVL_CODE.(OR(FIND STVLEVL.STVLEVL.STVLEVL_CODE,STVLEVL.STVLEVL.STVLEVL_DESC IN stvlevl)).LEVL_CODE.;

-IF &LEVL_CODE ' ' GOTO EARLY2;
-SET &LEVEL = Level:;
-EARLY2
ON TABLE SUBHEAD
" &LEVEL &LEVL_CODE "


WHERE EXT_ENROLL.SEG01.TERM_CODE_KEY EQ &TERM_CODE_KEY.(OR(FIND SUBTERM.SEG01.STVTERM_CODE,SUBTERM.SEG01.STVTERM_DESC IN subterm)).TERM_CODE_KEY.;

-IF &TERM_CODE_KEY. ' ' GOTO EARLY3;
-SET &TERM = Term:;
-EARLY3
ON TABLE SUBHEAD
" &TERM &TERM_CODE_KEY. "

thanks for pointing me in the right direction


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
December 19, 2014, 08:35 AM
Geoff Fish
for some reason & ETHN_CODE with no space between & and E

converted to
ÐN_CODE
when posting


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
December 19, 2014, 02:04 PM
j.gross
It's treating &ETH as equivalent to the entity Ð.

Use [ code ] tags to avoid that.

This message has been edited. Last edited by: j.gross,
January 07, 2015, 10:02 AM
Geoff Fish
quote:
Originally posted by j.gross:
It's treating &ETH as equivalent to the entity Ð.

Use [ code ] tags to avoid that.


this seems to work but now I cannot open the report painter to format

What is it about

-IF &LEVL_CODE ' ' GOTO EARLY2;
-SET &LEVEL = Level:;
-EARLY2
ON TABLE SUBHEAD
" &LEVEL &LEVL_CODE "

that keeps the Report painter from opening??


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 07, 2015, 10:05 AM
Francis Mariani
-IF &LEVL_CODE ' ' GOTO EARLY2;

I see something wrong in the syntax of this line...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 07, 2015, 10:12 AM
Geoff Fish
quote:
Originally posted by Francis Mariani:
-IF &LEVL_CODE ' ' GOTO EARLY2;

I see something wrong in the syntax of this line...



I thought there might be somnething that would actually process but not quite be "Legal" so to speak but i am stuck as to what would be correct. the report will runa as is but my experience tells me something is not quite right when the report painter will not open.

Got any hints?


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 07, 2015, 10:17 AM
Geoff Fish
quote:
Originally posted by Francis Mariani:
-IF &LEVL_CODE ' ' GOTO EARLY2;

I see something wrong in the syntax of this line...



I tried

-IF &LEVL_CODE EQ ' ' GOTO EARLY1;
-IF &LEVL_CODE EQ ' ' THEN GOTO EARLY1;

Neither seems effective


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 07, 2015, 10:19 AM
Geoff Fish
quote:
Originally posted by Geoff Fish:
quote:
Originally posted by Francis Mariani:
-IF &LEVL_CODE ' ' GOTO EARLY2;

I see something wrong in the syntax of this line...



I tried

-IF &LEVL_CODE EQ ' ' GOTO EARLY2;
-IF &LEVL_CODE EQ ' ' THEN GOTO EARLY2;

Neither seems effective



809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 07, 2015, 10:30 AM
Francis Mariani
I don't think Report Painter can handle Dialogue Manager commands within TABLE FILE ... END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 07, 2015, 10:40 AM
Geoff Fish
quote:
Originally posted by Francis Mariani:
I don't think Report Painter can handle Dialogue Manager commands within TABLE FILE ... END



Hmmmm so maybe I'm back to square one


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 07, 2015, 10:56 AM
Tony A
quote:
Dialogue Manager commands within TABLE FILE ... END

Which is why Susannah's post contained so much more than the question of where the values are coming from.

Using DM outside of the TABLE FILE ... END to set a variable to a comment or space can achieve so much.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
January 07, 2015, 11:01 AM
Francis Mariani
I don't know if Report Painter has this functionality, but you may be able to use a WHEN phrase.

quote:
Syntax: How to Specify a Heading or Footing With a WHEN Clause
{HEADING [CENTER]|FOOTING}
"text_and_data1"
.
.
.
"text_and_datan"
WHEN expression
where:

text_and_data1, text_and_datan
Is the text and data for each heading or footing line.

expression
Is an expression that resolves to TRUE or FALSE (1 or 0). If its value resolves to TRUE, the heading or footing is displayed. If the expression resolves to FALSE, the heading or footing is not displayed.




Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 07, 2015, 01:18 PM
Geoff Fish
quote:
Originally posted by susannah:
What are your default values for these 30 variables?
Am i correct in assuming you don't want to see a blank line when one of the &vars is empty, you want to bypass that line?
Am i correct in assuming you want 1 subhead line per &var ?
Yes those assumptions are correct
this should give you some ideas.
you'll note i have a chronic aversion to FOC_NONE

-SET &ECHO = ALL ;
-DEFAULT &myvar1 = 'W GERMANY';
-DEFAULT &myvar2 = 'ALL';
-DEFAULT &myvar3 = 'ALL';
-*
-SET &cmt_myvar1 = IF &myvar1.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;
-SET &cmt_myvar2 = IF &myvar2.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;
-SET &cmt_myvar3 = IF &myvar3.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;
-*
-SET &filter_myvar1 = IF &myvar1.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF COUNTRY EQ '''| &myvar1 | '''' ;  
-TYPE &filter_myvar1
-SET &filter_myvar2 = IF &myvar2.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF CAR EQ '''| &myvar2  | '''' ;
-SET &filter_myvar3 = IF &myvar3.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF MODEL LIKE '| &myvar3 |'%' ;
-*
TABLE FILE IBISAMP/CAR
&filter_myvar1
&filter_myvar2
&filter_myvar3
SUM DCOST
BY COUNTRY BY CAR BY MODEL
ON COUNTRY SUBHEAD
" "
&cmt_myvar1.EVAL "MYVAR1 = &myvar1"
&cmt_myvar2.EVAL "MYVAR2 = &myvar2"
&cmt_myvar3.EVAL "MYVAR3 = &myvar3"
END



809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 07, 2015, 01:23 PM
Geoff Fish
Am going to try susannahs suggestion its really only 13 variables not 30 although more may be added as this develops


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 07, 2015, 04:26 PM
Geoff Fish
this is making me nuts

this works
-SET &ECHO = ALL ;
-DEFAULT &myvar1 = 'W GERMANY';

-SET &cmt_myvar1 = IF &myvar1.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;

-SET &filter_myvar1 = IF &myvar1.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF COUNTRY EQ '''| &myvar1 | '''' ;

TABLE FILE IBISAMP/CAR
&filter_myvar1

PRINT DCOST

ON TABLE SUBHEAD
" "
&cmt_myvar1.EVAL "COUNTRY = &myvar1"

END

and this does not

-SET &ECHO = ALL ;
-DEFAULT ÐN_DESC = '';

-SET &cmt_ETHN_DESC = IF ÐN_DESC.QUOTEDSTRING EQ 'ALL' THEN '-*' ELSE '' ;

-SET &filter_ETHN_DESC = IF ÐN_DESC.QUOTEDSTRING EQ 'ALL' THEN '' ELSE 'IF ETHN_DESC EQ '''| ÐN_DESC| '''' ;


TABLE FILE AS_STUDENT_ENROLLMENT_SUMMARY
PRINT
AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.ID
ON TABLE SUBHEAD
&cmt_ETHN_DESC.EVAL "ETHNICITY = ÐN_DESC"
WHERE AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.ETHN_DESC EQ ÐN_DESC.(OR(FIND STVETHN.STVETHN.STVETHN_DESC,STVETHN.STVETHN.STVETHN_DESC IN stvethn)).ETHN_DESC.;
WHERE AS_STUDENT_ENROLLMENT_SUMMARY.AS_STUDENT_ENROLLMENT_SUMMARY.TERM_CODE_KEY EQ '201420';
WHERE RECORDLIMIT EQ 50
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML

END
any help would be appreciated and i thank the ones who responded earlier, to recap i want to dsplay a parameter and its title if I select one or not display the parmater or title if i do not. the exampek, provided by susannah works but, I have not been able to tranlsate it to work with my table


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 08, 2015, 01:14 PM
Geoff Fish
So i am still tring to solve this riddle thought the Car file might make my issues easier to understand.

I am trying to figure out a way to dynamically control the printing of a parameter title so that if No selection is made on a Multi Or neither the parameter or its title displays. The example below still prints Country: and Car: even when I run without any selection. In my ideal scenario nether the parameter values selected or the title would print.

I posted on forum but did not get a response that I could use with a multi select or.


I tried both .EVAL and .EXIST

help if you can please


-SET &ECHO = ALL ;
-SET &COUNTRYNM = IF &COUNTRY.EXIST THEN 'COUNTRY:' ELSE ' ';
-SET &CARNM = IF &CAR.EXIST THEN CAR: ELSE ' ';
TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
CAR.COMP.CAR
CAR.BODY.DEALER_COST
HEADING
-IF &COUNTRY.EXIST THEN GOTO PARM1 ELSE GOTO EXIT1;
-PARM1
"&COUNTRYNM &COUNTRY "
-EXIT1
-IF &CAR.EXIST GOTO PARM2 ELSE GOTO EXIT2;
-PARM2
"&CARNM &CAR "
-EXIT2
WHERE ( CAR.ORIGIN.COUNTRY EQ &COUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY,CAR.ORIGIN.COUNTRY IN car)).COUNTRY. ) AND ( CAR.COMP.CAR EQ &CAR.(OR(FIND CAR.COMP.CAR,CAR.COMP.CAR IN car)).CAR. );
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=TABHEADING,
LINE=1,
JUSTIFY=LEFT,
$
TYPE=TABHEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
STYLE=NORMAL,
$
ENDSTYLE
END


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 08, 2015, 01:41 PM
susannah
first, not a good idea to use .EXIST in an IF test; there's a much better way...but that's later.
for now....
-DEFAULT &MYCOUNTRY = 'FOC_NONE';
-DEFAULT &MYCAR = 'FOC_NONE';
then
HEADING
"COUNTRY &MYCOUNTRY "
"CAR &MCAR"
"OTHER STUFF"

and lo and behold if you have FOC_NONE as the 'value', the heading line just doesn't show up at all!
so much for my chronic aversion to FOC_NONE

...
now , the .EXIST stuff
-GOTO someplace&MYVAR.EXIST ;
-someplace0
-TYPE it doesnt exist
-GOTO someplacex ;
-somemplace1
-TYPE Oh yes it does
-someplacex

since you don't test against variable existing, you don't screw up its value. sounds odd, but trust me.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 08, 2015, 02:55 PM
Geoff Fish
quote:
Originally posted by susannah:
first, not a good idea to use .EXIST in an IF test; there's a much better way...but that's later.
for now....
-DEFAULT &MYCOUNTRY = 'FOC_NONE';
-DEFAULT &MYCAR = 'FOC_NONE';
then
HEADING
"COUNTRY &MYCOUNTRY "
"CAR &MCAR"
"OTHER STUFF"

and lo and behold if you have FOC_NONE as the 'value', the heading line just doesn't show up at all!
so much for my chronic aversion to FOC_NONE

...
now , the .EXIST stuff
-GOTO someplace&MYVAR.EXIST ;
-someplace0
-TYPE it doesnt exist
-GOTO someplacex ;
-somemplace1
-TYPE Oh yes it does
-someplacex

since you don't test against variable existing, you don't screw up its value. sounds odd, but trust me.


Thanks and I do trust you unfortunately it doesn't work.

See code as is below

-SET &ECHO = ALL ;
-DEFAULT &MYCOUNTRY = 'FOC_NONE';
-DEFAULT &MYCAR = 'FOC_NONE';
TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
CAR.COMP.CAR
CAR.BODY.DEALER_COST
HEADING
"COUNTRY &MYCOUNTRY "
"CAR &MYCAR "
"OTHER STUFF"
WHERE ( CAR.ORIGIN.COUNTRY EQ &MYCOUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY,CAR.ORIGIN.COUNTRY IN car)).COUNTRY. );
WHERE ( CAR.COMP.CAR EQ &MYCAR.(OR(FIND CAR.COMP.CAR,CAR.COMP.CAR IN car)).CAR. );
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML

END
i need to use the dynamic population of the of the parameters for this purpose. Its not necessary for the CAR file but it is for the one i am working on it appears that it is still generating a _FOC_NULL see below

-DEFAULT &MYCOUNTRY = 'FOC_NONE';
-DEFAULT &MYCAR = 'FOC_NONE';
TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
CAR.COMP.CAR
CAR.BODY.DEALER_COST
HEADING
"COUNTRY _FOC_NULL "
"CAR "
"OTHER STUFF"
WHERE ( CAR.ORIGIN.COUNTRY EQ _FOC_NULL );
WHERE ( CAR.COMP.CAR EQ );
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END
0 ERROR AT OR NEAR LINE 14 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC260) AN OPERATION IS MISSING AN ARGUMENT
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND

This message has been edited. Last edited by: Geoff Fish,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 09, 2015, 12:41 PM
George Patton
This seems to be getting unnecessarily complicated - unless I misunderstand the question (wouldn't be the first time .. )

The problem appears to be that 'Country: ' or 'Car: 'appears even when there is no selection. But it seems to me that you don't need to test separately for the inclusion of these words. You test for the value of CAR, so you should be able to use the result from there to decide whether or not to print the word Car:

-SET &ITSACAR = IF &CAR NE '' THEN 'Car: ' | &CAR ELSE '';

HEADING
" &ITSACAR "

I haven't tested this and you may need fiddle with: EQ FOC_NONE THEN instead of the NE '' but by using concatenation of the title plus the variable you should be able to eliminate the former when the latter is mising.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
January 12, 2015, 08:12 AM
Geoff Fish
quote:
Originally posted by George Patton:
This seems to be getting unnecessarily complicated - unless I misunderstand the question (wouldn't be the first time .. )

The problem appears to be that 'Country: ' or 'Car: 'appears even when there is no selection. But it seems to me that you don't need to test separately for the inclusion of these words. You test for the value of CAR, so you should be able to use the result from there to decide whether or not to print the word Car:

-SET &ITSACAR = IF &CAR NE '' THEN 'Car: ' | &CAR ELSE '';

HEADING
" &ITSACAR "

I haven't tested this and you may need fiddle with: EQ FOC_NONE THEN instead of the NE '' but by using concatenation of the title plus the variable you should be able to eliminate the former when the latter is mising.


GP Thanks I will give that a try this morning

GF


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
January 12, 2015, 01:25 PM
Geoff Fish
the solution is RESOLVED


-SET &ECHO = ALL ;

-DEFAULT &CAR= 'FOC_NONE';
-SET &CAR_NODISPLAY=IF &CAR EQ 'FOC_NONE' OR '_FOC_NULL' THEN 'FOC_NONE' ELSE ' ';


TABLE FILE CAR
PRINT
CAR.BODY.DEALER_COST
BY LOWEST CAR.COMP.CAR
BY LOWEST CAR.CARREC.MODEL

ON TABLE SUBHEAD
""
"Car; <+0>&CAR &CAR_NODISPLAY"

WHERE CAR.COMP.CAR EQ &CAR.(OR(FIND CAR.COMP.CAR,CAR.COMP.CAR IN car)).CAR.;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML