Focal Point
Creating Report from excel file

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

June 02, 2005, 05:27 PM
<trhogan>
Creating Report from excel file
Hi,

I currently have a requirement for a web focus report that requires an excel file to be its data source. I not sure if this is possible, or if I can use a .csv file instead. I know it requires a file def, but I'm not sure how to create the hold file from that. Can some one help me with this?


Thanks in advance
June 02, 2005, 05:59 PM
Prarie
You do have to use a .CSV file. You master has to have a Suffix of COMT.
June 02, 2005, 06:32 PM
<trhogan>
Hi,

Does these snippet look ok. I think I have to create a hold file then mod the master file after. Am I right on this assumption.

I'm not sure of the steps.

FILEDEF TESTCSV DISK C:\IBI\APPS\SALES_REPORTS_PORT\TESTCSV.csv
TABLE FILE TESTCSV
PRINT *
ON TABLE HOLD AS TESTCSVHOLD
END
TABLE FILE TESTCSVHOLD
PRINT *
END

I get an error from this snippet

(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED

Can you please help

Thanks in advance
Trevor
June 02, 2005, 06:47 PM
Prarie
Try running it without holding it to see if the error is in referece to the .CSV file. Then if that's the case...you have a problem with the Master.
June 02, 2005, 06:53 PM
<trhogan>
I still have the same problem

this is my code

FILEDEF TESTCSV DISK C:\IBI\APPS\SALES_REPORTS_PORT\TESTCSV.csv
TABLE FILE TESTCSV
PRINT *
ON TABLE HOLD
END
TABLE FILE TESTCSV
PRINT *
END

any suggestions
June 02, 2005, 06:57 PM
<trhogan>
During the test I deleted the hold peace of code.
June 02, 2005, 08:47 PM
N.Selph
I am assuming you wrote a master file description for your csv file, and it is in the app path.
June 03, 2005, 06:29 AM
<JG>
If you want to use Excel as a data source then it has to be set up as an Excel or ODBC datasource on the server.
The metadata can then be generated directly from the Excel and it can be reported against just like another datasource.
June 03, 2005, 01:41 PM
<trhogan>
Hi,

How do I create an excel data source? In the adapters section I do not see an excel adapter. Also I created a master file using the master file tool, but I'm its still not working. I'm at a lose on this one, I don't know what to try next. Any help would be appreciated

Thanks
Trevor
June 03, 2005, 02:02 PM
<JG>
1st You must set up the Excel in the ODBC datasources in Windows (the method varies on which version of Microsoft server your using), The Excel file must either reside on the server or be on a mapped drive for the server.

2nd 'VERY IMPORTANT' WebFocus works using named ranges with Excel so you must set a named range in the spread sheet AND the 1st row MUST contain column titles, which will become your field names in WebFocus.

3rd In the WebFocus Administrator console select ODBC as your data source and follow the instructions.

4th Look at the master produced and adjust the lengths of the fields as required. (WebFocus has a habit of taking A256 for alpha along with a few other quirks)
June 03, 2005, 02:38 PM
<trhogan>
Hey,

Thanks you very much, that worked like a charm, excellent.

Just one more question, If I want to read a csv file, is there anyway to do it from webfocus using filedef's and hold files?

Thanks again for all your help
June 03, 2005, 02:55 PM
<JG>
Problem with a CSV file is that Excel (and most programs including WebFocus) do not terminate the row with a �,$�
That means that WebFocus cannot treat it as a comma delimited file which it can read very easily.
If you can force �,$� onto the end of the row, then WebFocus can use it.
The alternative is that it must be a fixed length file that a WebFocus master can map with.
Or if you use the COM format then you need to add SET PCOMMA=ON before your table request