We have a question concerning master files with Excel files. We would like to know if it is possible that the same master file could read from different files with a variable that is set in the parameters of the report caster. I will show you with an example.
The idea would be to use it as follows: " SET &file_number = "parameter from report caster";
SET &table_name = EXCEL_FILE || &file_number;
TABLE FILE &table_name PRINT ..... "
Is there a way that we can do this? Or we have to create a separate master for each excel file. They will all contain the same columns with the same format.
Thank you in advance for your help!
Best regards,This message has been edited. Last edited by: Guilaine,
WebFocus V8.2.03M
June 07, 2019, 09:19 AM
FP Mod Chuck
Guilaine
You can definately do this with a parameter in the master file. Here is an example of one.
In schedule in task/parameter : (Name)DATASET1=(Value)'REF_MAKE_PGI00.xlsx'
when I run the schedule report : error message : Schedule ID: Sdf3e863dscd55s4823s8577sc406cd0937d0, Job Description: BOM REF MAKE PGIV2 , Schedule Full Path: IBFS:/WFC/Repository/hswltgqi/std_reports/requatesgo04/BOM_REF_MAKE_PGIV2.sch Completed with errors/warnings (FOC295) A VALUE IS MISSING FOR: &&DATASET1 Task error: IBFSException 6000: Error executing procedure BOM_REF_MAKE_PGIV2.fex No report to distribute.
Thank you in advance
WebFocus V8.2.03M
June 11, 2019, 07:38 AM
MartinY
quote:
Then in the reportcaster job set the value of DATASET1 to the appropriate Excel file.
You need to set the variable as stated by Chuck In your schedule go to Tasks then within a task under Parameters tab add &DATASET1 and its value. Since the variable as been defined as a Global variable in the master file (with two ampersand : &&) you need to enter your variable name as : &DATASET1. The second ampersand is added by the scheduler.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
June 12, 2019, 02:34 AM
Guilaine
Hello,
Thank you for your help. I could not make it work by creating the parameter with the "&" in the schedule like you proposed. It kept saying the following error message: (FOC 295) A VALUE IS MISSING FOR: &DATASET1
I had to create a normal parameter in the schedule and use a set in the code (fex file): -SET &&DATASET1 = &SCH_PARAM;
And then I gave the value REF_MAKE_PGI.xlsx to "SCH_PARAM" in the schedule. Not sure if it is the best way, but it works.
WebFocus V8.2.03M
June 12, 2019, 07:44 AM
MartinY
Honestly, I never define global variable in a schedule (two ampersand). Normally GV are defined in a profile as per example since they are set for the whole system not only for a schedule/fex.
But since this is global variable that is defined in the .mas, the way you made it, is ok
Please update your first post then add [SOLVED] at the beginning of the subject
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007