Focal Point
(Closed) Master File for Excel input

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

August 08, 2019, 12:54 PM
jgelona
(Closed) Master File for Excel input
I'm working on a project that will use an Excel file with multiple sheets. All the sheets have the same format (they contain data by quarter). In the .acx file for the workbook, there is a parameter that tells the master what sheet in the workbook to read (WORKSHEET=FY19-1stQuarter). This workbook will generally contain 2 sheets but could have as many as 8. I don't want to manually update the acx file(s) every time the job runs or have a different master for each sheet. Is it possible to define a global variable to hold the sheet name? I've tried this:
This is in the master:

FILENAME=TANF_BILLING, SUFFIX=DIREXCEL,$
VARIABLE NAME=SHEETNAME, USAGE=A64, DEFAULT=Sheet1,$

This in in the acx file:

SEGNAME=SHEETDATA, WORKSHEET='&&SHEETNAME', HROWS=1, $

This is the test fex:

-SET &&EXCELFILE='fy19_tanfcw_billing_by_quarter_update.xlsx';
-SET &&SHEETNAME='FY19-2ndQuarterSoleSource';
FILEDEF TANF_BILLING DISK tanf/&&EXCELFILE
TABLEF FILE TANF_BILLING
PRINT *
ON TABLE HOLD
END

If I run this I get the following:

(FOC31041) DIREXCEL CRSYN TANF_BILLING: 1
(FOC1006) FILE IS NOT ALLOCATED OR FAILED TO OPEN  : TANF_BILLING


When I have WORKSHEET=FY19-2ndQuarterSoleSource in the acx file it works fine. Is it not possible to use an global variable with the WORKSHEET parameter? BTW, this parameter is not mentioned in the 8206 Describing Data manual.

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


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
August 08, 2019, 01:32 PM
MartinY
If the parameter cannot be used, maybe not the best option, but you can define as many mas/acx as you have Excel/Sheets.
Then, since you already have a parameter to tell you which sheet to use, call the proper mas/acx accordingly

-SET &EXCELFILE= DECODE &SheetToUse (1 'TANF_BILLING_S1'
-                                    2 'TANF_BILLING_S2'
-                                    3 'TANF_BILLING_S3'
-                                 ELSE 'TANF_BILLING_S4');

TABLEF FILE &EXCELFILE
PRINT *
ON TABLE HOLD
END



WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
August 08, 2019, 01:40 PM
FP Mod Chuck
jgelona

I used the DATASET attribute in the master file and hard coded the excel spreadsheet name and then I was able to use the &&WORKSHEET in the .acx file.


DATASET=wfretail82/sales_demo.xlsx, DV_INCLUDE=NO, $


If I tried to use a global variable for the DATASET name it failed with the same error as you. That may be a bug...


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
August 08, 2019, 01:54 PM
jgelona
Thanks Chuck but that did not working for me. We are still on 8008 which could be part of my issue (we can't get to 8206 because we are having Tomcat compatibility issues with our environment). Too bad -SET &ECHO=ALL; doesn't show master/acx parsing.

Martin, I'm trying to avoid having multiple masters that describe identical data.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.