Focal Point
write &variables to an EXCEL report

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

January 16, 2007, 11:27 AM
simba
write &variables to an EXCEL report
I have &variables that calculate the number of workdays per month. They are not associated with any table - just purely &variables. Is there anyway I can write the value of these &variables as a line on an EXCEL spreadsheet? Thanks.


WF 7.7/Windows
January 16, 2007, 11:52 AM
FrankDutch
I think there is...
-SET &WORKDAYS=18;
TABLE FILE CAR
COUNT MODEL NOPRINT
BY COUNTRY NOPRINT
HEADING &WORKDAYS
ON TABLE ....EXL2K
END

Or something like that, I do not know the proper coding since I'm not on the office




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 16, 2007, 11:54 AM
FrankDutch
I just wonder why you do this?
I'm not a Microsoft guru, but I'm sure there is a function in Excel that can calculate the workdays too.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 16, 2007, 01:53 PM
simba
There probably is a way to do this in EXCEL. For the record, I could write this whole report in EXCEL easier than it has been doing it in WebFocus. However, I need to perform 2 calculations based on the workday number. Since I've written the rest of the report in WebFocus, I wanted to do this with WebFocus. Thanks.


WF 7.7/Windows
January 16, 2007, 02:53 PM
codermonkey
You want it in a heading or footing? You can simply do the following:

TABLE FILE tablename
HEADING
"Workdays per month: &varname"
PRINT....
END

Is this what you mean?
January 16, 2007, 03:49 PM
simba
I wanted it to be a line in an EXCEL spreadsheet:

Workdays 20 18 22 21 and so on.

The month/year headings are already on the spreadsheet.


WF 7.7/Windows
January 16, 2007, 11:39 PM
Håkan
Simba,

use a DEFINE. Eg.

DEFINE FILE CAR
WORKDAYS/I2 = &WORKDAYS;
END
TABLE FILE CAR
SUM WORKDAYS
ACROSS COUNTRY
ON TABLE PCHOLD FORMAT EXL2K
END

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
January 17, 2007, 03:19 AM
Tony A
... or a COMPUTE

T
January 17, 2007, 10:59 AM
FrankDutch
we have a database with year, month fields for our general ledger.

I created this report what exactly gives you the output as wanted

-DEFAULT &YR=2006;
DEFINE FILE KCM_OAS_PERLIST
BVDM/YYMD=DATEMOV(ENDDATE, 'BOM');
WORKD/I5=DATEDIF(BVDM, ENDDATE, 'BD');
END
TABLE FILE KCM_OAS_PERLIST
SUM
WORKD
BY YR
BY PERIOD AS ''
WHERE ( CMPCODE EQ 'F500' ) AND ( YR EQ &YR ) AND ( PERIOD FROM 1 TO 12 );
ON TABLE HOLD
END
DEFINE FILE HOLD
1M/I3=IF PERIOD EQ 1 THEN WORKD ELSE 0;
2M/I3=IF PERIOD EQ 2 THEN WORKD ELSE 0;
3M/I3=IF PERIOD EQ 3 THEN WORKD ELSE 0;
4M/I3=IF PERIOD EQ 4 THEN WORKD ELSE 0;
5M/I3=IF PERIOD EQ 5 THEN WORKD ELSE 0;
6M/I3=IF PERIOD EQ 6 THEN WORKD ELSE 0;
7M/I3=IF PERIOD EQ 7 THEN WORKD ELSE 0;
8M/I3=IF PERIOD EQ 8 THEN WORKD ELSE 0;
9M/I3=IF PERIOD EQ 9 THEN WORKD ELSE 0;
10M/I3=IF PERIOD EQ 10 THEN WORKD ELSE 0;
11M/I3=IF PERIOD EQ 11 THEN WORKD ELSE 0;
12M/I3=IF PERIOD EQ 12 THEN WORKD ELSE 0;
TEXTLINE/A40='Workingdays for the year ';
END
TABLE FILE HOLD
SUM
1M AS ''
2M AS ''
3M AS ''
4M AS ''
5M AS ''
6M AS ''
7M AS ''
8M AS ''
9M AS ''
10M AS ''
11M AS ''
12M AS ''
BY TEXTLINE AS ''
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
END

You have to create a master with a
yr field (2006)
period (1 to 12)
and than it could work.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 17, 2007, 01:38 PM
simba
Thank you FrankDutch!! I got your solution to work for me.


WF 7.7/Windows