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     [CLOSED] Naming Excel report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Naming Excel report
 Login/Join
 
Silver Member
posted
Hi,

I am looking to name the excel output as DDMONYYYY_Day_Hours_Minutes_Seconds.xls,Any idea on this please.

Thanks

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


WebFOCUS 7.1.4
Windows
Both Excel & HTML
 
Posts: 35 | Registered: July 25, 2009Report This Post
Gold member
posted Hide Post
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.
 
Posts: 88 | Location: MI | Registered: July 23, 2009Report This Post
Virtuoso
posted Hide Post
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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
Thats interesting Darin...I'll remember that.
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Silver Member
posted Hide Post
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
 
Posts: 35 | Registered: July 25, 2009Report This Post
<JG>
posted
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.
 
Report This Post
Silver Member
posted Hide Post
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
 
Posts: 35 | Registered: July 25, 2009Report This Post
Virtuoso
posted Hide Post
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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Gold member
posted Hide Post
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.
 
Posts: 88 | Location: MI | Registered: July 23, 2009Report This Post
Silver Member
posted Hide Post
Rob,

Wow, Great Explanation. Appreciate your help.

Thanks a lot.


WebFOCUS 7.1.4
Windows
Both Excel & HTML
 
Posts: 35 | Registered: July 25, 2009Report This Post
Silver Member
posted Hide Post
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

Thanks

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


WebFOCUS 7.1.4
Windows
Both Excel & HTML
 
Posts: 35 | Registered: July 25, 2009Report This Post
Silver Member
posted Hide Post
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
 
Posts: 41 | Registered: November 26, 2008Report This Post
Silver Member
posted Hide Post
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
 
Posts: 35 | Registered: July 25, 2009Report This Post
<JG>
posted
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.
 
Report 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     [CLOSED] Naming Excel report

Copyright © 1996-2020 Information Builders