I am looking to name the excel output as DDMONYYYY_Day_Hours_Minutes_Seconds.xls,Any idea on this please.
ThanksThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.1.4 Windows Both Excel & HTML
August 03, 2009, 08:56 AM
MathematicalRob
Hello!
I've used an Excel template file with an auto-run macro to do it. You can read about template files here: .
Here is a macro to get you started (the name "Auto_Open" causes it to run automatically when the file is opened):
Private Sub Auto_Open()
Dim strFileName As String
Dim strYear As String
Dim strMonth As String
Dim strDay As String
Dim strSeconds As String
' We only want the macro to do something when the report
' is first opened, and not thereafter. . .
If Left(ActiveWorkbook.Name, 9) = "WFServlet" Then
'Create a default file name
strFileName = "MyReport_"
strYear = Year(Now)
strMonth = (Month(Now))
If Len(strMonth) = 1 Then
strMonth = "0" & strMonth
End If
strDay = Day(Now)
If Len(strDay) = 1 Then
strDay = "0" & strDay
End If
strSeconds = Second(Now)
If Len(strSeconds) = 1 Then
strSeconds = "0" & strSeconds
End If
strFileName = strFileName & strYear & "-" & strMonth & "-" & strDay & "-" & strSeconds & ".xls"
' 1 is the option to save as Excel Workbook
Application.Dialogs(xlDialogSaveAs).Show strFileName, 1
End If
End Sub
Rob
WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
August 03, 2009, 09:25 AM
Danny-SRL
VadivelNagaraj,
-* File VadivelNagaraj1.fex
-SET &DTE=EDIT(&DATEDMYY,'99')| EDIT(&DATEMTYY, '999$$9999');
-SET &DAY=&DATEWT;
-SET &XLS=&DTE | '_' | &DAY | '_' | EDIT(HHMMSS('A8'),'99_$99_$99');
TABLE FILE CAR
SUM SALES BY COUNTRY
ON TABLE HOLD AS &XLS FORMAT EXL2K
END
? FILEDEF
THIS SHOULD DO THE TRICK
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
August 03, 2009, 09:46 AM
Prarie
How about this
-SET &MDYYSS = &MDYY || &TOD; APP HOLD BASEAPP TABLE FILE CAR PRINT SALES BY COUNTRY ON TABLE HOLD FORMAT EXL2K AS &MDYYSS ON TABLE SET STYLE * UNITS=IN, LEFTMARGIN=0.500000, RIGHTMARGIN=0.500000, TOPMARGIN=0.500000, BOTTOMMARGIN=0.500000, SQUEEZE=ON, ORIENTATION=PORTRAIT, TITLETEXT='&MDYYSS',$
ENDSTYLE END
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
August 03, 2009, 11:50 AM
Darin Lee
The ability to customize the name of the output file (as delivered to the browser/excel/Acrobat) is not available until the 7.6 version. The only way around this in the 7.1.4 version is to hold the file locally and then use some other mechanism like FTP for delivery or use ReportCaster.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
August 03, 2009, 02:05 PM
Prarie
Thats interesting Darin...I'll remember that.
August 05, 2009, 02:37 AM
VadivelNagaraj
Hi Darin,
The default excel output filename shows as WFservlet.xls, even if i cannot customize the filename dynamically, will i be able to hardcode the filename in fex file so that it display other than WFservlet.xls when the open/save popup shows.
Thanks
WebFOCUS 7.1.4 Windows Both Excel & HTML
August 05, 2009, 07:19 AM
<JG>
Two options are available in 7.1.x
Either use a macro as suggested or Hold the file to a location on the server that can Be accessed via a URL and present it using -HTMLFORM.
August 05, 2009, 10:29 AM
VadivelNagaraj
Hi Rob,
can you please give more details about the macro, where should the macro code to be copied and how the macro is invoked/called.
Thanks
WebFOCUS 7.1.4 Windows Both Excel & HTML
August 05, 2009, 11:22 AM
Darin Lee
Refer back to the post by Rob and read up on Excel templates. He's given you a lot to get you started.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
August 07, 2009, 11:17 AM
MathematicalRob
VadivelNagaraj,
To create a template file in Excel 2003 (2007 is a little different, but you can figure it out), create a new workbook, and Select Macro > Macros from the Tools menu. Type Auto_Open for the macro name and click Create. Now paste the code I supplied above (don't duplicate the first and last lines!), and edit as necessary.
After editing your macro, save your workbook as a regular Excel file, and then do a Save As to a Single File Web Page (.mht) format.
You can search "EXL2K TEMPLATE" in the WebFocus help, or this forum for information on using template files. See, e.g. .
Rob
WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
August 07, 2009, 11:36 AM
VadivelNagaraj
Rob,
Wow, Great Explanation. Appreciate your help.
Thanks a lot.
WebFOCUS 7.1.4 Windows Both Excel & HTML
August 13, 2009, 08:32 PM
VadivelNagaraj
Hi,
I followed excel macro approach couple of times, but still getting an error mentioned below. Can you please advise on this. Also, can you please share more details on -htmlform approach too.
(FOC3290) EXL2K: Template file is not a valid WebArchive file (FOC009) INCOMPLETE REQUEST STATEMENT BYPASSING TO END OF COMMAND
ThanksThis message has been edited. Last edited by: VadivelNagaraj,
WebFOCUS 7.1.4 Windows Both Excel & HTML
August 14, 2009, 08:49 AM
DW Marker
Do you have the mht file sitting in the same folder as the fex that is looking at it, or in one that is within the path. The mht file is the one that is the template.
WF 7.6.4 Windows XP and UNIX
August 14, 2009, 10:43 AM
VadivelNagaraj
I am using the WebFOCUS Developer Studio tool through Citrix. Under Applications folder of the Unix server, individual folder is created for each project. Under each project folder, 5 folders(HTML Files, Maintain Files, Master Files, Other, & Procedures) are created by default WebFOCUS env team. So, The fex files exists in Procedures folder and mht files are copied to Other folder. Pleae let me know if this is not correct.
Thanks
WebFOCUS 7.1.4 Windows Both Excel & HTML
August 17, 2009, 04:47 AM
<JG>
quote:
(FOC3290) EXL2K: Template file is not a valid WebArchive file
As long as the .mht files are on your APP PATH that should be fine.
The issue looks to be as simple as the .mht file is not valid, which is what the error is telling you.
1. A .mht file MUST contain at least 2 worksheets 2. AND each sheet MUST contain something, even a space in cell A1 of each sheet is enough.