Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to change field values for a report
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] How to change field values for a report
 Login/Join
 
Master
posted
From a launch page the user selects which &RPTYPE (AGEGRP, COVGRP, ZIP) file is to be
used to create a report.

In the ZIP.ftm there is a field named ZIP.
Possible values for Zip are:

Allegany
Anne Arundel N
_Non_Residential
Wicomico
Worcester

In the AGEGRP.ftm there is a field named AGEGRP.
Possible values for AGEGRP are:
0-<1
1-5
6-14
15-18

In the COVGRP.ftm there is a field named COVGRP
Possible values for COVGRP are:
Aged/Disabled
Families and Children (FAC)
Maryland Children's Health Program (MCHP)
Other
PAC

I am trying to write some (Dialogue Manager
or Define) logic to look at which &RPTYPE the
user selects on the launch page.

If the selection is ZIP, I need to be sure that
the value of '_Non-Residential' is displayed as
'Non-Residential' in the report.

Thus far, I've come up with this,

quote:

DEFINE FILE &FNX
RFLAG/A1 = IF ZIP EQ '_Non-Residential' THEN '1' ELSE '0';
SRNAME/A60 = IF RFLAG EQ '1' THEN 'Non-Residential' ELSE ZIP;
END


but it does not consider when the file is not ZIP.

I would appreciate any shove I could get with this.

Any ideas? Confused

Thanks.

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 536 | Location: Baltimore, MD | Registered: July 06, 2006Reply With QuoteReport This Post
Guru
posted Hide Post
More dialog manager:
 
DEFINE FILE &FNX
-IF &RPTYP NE 'ZIP' GOTO :SKIPZIP;
RFLAG/A1 = IF ZIP EQ '_Non-Residential' THEN '1' ELSE '0';
SRNAME/A60 = IF RFLAG EQ '1' THEN 'Non-Residential' ELSE ZIP;
-:SKIPZIP
-IF &RPTYP EQ 'ZIP' GOTO :SKIPTHIS;
... and then code an alternate RFLAG and SRNAME field here for other values of &RPTYP with another statement
-:SKIPTHIS
END
 


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
On first thoughts, perhaps some DM to select the defines lines needed.

DEFINE FILE &FNX
-IF &??? NE 'ZIP' THEN GOTO NO_ZIP ;
RFLAG/A1 = IF ZIP EQ '_Non-Residential' THEN '1' ELSE '0';
SRNAME/A60 = IF RFLAG EQ '1' THEN 'Non-Residential' ELSE ZIP;
-NO_ZIP
-IF &??? NE 'AGEGRP' THEN GOTO NO_AGEGRP ;
....
-NOAGEGRP
-IF &??? NE 'COVGRP' THEN GOTO NO_COVGRP ;
....
-NO_COVGRP 

END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6104 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport This Post
Master
posted Hide Post
Thanks guys, I get the idea. When I have it working, I'll post the solution.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 536 | Location: Baltimore, MD | Registered: July 06, 2006Reply With QuoteReport This Post
Master
posted Hide Post
Thanks N.Selph and Waz for planting the seed.

Here is the code I had in mind to solve my problem

quote:

DEFINE FILE &FNX
-IF &RPTTYPE EQ 'ZIP' GOTO 'XZIP' ELSE 'XALL';
-*
-XZIP
RFLAG/A1 = IF ZIP EQ '_Non-Residential' THEN '1' ELSE '0';
SRNAME/A60 = IF RFLAG EQ '1' THEN 'Non-Residential' ELSE ZIP ;
-GOTO XEND
-*
-XALL
SRNAME/A60 = &RPTTYPE ;
-XEND
END


of course, followed by:

quote:

TABLE FILE &FNX
PRINT
FIELD1
FIELD2
etc.
BY SRNAME
END


Thanks!


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 536 | Location: Baltimore, MD | Registered: July 06, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I don't think Dialogue Manager should be necessary:

DEFINE FILE &FNX
 SRNAME/A60 = IF &RPTTYPE EQ '_Non-Residential' THEN 'Non-Residential' ELSE &RPTTYPE ;
END

EDIT: The above code will cause an error if the maximum length of values in AGEGRP.ftm is less than 16. In that case, I would change the DEFINE to this, which has the added advantage of covering any other values beginning with '_' that might be added in the future:

DEFINE FILE &FNX
 SRNAME/A60 = IF &RPTTYPE LIKE '_%' THEN EDIT(&RPTTYPE,'$9999999999999999999999999999999999999999999999999') ELSE &RPTTYPE ;
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to change field values for a report

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.