Focal Point
[Solved] Dynamically Creating Master File from Inputted Excel Filename

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

November 08, 2018, 10:44 AM
mlhapner
[Solved] Dynamically Creating Master File from Inputted Excel Filename
We are trying to report off of Excel/CSV files that users have on their shared network drives. Currently, the html page has a browse file feature that the user can use to navigate to the appropriate Excel/CSV file. The reporting server has access to all of these shared drives. How can we go about creating a master file based on the inputted file name without having to go through the upload file utility in the webconsole? The files will not have a consistent format.

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


WebFOCUS 8.201m
Windows, All Outputs
November 08, 2018, 10:57 AM
BabakNYC
You can use CREATE SYNONYM in a Fex. The syntax can be parameterized. Take a look at this post to see how it's done. http://forums.informationbuild...1057331/m/6537019096


WebFOCUS 8206, Unix, Windows
November 08, 2018, 11:17 AM
mlhapner
I get a syntax error when I try to use "CREATE SYNONYM"??

 CREATE SYNONYM TEST_SYNONYM
FOR &INPUTTED_FILENAME
DBMS DIREXCEL 


(FOC1544) Syntax error: SYNONYM TEST_SYNONYM


WebFOCUS 8.201m
Windows, All Outputs
November 08, 2018, 11:38 AM
BabakNYC
You have to give it more details such as what app directory do you want the synonym to be created in. So fully qualify your TEST_SYNONYM with something like ibisamp/TEST_SYNONYM.

Also, you have to tell it where to look for HEADERS and how many rows to sample.

Finally, you have to add an END to finish the syntax. I have an Excel file called sql_emp.xlsx in my downloads directory and wanted to create synonym for it in ibi\apps\techniques. The first row is the column headers. The sheet that contains the data I'm using is called Report1 in the Excel file. Here's what I did to create the synonym. You'll have to parameterize the values you want to substitute in your case.

 
CREATE SYNONYM techniques/test_xl
   FOR 'C:\Downloads\sql_emp.xlsx'
   DBMS DIREXCEL 
  DROP
   PARMS 'WORKSHEET Report1 HROWS 1 RECORDS 10 DBMS DIREXCEL CHECKNAMES UNIQUENAMES'
END 



WebFOCUS 8206, Unix, Windows
November 08, 2018, 11:50 AM
mlhapner
BabakNYC,

Amazing! I was able to get it to work. I didn't know this capability even existed.

Thanks so much!


WebFOCUS 8.201m
Windows, All Outputs
November 08, 2018, 11:51 AM
BabakNYC
The CREATE SYNONYM syntax is what's generated when you use the GUI for any DBMS/Data.


WebFOCUS 8206, Unix, Windows