Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Can I launch an .xls which WF did not create?
Go
New
Search
Notify
Tools
Reply
  
Can I launch an .xls which WF did not create?
 Login/Join
 
Member
posted
I would like to run a WebFOCUS program to create an excel file which will be used as a data source to a complicated pivot table in an existing spreadsheet. I would then like to immediately launch the complicated spreadsheet. The idea here is to do this with just one click.

Is this even possible? Any ideas?

Thanks,
Jim
 
Posts: 7 | Registered: April 23, 2003Reply With QuoteReport This Post
<Grzegorz>
posted
Jim,

Yes, it is possible, but not effortless.

Below are some ideas I used. If the ideas are appropriate for you - depends on the detailed requirements.
1. Embedded WF report with Excel Web Query. Described in the "Creating Reports ..." manual, chapter 8 (v 5.2).
2. Excel macro for dynamically fill the spreadsheet with data using Web query (e.g. embedding HOLD'ed HTMTABLE created with WebFOCUS)


' The syntax:
'...
urlpath = "URL;" & "The rest of the path"
Sheet.Activate
With Sheet.QueryTables.Add(Connection:=urlpath, Destination:=Sheet.Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
' To remove Query Table, retaining the data:
.Delete
End With
' ...

3. Windows script to run Excel "background process":


// JScript file to run with Windows Script Host.
// D:\ibi\apps\excelrun\runExcel.js
var objXL = new ActiveXObject("Excel.Application");
objXL.visible = false;
objXL.Workbooks.Open(WScript.arguments(0));

5. Skeleton of the Excel VBA macro, which opens the particular workbook, processes it, saves, and quits:

Sub processWorkbook()
' Initializatione, etc.
' ...
' Open the sophisticated spreadsheet template:
thePath = "D:\ibi\apps\tmplt\complicated.xls"
Set theWork = Workbooks.Open(thePath)
' Process theWork, filling it with WF data
' ...
' Save the result as the file visible on web server:
destPath = "Z:\path_to_webserver_directory\output.xls"
theWork.SaveAs(destPath)
theWork.Close
End Sub
'...
Private Sub Workbook_Open()
Application.DisplayAlerts = False
Call processWorkbook
Application.Quit
End Sub
6. The focexec skeleton:
[
-* Read and process report parameters, perform queries, process data, HOLD results etc., etc.:
-* ...
-* Invoke the script which creates the Excel output, using macros, templates, HOLD'ed tables, etc., etc.:
! D:\ibi\apps\excelrun\runExcel.js &WHICH_MACRO
...
-* Pass the resulting Excel to the client browser:
-HTMLFORM BEGIN


<script type="text/javascript">
function passXLS() {
window.location = "http:/webserver/the_path/output.xls";
}




-HTMLFORM END
These are just some of the "puzzle pieces". There is some additional work to do if you would like to create flexible, robust, and secure solution, but I think, that using Excel macros, Windows scripts, JavaScript and WebFOCUS you can achieve your goal, even if it is very sophisticated and specific.

Hope this helps
Grzegorz

This message has been edited. Last edited by: <Mabel>,
 
Reply With QuoteReport This Post
Member
posted Hide Post
Excellent. I'll give it a try! Thanks.
 
Posts: 7 | Registered: April 23, 2003Reply With QuoteReport This Post
<Pietro De Santis>
posted
You could try this:




[/code]

This message has been edited. Last edited by: <Mabel>,
 
Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Can I launch an .xls which WF did not create?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.