Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Saving Excel File to Location with Multiple Worksheets

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Saving Excel File to Location with Multiple Worksheets
 Login/Join
 
Platinum Member
posted
Hello,

I have a FEX with two reports and each report output I'm placing in an Excel file on different worksheets.

I'm using this in the first report to open the Excel file:
ON TABLE PCHOLD FORMAT XLSX OPEN

Then to close that out on the second report i'm using:
ON TABLE PCHOLD FORMAT XLSX CLOSE

Now this works fine and dandy to run it and have the prompt come up to save or open the file, however I need to instead post this file to a location rather than prompt.

Usually when I have a singular worksheet report I use the following to save the file to location:
ON TABLE SAVE FILENAME
'\\filepath\Temp\ReportNAME.._&YYMD...xlsx'
FORMAT XLSX

I have yet to find the solution by research and I'm having trouble figuring out how to combine the PCHOLD way to allow for the multiple worksheets and still save off the file. Anyone have any sugestions or know what I need to do to save off the file to a location when posting to multiple worksheets in this fashion? Or is there a totally different way I should be doing this?

Thanks,
Joe

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


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
 
Posts: 146 | Registered: November 09, 2015Report This Post
Virtuoso
posted Hide Post
You could try FILEDEF to map the hold file name to a physical disk file.

FILEDEF TEST_XLS DISK e:\temp\test_xls.xlsx

TABLE FILE CAR
PRINT CAR BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE HOLD AS TEST_XLS FORMAT XLSX
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
Filedef the file, then, use EDAGET to display to user.
Search on EDAGET


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
We do this all the time using OS copy commands or secure copy. Our .fex look like this:
TABLE FILE ....
ON TABLE PCHOLD FORMAT XLSX OPEN
END
...
TABLE FILE ....
ON TABLE HOLD AS FINAL FORMAT XLSX CLOSE
END
-RUN
-UNIX cp final.xlsx &APPROOT/reports


We like to copy to client server. That way we can put a link on the dashboard (not portal) and users can open the report whenever they want. Reports will generally refresh daily or several time a day. This uses scp (secure copy) and looks like this:
-UNIX scp final.xlsx $WFUSER@$WFCLIENT:$WFAPP/baseapp


$WFUSER is a Linux environment variable that is a user id that access to the client server
$WFCLIENT is a Linux environment variable that is the server name
$WFAPP is a Linux environment variable that contains the path

Also note that the CLOSE uses HOLD not PCHOLD. This write the final file into the working directory, generally edatemp unless you are using APP HOLD to hold files somewhere else.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Platinum Member
posted Hide Post
Hello,

FILEDEF was definitely the way to go. Thanks guys!

Solution Code:

FILEDEF THE_FILE DISK '\\filepath\Temp\ReportNAME.._&YYMD...xlsx'
-RUN

TABLE FILE CAR
...
ON TABLE HOLD AS THE_FILE FORMAT XLSX OPEN
...
END

TABLE FILE CAR
...
ON TABLE HOLD AS THE_FILE FORMAT XLSX CLOSE
...
END

Thanks for the insight!

Joe


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
 
Posts: 146 | Registered: November 09, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Saving Excel File to Location with Multiple Worksheets

Copyright © 1996-2020 Information Builders