You can display a WebFOCUS report as one of several kinds of Microsoft Excel spreadsheets. The report opens in Excel within a Web browser.
You can display a report as an:
In addition, WebFOCUS supports two Excel 2000 variations: EXL2K FORMULA and EXL2K PIVOT. When either of these formats is specified additional processing is done.
You can specify that a report display as an Excel spreadsheet when you run the report in WebFOCUS. You can use either:
You can also view Excel reports outside of the browser in a standalone Excel application window. Under Windows, you must uncheck the Browse in same window option for the .xls file type. When the Browse in same window option is unchecked for the .xls file type, the browser window created by WebFOCUS is blank because the report output is displayed in the standalone Excel application window.
Certain EXL2K format reports, such as Pivot Tables, generate multiple output files. The main document is returned to the browser (which opens it in Excel), and the secondary file (such as the pivot cache file in a Pivot Table report) is linked through a URL in the main file, to be retrieved by an HTTP request that Excel makes to the WebFOCUS servlet. When used with HOLD instead of PCHOLD, the output is a single web archive file with the same .xht suffix as a normal EXL2K HOLD file. In Excel, this file format is designated in the Save dialog as Single File Web Page.
Note: WEBARCHIVE=ON uses a file format that packages all of the documents into a single file.
For additional information about redirection settings for EXCEL formats with SET WEBARCHIVE=ON, see Microsoft Excel Report Output Considerations in the WebFOCUS Security and Administration Manual.
Reference: |
The command ON TABLE PCHOLD FORMAT EXL2K generates a fully styled Excel report in your browser, with conditional styling and drill-down capability.
The EXL2K (Excel 2000) format is a full StyleSheet driver that renders all report elements (for example, headings and subtotals) as well as StyleSheet syntax (such as, conditional styling and drill-downs). If your Excel report contains a drill-down to a procedure and uses the TOC feature, see Drilling Down to a Procedure in Excel 2000 With a Table of Contents.
EXL2K format accurately displays formatted dates and numeric values and controls column width and wrapping in Excel 2000. See Displaying Formatted Numeric Values in Excel 2000 and Controlling Column Width and Wrapping in Excel 2000.
In addition, the format variation EXL2K FORMULA enables you to convert summed information (such as column totals, row totals, subtotals) and calculated values to interactive formulas in an Excel 2000 spreadsheet. See Generating Native Excel Formulas in Excel 2000. Another format variation, EXL2K PIVOT, enables you to analyze different views of your data. See Using PivotTables in Excel 2000.
EXL2K is supported only in Excel 2000 or higher. It does not work with any previous releases of Excel. You can invoke format EXL2K reports using any browser supported by WebFOCUS. WebFOCUS can also run directly from Excel without using a browser by creating a hyperlink within Excel that calls the WebFOCUS client with the necessary parameters. For details, see Embedding a WebFOCUS Report in an Excel 2000 Spreadsheet.
By default, when you choose EXL2K as your display format, the report opens in an Excel 2000 worksheet, identified in a tab at the bottom of the spreadsheet as Sheet 1, Sheet2, and so on. You can change the name of a Sheet tab to make it more descriptive of your report's content. For an illustration, see Creating an Excel 2000 Report in Internet Explorer.
Tip: If an Excel report is launched within a frame, the Excel toolbar options are not available. To retain access to the toolbar when working with frames, launch the report outside of the frameset, in a new window. For details on using target frames, see Linking a Report to Other Resources.
The following example illustrates how to create a report in EXL2K (Excel 2000) format with a styled heading, conditional styling on SALES, and drill-downs on COUNTRY:
TABLE FILE CAR HEADING "SALES BY COUNTRY" SUM SALES BY COUNTRY BY CAR BY MODEL WHERE (COUNTRY EQ 'ENGLAND') OR (COUNTRY EQ 'ITALY') OR (COUNTRY EQ 'FRANCE'); ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, FONT=ARIAL, TITLETEXT=SALES REPORT, $ TYPE=DATA, COLUMN=COUNTRY, FOCEXEC=DRILLFEX (PARAM1=COUNTRY PARAM2=CAR),$ TYPE=DATA, COLUMN=SALES, COLOR=RED, BACKCOLOR=YELLOW, WHEN=SALES GT 10000,$ TYPE=DATA, COLUMN=MODEL, BACKCOLOR=YELLOW, WHEN=SALES GT 10000,$ TYPE=HEADING, FONT=ARIAL BLACK, COLOR=RED, BACKCOLOR=SILVER, SIZE=16, $ TYPE=TITLE, FONT=ARIAL, SIZE=12, $ ENDSTYLE END
The output is:
Notice that the tab name has been changed from the Excel default, Sheet1, to a more descriptive name, which is specified in the TITLETEXT attribute of the StyleSheet. For details on the TITLETEXT attribute see Using Headings, Footings, Titles, and Labels.
How to: |
If an EXL2K (Excel 2000) report utilizes the Table of Contents feature and contains a drill-down to a procedure, the drill-down must reference an absolute URL. Excel incorrectly evaluates relative URL strings when drilling down to a procedure. EXL2K reports with drill-downs to absolute URLs are properly executed.
To drill down to a procedure in Excel 2000, perform the following procedure which enables WebFOCUS to generate only absolute URLs. This procedure is necessary for Excel 2000 and prior versions only. If your WebFOCUS environment uses Proxy servers, you may not be able to implement this procedure.
For WebFOCUS:
install_drive or directory\ibi\webfocus77\wfc\etc\default.wfs
For Developer Studio:
install_drive or directory\ibi\DevStudio77\srv77\wfs\etc\default.wfs
\n-SET
&&FOCEXURL='&CGI_PROG?IBIF_webapp=&IBIF_webapp' | '&&'; <\\=>
Change it to:
\n-SET &&FOCEXURL='http://ip_address/ibi_apps/WFServlet?IBIF_webapp=
&IBIF_webapp' | '&&'; <\\=>
where:
Is the IP address of your Web Server.
FOCEXURL=&CGI_PROG?IBIF_webapp=&IBIF_webapp&&IBIC_server=&_EDA_NODE&&
Change it to:
FOCEXURL=http://ip_address/ibi_apps/WFServlet?IBIF_webapp=
&IBIF_webapp&&IBIC_server=&_EDA_NODE&&
where:
Is the IP address of your Web Server.
How to: |
When an Excel 2000 report is run, and null values are retrieved for one or more fields, blank spaces are displayed by default in each cell of the report output for the empty (null) fields. This behavior is the result of SET EMPTYCELLS ON being set by default in the background of all Excel 2000 reports. If you want to identify null values with something other than blank spaces, a character string can be used to populate all empty fields in a report.
To identify null values in Excel 2000, use
ON TABLE SET NODATA character_string ON TABLE SET EMPTYCELLS [ON|OFF]
where:
Is the string of characters displayed in the cells of the report for each field where null values are retrieved from the database. The maximum number of characters is 11. If the number of characters in the string exceeds the length of the output field, the additional characters will not be displayed. If special characters are used, the string must be enclosed in single quotes. SET EMPTYCELLS OFF must also be specified to make the SET NODATA command effective.
Indicates that empty spaces are displayed in the cells of the report for each field where null values are retrieved from the database. ON is the default.
Indicates that zeros, or the character string specified with the SET NODATA command, will be displayed in the cells of the report for each field where null values are retrieved from the database. OFF must be specified when using SET NODATA.
The following syntax utilizes the default behavior of ON TABLE SET EMPTYCELLS ON, which is set in the background:
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE PCHOLD FORMAT EXL2K END
The following output displays empty spaces in the cells of the report for each field where null values are retrieved from the database:
The following syntax utilizes the SET NODATA command:
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE SET NODATA 'n/a' ON TABLE SET EMPTYCELLS OFF ON TABLE PCHOLD FORMAT EXL2K END
Note: If you do not add SET EMPTYCELLS OFF, the SET NODATA command will be ignored.
The following output displays 'n/a' in the cells of the report for each field where null values are retrieved from the database:
The following syntax turns off the default SET EMPTYCELLS behavior and does not use SET NODATA, which makes it impossible to distinguish null values from zero quantities:
TABLE FILE CAR SUM SALES BY COUNTRY ACROSS SEATS ON TABLE SET EMPTYCELLS OFF ON TABLE PCHOLD FORMAT EXL2K END
The following output displays zeros in the cells of the report for each field where either null values are retrieved from the database or the quantity is zero:
Reference: |
Excel 2000 spreadsheets generated by WebFOCUS contain the numeric formatting specified in the Master File for the data source or in a temporary field. WebFOCUS numeric values (such as currency) are translated to supported Excel formats and display properly in Excel 2000.
When translating numeric formats from WebFOCUS to Excel, there must be a corresponding Excel format to translate to. If there is no corresponding format, then the value will be formatted in the closest matching Excel format or in Excel General format. For details, see Usage Notes for Numeric Formats.
The following example illustrates how formatted numeric data displays in a spreadsheet when using the EXL2K format. Note that the format for the Fund Balance field (D16.2M—which represents floating point double-precision with two decimal places and a floating dollar sign) is translated to the corresponding Excel format.
DEFINE FILE SHORT NEWBLNC/D16.2M = BALANCE; END SET PAGE-NUM=OFF
TABLE FILE SHORT "Short Term Investments" "Excel 2000 Spreadsheet" " " SUM NEWBLNC AS 'Fund Balance' BY MANAGER_ID AS 'Fund Manager' BY TYPE BY HOLDER ON TABLE SET BYDISPLAY ON ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, FONT=TAHOMA, $ TYPE=HEADING, SIZE=14, COLOR=NAVY, $ TYPE=HEADING, LINE=2, SIZE=12, COLOR=RED, $ TYPE=TITLE, JUSTIFY=CENTER, STYLE=BOLD, $ TYPE=DATA, JUSTIFY=CENTER, $ TYPE=DATA, COLUMN=NEWBLNC, JUSTIFY=RIGHT, $ END
The output is:
Notice that the values of the sort fields are repeated in the output; this presentation, which is particularly desirable in a spreadsheet, is controlled by the command ON TABLE SET BYDISPLAY ON. For details, see Sorting Tabular Reports.
The following formats are not supported in EXL2K. They will translate into Excel General format and possibly produce unpredictable results:
The following applies to headings and footings with embedded numeric fields:
Excel 2000 spreadsheets generated by WebFOCUS contain the numeric formatting specified in the Master File for the data source or in a temporary field. WebFOCUS date formats (such as Smart Dates) are translated to supported Excel formats and display properly in Excel 2000.
When translating date formats from WebFOCUS to Excel, there must be a corresponding Excel format to translate to. If there is no corresponding format, then the value will be formatted in the closest matching Excel format or in Excel General format. For details, see Usage Notes for Date Formats.
By default, when WebFOCUS creates dates in Excel 2000 (EXL2K) format, the date formats that contain translated values such as month or day name are sent as formatted text, preserving the style defined for the report field. Numeric dates are passed to Excel 2000 as standard date values, not as text. For information about passing translated date formats to Excel 2000 as date values with format masks, see Passing Dates With Translated Text to Excel 2000.
The following example illustrates how customized dates display in a spreadsheet when using the EXL2K format.
SET PAGE-NUM=OFF DEFINE FILE EMPLOYEE YRHIRED/YY = HIRE_DATE; MHIRED/MtYY = HIRE_DATE; TOTSVC/I4C = 2002 - YRHIRED; END
TABLE FILE EMPLOYEE "Employee Service Report for 2002" "Excel 2000 Spreadsheet" " " PRINT FIRST_NAME AS 'First Name' MHIRED AS 'Month Hired' TOTSVC AS 'Years of Service' BY LAST_NAME AS 'Last Name' ON TABLE SET BYDISPLAY ON ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, FONT=TAHOMA, $ TYPE=HEADING, SIZE=14, COLOR=NAVY, $ TYPE=HEADING, LINE=2, SIZE=12, COLOR=RED, $ TYPE=TITLE, JUSTIFY=CENTER, STYLE=BOLD, $ TYPE=DATA, JUSTIFY=CENTER, $ TYPE=DATA, COLUMN=TOTSVC, COLOR=BLUE, WHEN=TOTSVC GT 20, $ END
The output is:
The command ON TABLE SET BYDISPLAY ON ensures that sort fields are repeated in each spreadsheet cell. For details, see Sorting Tabular Reports.
The following formats are not supported in EXL2K. They will translate into Excel General format and possibly produce unpredictable results:
In order to use a "-" as a separator between month, day, and year in Excel, you must change the default date separator for Windows. This setting can be located under Regional Options in the Control Panel.
Some translated dates can be sent to Excel 2000 as standard date values with format masks, enabling Excel to use them in functions, formulas, and sort sequences. The SET EXL2KTXTDATE command allows you to specify that translated dates should be sent as date values with format masks instead of text values.
SET EXL2KTXTDATE = {TEXT|VALUE}
where:
Passes date values that contain text to Excel 2000 as formatted text. TEXT is the default value.
Passes the types of translated date values that contain text and are supported Excel date formats to Excel 2000 as standard date values with text format masks applied.
The following request against the GGSALES data source creates the date January 1, 2010 and converts it to four date formats with translated text:
SET EXL2KTXTDATE=TEXT DEFINE FILE GGSALES NEWDATE/MDYY = '01/01/2010'; WRMtrDY/WRMtrDY = NEWDATE; wDMTY/wDMTY= NEWDATE; wrDMTRY/wrDMTRY= NEWDATE; wrYMtrD/wrYMtrD= NEWDATE; END TABLE FILE GGSALES SUM DATE NOPRINT NEWDATE WRMtrDY wDMTY wrDMTRY wrYMtrD ON TABLE PCHOLD FORMAT EXL2K END
The following table shows how the dates should appear with EXL2KTXTDATE set to TEXT and to VALUE.
WebFOCUS Format | SET EXL2KTXTDATE=TEXT | SET EXL2KTXTDATE=VALUE | ||
---|---|---|---|---|
EXL2K Displays: | EXL2K Value: | EXL2K Displays: | EXL2K Value: | |
WRMtrDY | FRIDAY, January 1 10 | FRIDAY, January 1 10 | Friday, January 1 10 | 1/1/2010 |
wDMTY | Fri, 1 JAN 10 | Fri, 1 JAN 10 | Fri, 1 Jan 10 | 1/1/2010 |
wrDMTRY | Friday, 1 JANUARY 10 | Friday, 1 JANUARY 10 | Friday, 1 January 1 | 1/1/2010 |
wrYMtrD | Friday, 10 January 1 | Friday, 10 JANUARY 1 | Friday, 10 January 1 | 1/1/2010 |
With SET EXL2KTXTDATE=TEXT, in Excel 2000 all the cells with month or day translation are sent as text, and all month and day names are in the case specified by the WebFOCUS format. The output is:
With SET EXL2KTXTDATE=VALUE, in Excel 2000 all of the cells have a date value with format masks, and all month and day names are in mixed-case, regardless of how the case has been specified in the WebFOCUS format. The output is:
Date formats that do not specify the day value explicitly are defined as the date value of the first day of the month. Therefore, the value placed in the cell may be different from the day component value in the source data field and may produce unexpected results when used for sorting or date calculations in an Excel formula.
The following table shows how WebFOCUS date formats are represented in EXL2K. The table shows how the value is preserved in the cell and how the display is generated using the format mask that corresponds to the WebFOCUS date format.
DATEFLD/MDYY = '01/02/2010'
WebFOCUS Format | SET EXL2KTXTDATE=TEXT | SET EXL2KTXTDATE=VALUE | ||
---|---|---|---|---|
EXL2K Displays: | EXL2K Value: | EXL2K Displays: | EXL2K Value: | |
DMYY | 02/01/2010 | ½/2010 | 02/01/2010 | ½/2010 |
MY | 01/10 | 1/1/2010 | 01/10 | 1/1/2010 |
MTY | JAN, 10 | JAN, 10 | Jan, 10 | 1/1/2010 |
MTDY | JAN 2, 10 | JAN 2, 10 | Jan 2, 10 | ½/2010 |
The following request against the GGSALES data source creates the date January 2, 2010 and passes it to Excel 2000 with formats MDYY, DMYY, MY, and MTDY:
SET EXL2KTXTDATE=TEXT DEFINE FILE GGSALES NEWDATE/MDYY = '01/02/2010'; END TABLE FILE GGSALES SUM DATE NOPRINT NEWDATE AS 'MDYY' NEWDATE/DMYY AS 'DMYY' NEWDATE/MY AS 'MY' NEWDATE/MTY AS 'MTY' NEWDATE/MTDY AS 'MTDY' ON TABLE PCHOLD FORMAT EXL2K END
With EXL2KTXTDATE=TEXT, columns D and E have a text values, not date values. The values are displayed in uppercase as specified by the WebFOCUS formats (MTY and MTDY):
With EXL2KTXTDATE=VALUE, columns D and E have actual date values with format masks, displayed by Excel 2000 in mixed-case. Since the MTY format does not have a day component, the date value stored is the first of January 2010 (1/1/2010), not the second of January 2010 (½/2010):
Dates formatted as individual components (for example, D, Y, M, W) are passed to Excel as numeric values that can be used as parameters to Excel date functions. The values are passed as general text format that are recognized by Excel as numbers. These values are passed to Excel in the same format regardless of the setting for EXL2KTXTDATE.
The following request against the GGSALES data source creates the date January 1, 2010 and extracts numeric date components, passing them to Excel 2000:
SET EXL2KTXTDATE=VALUE DEFINE FILE GGSALES NEWDATE/MDYY = '01/01/2010'; D/D= NEWDATE; Y/Y = NEWDATE; W/W=NEWDATE; w/w=NEWDATE; M/M = NEWDATE; YY/YY = NEWDATE; END TABLE FILE GGSALES SUM DATE NOPRINT NEWDATE D Y W w M YY ON TABLE PCHOLD FORMAT EXL2K END
With SET EXL2KTXTDATE=VALUE, the output is:
Date formats that contain a Quarter component are always passed to Excel as text strings since Excel does not support Quarter formats.
The following request against the GGSALES data source creates the date January 1, 2010 and converts it to date formats that contain a Quarter component:
SET EXL2KTXTDATE=VALUE DEFINE FILE GGSALES NEWDATE/MDYY = '01/01/2010'; Q/Q= NEWDATE; QY/QY = NEWDATE; YBQ/YBQ=NEWDATE; END TABLE FILE GGSALES SUM DATE NOPRINT NEWDATE Q QY YBQ ON TABLE PCHOLD FORMAT EXL2K END
Even with SET EXL2KTXTDATE=VALUE, in Excel 2000, the cells containing dates with Quarter components have General format. To see this, open the Format Cells dialog box.
The output is:
Date formats that do not contain sufficient information to present the valid date result in Excel are not translated to a value, including formats that do not contain year and/or month information. These dates will continue to be sent to Excel as text regardless of the SET EXL2KTXTDATE setting. In the absence of complete information, the year defaults to the current year, so the value sent would be incorrect if this type of format was passed as a date value. The following formats will not be sent as values:
Note that since these values are always sent as text, the casing defined in the WebFOCUS format is applied in the resulting cell.
The following request against the GGSALES data source creates the date January 1, 2010 and converts it to date formats that are defined as either month name or day name:
SET EXL2KTXTDATE=VALUE DEFINE FILE GGSALES NEWDATE/MDYY = '01/01/2010'; MT/MT= NEWDATE; MTR/MTR= NEWDATE; Mtr/Mtr = NEWDATE; WR/WR = NEWDATE; wr/wr = NEWDATE; END TABLE FILE GGSALES SUM DATE NOPRINT NEWDATE MT MTR Mtr WR wr ON TABLE PCHOLD FORMAT EXL2K END
In Excel 2000, the cells containing the days have General format. To see this, open the Format Cells dialog box.
The output is:
How to: |
Data wrapping, column width, and the scroll area can be controlled in an Excel 2000 spreadsheet when using FORMAT EXL2K. You can:
For details on WRAP and SQUEEZE syntax, see Formatting Report Data.
TYPE=REPORT, [COLUMN=column,] WRAP=value, $
where:
Designates a particular column to apply wrapping behavior to. If COLUMN is not included in the declaration, wrapping will be applied to the entire report.
Is one of the following:
Turns on data wrapping. ON is the default value. With this setting, the column width is determined by the client (Excel). Data wraps if it exceeds the width of the column and the row's height expands to meet the new height of the wrapped data.
Turns off data wrapping. This setting adjusts the column width of the largest data value in the column. Data will not wrap in any cell in the column.
Represents a specific numeric value that the column width can be set to. The value represents the measure specified with the UNITS parameter (the default is inches).
This setting implies ON. However, the column width is set to the specified width unless the data is wider than the column width, in which case, wrapping will occur as for ON.
TYPE=REPORT, [COLUMN=column,] SQUEEZE={ON|OFF|n}, $
where:
Identifies a particular column. If COLUMN is not included in the declaration, default SQUEEZE behavior is applied to the entire report.
Represents a specific numeric value that the column width can be set to. The value represents the measure specified with the UNITS parameter (the default is inches).
This is the most commonly used SQUEEZE setting in an Excel 2000 report.
Note:
The following example illustrates how to turn on and turn off data wrapping in a column and how to set the column width for a particular column. The UNITS in this example are set to inches (the default).
DEFINE FILE CAR MYDATE/MDY='10/22/60'; RCD/D14.3=RETAIL_COST; VERYLONG/A80='Subtract dealer cost from retail cost to calculate profit.'; END
TABLE FILE CAR PRINT MYDATE RCD VERYLONG AS 'Default' VERYLONG AS 'WRAP=OFF' VERYLONG AS 'WRAP=4.1' VERYLONG AS 'WRAP=2' VERYLONG AS 'SQUEEZE=2' SALES BY COUNTRY ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=DATA, COLUMN=MYDATE, JUSTIFY=CENTER, $ 1. TYPE=REPORT, COLUMN=VERYLONG(2), WRAP=OFF, $ 2. TYPE=REPORT, COLUMN=VERYLONG(3), WRAP=4.1, $ 3. TYPE=REPORT, COLUMN=VERYLONG(4), WRAP=2, $ 4. TYPE=REPORT, COLUMN=VERYLONG(5), SQUEEZE=2, $ END
where:
Note: The column titled "Default" illustrates the default column width and wrapping behavior.
Since the output is wider than this page, it is shown in two sections. The following output displays the "Default", "WRAP=OFF", and "WRAP=4.1" columns:
The following output displays the "WRAP=2", and "SQUEEZE=2" columns:
How to: |
Using StyleSheet attributes, you can lock Excel spreadsheet values so they are read-only. These attributes apply to all Excel formats including EXL2K, EXL2K PIVOT, and EXL2K FORMULA.
To enable locking, use the following attributes:
TYPE=REPORT, PROTECTED={ON|OFF}, [LOCKED={ON|OFF}],$
where:
Is necessary to enable spreadsheet locking. PROTECTED=OFF is the default. If you omit the LOCKED=OFF attribute, the entire spreadsheet is locked.
Locks the entire spreadsheet. ON is the default value.
Unlocks the spreadsheet as a whole, but enables you to lock or unlock specific cells or groups of cells.
Once you include the following declaration in your StyleSheet, you can specify the LOCKED attribute for specific cells or groups of cells:
TYPE=REPORT, PROTECTED=ON, LOCKED=OFF,$
To lock specific parts of the spreadsheet, add the LOCKED=ON attribute to the StyleSheet declaration for the cells you want to lock.
TYPE=type, [ COLUMN=columnspec ] ,LOCKED={ON|OFF},$
where:
Is the type of element that describes the cells to be locked.
Is a valid column specification.
The following request locks the entire spreadsheet because the StyleSheet declarations include the following declaration:
TYPE=REPORT, PROTECTED=ON, $
The request is:
TABLE FILE CAR HEADING "Profit By Car " " " SUM RETAIL_COST AND DEALER_COST AND COMPUTE PROFIT/D12.2 = RETAIL_COST - DEALER_COST; BY CAR ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD AS EXLFORM1 FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, COLOR=BLUE, BACKCOLOR=SILVER, SIZE=9,$ TYPE=REPORT, PROTECTED=ON, $ TYPE=HEADING, STYLE=BOLD, SIZE=14, $ TYPE=TITLE, STYLE=BOLD, SIZE=11,$ ENDSTYLE END
You cannot edit any value on the spreadsheet. Any attempt to do so displays a message that the sheet is protected:
The following request locks the second column (RETAIL_COST) because the StyleSheet declarations include the following declarations
TYPE=REPORT, PROTECTED=ON, LOCKED=OFF, $ TYPE=DATA, COLUMN=2, LOCKED=ON,$
The request is:
TABLE FILE CAR HEADING "Profit By Car " " " SUM RETAIL_COST AND DEALER_COST AND COMPUTE PROFIT/D12.2 = RETAIL_COST - DEALER_COST; BY CAR ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD AS EXLFORM2 FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, COLOR=BLUE, BACKCOLOR=SILVER, SIZE=9,$ TYPE=REPORT, PROTECTED=ON, LOCKED=OFF,$ TYPE=HEADING, STYLE=BOLD, SIZE=14, $ TYPE=TITLE, STYLE=BOLD, SIZE=11,$ TYPE=DATA, COLUMN=2, LOCKED=ON,$ ENDSTYLE END
You cannot edit any value in column 2, although you can edit values in other columns. Any attempt to edit a value in column 2 displays a message that the cells are protected:
How to: Reference: |
When you display or save a tabular report request using EXL2K FORMULA, the resulting spreadsheet contains an Excel formula that computes and displays the results of any type of summed information (such as column totals, row totals, subtotals, and calculated values), rather than static numbers. Spreadsheets saved using the EXL2K FORMULA format are interactive, allowing for "what if" scenarios that immediately reflect any additions or modifications made to the data.
The EXL2K FORMULA format is supported for the WebFOCUS TABLE commands: ROW-TOTAL, COLUMN-TOTAL, SUB-TOTAL, SUBTOTAL, SUMMARIZE, RECOMPUTE, and COMPUTE, and for calculations performed by functions. See Translation Support for FORMAT EXL2K FORMULA.
EXL2K FORMULA is not supported with PivotTables (EXL2K PIVOT), with Excel 97 (EXL97), or with financial reports created with the Financial Report Painter or the underlying Financial Modeling Language (FML).
Add the following syntax to your request to take advantage of Excel formulas in your spreadsheet:
ON TABLE {PCHOLD|HOLD} FORMAT EXL2K FORMULA
where:
Displays the output in an Excel 2000 spreadsheet.
Saves the output for reuse in an Excel 2000 spreadsheet. For details, see Saving and Reusing Your Report Output.
The following example illustrates how a column total in a report request is translated to an Excel formula when you use the format EXL2K FORMULA. Notice that the formatting of the column total (TYPE=GRANDTOTAL) is retained in the Excel 2000 spreadsheet.
When you select the total in the report, the equation =SUM(B4:B10) displays in the formula bar, representing the column total as a sum of cell ranges.
TABLE FILE SHORT HEADING "Projected Return By Region" " " SUM PROJECTED_RETURN AS 'RETURN' BY REGION AS 'REGION' ON TABLE COLUMN-TOTAL ON TABLE SET STYLE * TYPE=REPORT, COLOR=BLUE, BACKCOLOR=SILVER, SIZE=9,$ TYPE=HEADING, STYLE=BOLD, SIZE=14, $ TYPE=TITLE, STYLE=BOLD+UNDERLINE, SIZE=10,$ TYPE=GRANDTOTAL, STYLE=BOLD, $ ENDSTYLE ON TABLE PCHOLD FORMAT EXL2K FORMULA END
The output is:
You can translate any total (subtotal, row total, or column total) to an Excel formula. For related information, see Translation Support for FORMAT EXL2K FORMULA.
This request calculates totals for returns and balances across continents. The row totals are represented as sums of cell ranges.
TABLE FILE SHORT HEADING "Projected Return Across Continent" " " SUM PROJECTED_RETURN AS 'RETURN' AND BALANCE AS 'BALANCE' ACROSS CONTINENT AS 'CONTINENT' BY REGION AS 'REGION' ON CONTINENT ROW-TOTAL AS 'TOTAL' ON TABLE COLUMN-TOTAL AS 'TOTAL' ON TABLE SET STYLE * TYPE=REPORT, COLOR=BLUE, BACKCOLOR=SILVER, SIZE=9,$ TYPE=HEADING, STYLE=BOLD, SIZE=14, $ TYPE=TITLE, STYLE=BOLD, SIZE=11,$ TYPE=SUBTOTAL,STYLE=BOLD, $ TYPE=GRANDTOTAL,STYLE=BOLD,SIZE=11,$ TYPE=ACROSSTITLE,STYLE=BOLD,SIZE=11,JUSTIFY=LEFT,$ TYPE=ACROSSVALUE,STYLE=BOLD,SIZE=10,JUSTIFY=CENTER,$ ENDSTYLE ON TABLE PCHOLD FORMAT EXL2K FORMULA END
The following output highlights the formula that calculates the row total in cell I12=C12+E12+G12:
This request totals the columns for retail cost and dealer cost and calculates the value of a field called PROFIT by subtracting the dealer cost from the retail cost.
The formula for the calculated values is generated by translating the internal form of the WebFOCUS expression (COMPUTE PROFIT/D12.2 = RC - DC;) into an Excel formula. In this example, the formulas appear in cells B14, C14, and D14.
TABLE FILE CAR ON TABLE SET PAGE-NUM OFF SUM RC AND DC AND COMPUTE PROFIT/D12.2 = RC - DC; BY CAR HEADING "Profit By Car" " " ON TABLE COLUMN-TOTAL ON TABLE SET STYLE * TYPE=REPORT, COLOR=BLUE, BACKCOLOR=SILVER, SIZE=9,$ TYPE=HEADING, STYLE=BOLD, SIZE=14, $ TYPE=TITLE, STYLE=BOLD, SIZE=11,$ TYPE=GRANDTOTAL, STYLE=BOLD, SIZE=11,$ ENDSTYLE ON TABLE PCHOLD FORMAT EXL2K FORMULA END
The following output highlights the formula that calculates for the column total of PROFIT: D14=SUM(D4:D13).
The following illustrates how functions are translated to Excel 2000 reports. The function DMOD divides ACCTNUMBER by 1000 and returns the remainder to LAST3_ACCT. The Excel formula corresponds to this, =TRUNC((MOD($C3,(1000)))).
TABLE FILE EMPLOYEE PRINT ACCTNUMBER AS 'Account Number' AND COMPUTE LAST3_ACCT/I3L = DMOD(ACCTNUMBER, 1000, LAST3_ACCT); BY LAST_NAME AS 'Last Name' BY FIRST_NAME AS 'First Name' WHERE (ACCTNUMBER NE 000000000) AND (DEPARTMENT EQ 'MIS'); ON TABLE PCHOLD FORMAT EXL2K FORMULA ON TABLE SET STYLE * TYPE=TITLE, SIZE=12, STYLE=BOLD, $ END
The output is:
The IS-PRESENT, IS-MISSING, CONTAINS, and OMITS operators are not supported. In addition the logical operators (AND, OR) are not supported within IF/THEN/ELSE statements.
ABS, ARGLEN, ATODBL, BYTVAL, CHARGET, CTRAN, CTRFLD, DECODE DMOD, DOWK, DOWKI, DOWKL, DOWKLI, EDIT (1 argument variant only), EXP, EXPN, FMOD, HEXBYT, HHMMSS, IMOD, INT, LCWORD, LJUST, LOCASE, LOG, MAX, MIN, OVRLAY, POSIT, RDUNIF, RANDOM, RJUST, SQRT, SUBSTR, TODAY, TODAYI, UPCASE, YM. The EDIT function is not supported for editing strings.
If you use the COMPUTE command with an unsupported function, an error message is displayed.
How to: Reference: |
The power of EXL2K format derives in large measure from its ability to take advantage of PivotTables. The PivotTable is a tool used in Microsoft Excel to analyze complex data much like the OLAP tool in WebFOCUS. It allows you to drag and drop data fields within a PivotTable, providing different views of the data, such as sorting across rows or columns. You can also create dimensional hierarchies, similar to those created using WITHIN syntax, by using the PAGEFIELDS command. For information about WITHIN syntax, see the Describing Data With WebFOCUS Language manual.
Report requests can be created in WebFOCUS and sent as output to a fully formatted Excel PivotTable. The ON TABLE PCHOLD FORMAT EXL2K PIVOT command will generate an Excel PivotTable in your browser.
When FORMAT EXL2K PIVOT is enabled, two data streams are created:
The PivotTable file (.xht) is an HTML file with embedded XML. The HTML file contains all the information that is displayed in your browser.
The PivotTable cache file is a metadata type of file. It contains all the fields specified in the procedure and links internally to the PivotTable file. The PivotTable cache file can contain data fields called CACHEFIELDS, which populate the PivotTable toolbar, but do not initially display in the report. CACHEFIELDS can be dragged and dropped from the PivotTable toolbar into the PivotTable when required for analysis. Note that when the WEBARCHIVE parameter is set to ON (the default), both data streams are packaged into one output file.
For details on the WEBARCHIVE parameter, see the Developing Reporting Applications manual.
The PivotTable toolbar may not automatically display when a PivotTable is created. To display the PivotTable toolbar, use the following procedure:
Excel displays the PivotTable toolbar, listing the fields available to be dragged into the body of the PivotTable report. A cell within the PivotTable must be selected for the Pivot toolbar to display all fields.
The PivotTable is generated by the PRINT command in combination with the BY, ACROSS, PAGEFIELDS and CACHEFIELDS phrases. It contains all options used to design and format the report, as well as fields specified in the PIVOT request. Fields can be dragged into the report from the toolbar. The following graphic depicts PivotTable output with the major elements identified.
The following summary table shows PivotTable elements and the associated FOCUS syntax.
PivotTable Element |
Contains... |
Function |
Generating Syntax |
---|---|---|---|
Page field |
Field that controls view of the entire page (worksheet). |
A filtering mechanism to conduct a high level sort. |
PAGEFIELDS phrase |
Page field item |
The value for a page field item displays in a drop-down list. |
Selecting a page field item summarizes data for the entire report. |
PAGEFIELDS phrase |
Data field |
Numeric data that is available to be summarized. |
Holds data available to be summarized. |
PRINT command |
Column field |
Horizontal sort data. |
Sorts data horizontally. |
ACROSS command |
Row field |
Vertical sort data. |
Sorts data vertically. |
BY command |
The following table summarizes TABLE syntax elements that are supported in EXL2K PIVOT. The effect of each command on your PivotTable request is listed, along with required usage.
Syntax Element |
Usage |
Effect on PivotTable |
---|---|---|
|
Required. |
Designates the data field in a PivotTable. |
BY |
Optional. * |
Designates row field in a PivotTable. |
ACROSS |
Optional. * |
Designates a column field in a PivotTable. |
CACHEFIELDS |
Optional. * |
Places fields in the Pivot cache file and makes them available from the Pivot toolbar. |
PAGEFIELDS |
Optional. * |
Designates a Page field in a PivotTable. |
* You need at least one sort field or a PAGEFIELD for a valid Pivot Table.
How to: Reference: |
The standard HOLD and SAVE syntax for storing the output file on disk is supported for the EXL2K PIVOT file format. When FORMAT EXL2K PIVOT is enabled, two files are created, the PivotTable file (.xht) and a PivotTable cache file (.xml). The PivotTable cache file contains all the fields specified in the procedure and links internally to the PivotTable file. All available fields can be viewed in the PivotTable toolbar.
You can include the CACHEFIELDS phrase in a request to add fields to the pivot cache that are not initially displayed in the report. The cache file enables you to add available fields from the PivotTable toolbar into the body of the PivotTable by dragging and dropping. You can remove fields from the PivotTable by dragging and dropping them anywhere outside the report. Using these tools, you can quickly vary data views.
The following are syntax variations that you can use to enable FORMAT EXL2K PIVOT.
ON TABLE PCHOLD FORMAT EXL2K PIVOT
ON TABLE HOLD FORMAT EXL2K PIVOT AS mypivot
where:
Is a name you assign to the HOLD file.
Two files are generated with this syntax:
You should consider the following when writing requests for output to a PivotTable:
Note that the SUM and COUNT commands are not supported for EXL2K PIVOT. Nevertheless, you can use this native Pivot Table behavior in Excel after the data has been output to an Excel PivotTable.
The following example illustrates how to generate a PivotTable:
TABLE FILE CAR
HEADING
"CAR File PivotTable"
"Sum of Sales by Car Across Model"
PRINT SALES
BY CAR
ACROSS MODEL
ON TABLE COLUMN-TOTAL
ON TABLE SET STYLE *
TYPE=HEADING, LINE=1, FONT='ARIAL', COLOR=PURPLE, SIZE=16, STYLE=BOLD,$
TYPE=HEADING, LINE=2, FONT='ARIAL', COLOR=PURPLE, SIZE=12, STYLE=BOLD,$
TYPE=DATA, FONT='ARIAL', COLOR=PURPLE,$
TYPE=GRANDTOTAL, FONT='ARIAL', COLOR=PURPLE, SIZE=16, STYLE=BOLD,$
ENDSTYLE
ON TABLE PCHOLD AS CARPIVOT FORMAT EXL2K PIVOT
PAGEFIELDS COUNTRY
CACHEFIELDS RETAIL_COST TYPE
END
The command ON TABLE PCHOLD FORMAT EXL2K PIVOT displays the PivotTable in Excel 2000. All fields (including PRINT, BY, and ACROSS fields, and PAGEFIELDS and CACHEFIELDS) appear in the toolbar.
Reference: |
You can specify multiple fields as CACHEFIELDS. These fields will not initially display in the report, but will be available in the pivot cache file if you wish to include them in the report at a later time.
You can then drag these fields in and out of the PivotTable as desired. CACHEFIELDS is an optional phrase; you can generate a PivotTable without a CACHEFIELD.
Fields designated as CACHEFIELDS must be placed immediately after the PIVOT keyword in the ON TABLE PCHOLD FORMAT EXL2K PIVOT syntax or after a PAGEFIELDS phrase. A field specified as a CACHEFIELD cannot be designated anywhere else in the request. A list of CACHEFIELDS is terminated by the same keywords that terminate a normal report request, such as END or another ON phrase.
The following example illustrates how to specify CACHEFIELDS to populate the PivotTable toolbar.
TABLE FILE CAR
HEADING
"My PivotTable"
PRINT SALES
BY COUNTRY BY CAR
ON COUNTRY SUB-TOTAL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=COUNTRY, COLOR=RED, $
type=heading,color=blue,style=bold, size=14, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K PIVOT
CACHEFIELDS MODEL TYPE
END
The output is:
You can specify a field in the procedure as an Excel 2000 page field. The page field filters the data for the specified field. Then, using PivotTable functionality, you can choose a single value from the page field drop-down menu (also called a page field item) and immediately see only the data associated with that selection. For example, in a report that shows international sales data for cars, if you specify COUNTRY as your page field and select JAPAN as your page field item, you will see only sales data for TOYOTA or NISSAN. If you then select ENGLAND, you will see the data for JAGUAR and TRIUMPH.
A page field can act as the sort field. A valid PivotTable can be generated without specifying a PAGEFIELD if sorting is handled by either a BY or ACROSS phrase. However, if the PivotTable request contains neither a BY or ACROSS phrase, a PAGEFIELD phrase must be included.
Note:
This example illustrates the use of PAGEFIELDS syntax to make three fields available in the PivotTable toolbar.
TABLE FILE CAR
HEADING
"My Pivot Table"
PRINT SALES RETAIL_COST
ON TABLE SET STYLE *
type=data, column=country, color=red, $
type=heading, color=blue, style=bold, size=14,$
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K PIVOT
PAGEFIELDS COUNTRY CAR MODEL
CACHEFIELDS TYPE
END
This output is:
How to: Reference: |
Excel templates enable users to create WebFOCUS reports with any new or existing Excel spreadsheet residing on the WebFOCUS Reporting Server. WebFOCUS can integrate with complex Excel workbooks containing macros, graphs, or Visual Basic applications with the use of Excel templates. Users also have access to more advanced Excel functionality including filters, subtotals, page and print settings, and advanced report styling.
To use an Excel template, open a new or existing Excel workbook and designate one worksheet to be replaced with a WebFOCUS report. The worksheet being replaced must be visible (not hidden). Each worksheet in the workbook must not be empty (populated with at least one blank in one cell). A workbook utilizing Excel templates must be saved as a Single File Web Page (Web Archive) with an extension of .mht and stored in EDAPATH or APP PATH.
After saving, if you do not see the .mht file extension for the Excel template file you created, uncheck the Hide extensions for known file types option in Windows Folder Options View tab dialog:
EXL2K and EXL2K FORMULA are the only formats supported and Excel templates will only work with Excel 2002 and higher versions.
The following are not supported with Excel templates: EXL2K PIVOT, EXL2K BYTOC reports, EXL97, EXCEL, and compound Excel reports.
With EXL2K TEMPLATE format, WEBARCHIVE is automatically on.
The PCHOLD command returns an .xmh file, which the mid-tier converts to an .mht. HOLD creates an .xht file.
To create an Excel template, specify the following:
ON TABLE PCHOLD FORMAT EXL2K TEMPLATE template_name SHEETNUMBER #
where:
The name of the Excel template file (workbook) residing on the WebFOCUS Reporting Server.
The number of the Excel worksheet being replaced in the template file (workbook).
How to: Reference: |
An Excel Named Range is a name assigned to a specific group of cells within an Excel worksheet that can be easily referenced by WebFOCUS applications. WebFOCUS StyleSheet language facilitates the generation of Named Ranges.
The use of Excel Named Ranges provides many benefits, including the following:
To create Excel Named Ranges, use
TYPE=type, IN-RANGES=rangename, $
where:
Identifies the WebFOCUS report component to be included in the range. Normally, both of the following are used together:
DATA adds the DATA element of the report to the named range (excludes heading, footing, and column titles).
TITLE adds the TITLE element of the report to the named range (includes all column titles).
Note: Multiple elements can be added to the same named range.
Is the name assigned to the output in the Excel workbook your application is creating, and is also the name that will be referenced by other WebFOCUS applications.
This example creates one report in one worksheet of an Excel workbook. The code specific to Excel Named Ranges appears in bold in the following syntax.
TABLE FILE GGSALES
PRINT
PRODUCT
DATE
UNITS
BY REGION
BY DOLLARS
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT, $
TYPE=REPORT, FONT='ARIAL', SIZE=9, COLOR='BLACK', BACKCOLOR='NONE',
STYLE=NORMAL, $
TYPE=DATA, IN-RANGES='RegionalSales', $
TYPE=TITLE, STYLE=BOLD, IN-RANGES='RegionalSales', $
ENDSTYLE
END
The Excel output is:
The name assigned to this Excel Named Range is RegionalSales. If additional rows of data are added, or columns of data are inserted, the named range will stretch to contain both new and existing data.
Excel Named Ranges are supported for the following Excel formats:
EXL2K, EXL2K FORMULA, EXL2 TEMPLATE
Excel Named Ranges are not supported for the following Excel formats:
EXL2K BYTOC, EXCEL PIVOT
Excel Named Ranges are not supported with any report syntax that produces discontinuous data or uses columnar references that span multiple columns, which includes the following:
ACROSSCOLUMN, RECAP, RECOMPUTE, SUBHEAD, SUBFOOT, SUBTOTAL, SUB-TOTAL,
How to: Reference: |
Excel Table of Contents (TOC) enables you to generate a multiple worksheet report in which a separate worksheet is generated for each value of the first BY field in the FOCUS report.
Note: This feature can be used only with EXCEL 2002 or higher releases because it requires the Web Archive file format, which was not available in Excel 2000 and earlier releases.
The syntax is identical to that of HTML TOC reports, except that only a single BY field is allowed in EXL2K, while multiple BY fields are allowed in HTML.
ON TABLE {HOLD|PCHOLD} FORMAT EXL2K BYTOC
Since only one level of TOC is allowed for EXL2K reports, the optional number following the BYTOC keyword can only be 1.
As with HTML, the SET COMPOUND syntax, which precedes the TABLE command, may also be used to specify that a TOC be created:
SET COMPOUND=BYTOC
Since a TOC report is burst into worksheets according to the value of the first BY field in the report, the report must contain at least one BY field. The bursting field may be a NOPRINT field.
Note: FORMULA is not supported with bursting.
SET COMPOUND=BYTOC TABLE FILE CAR PRINT SALES BY COUNTRY NOPRINT BY CAR ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * type=report, style=bold, color=yellow, backcolor=black, $ type=data, backcolor=red, $ type=data, column=car, color=blue, backcolor=yellow, $ END
The output is:
How to: Reference: |
The maximum number of rows supported by Excel 2003 on a Worksheet is 65,536 (65K). When you create an EXL2K output file from a WebFOCUS report, the number of rows generated can be greater than this maximum.
To avoid creating an incomplete output file, you can have extra rows flow onto a new Worksheet, called an overflow Worksheet. The name of each overflow Worksheet will be the name of the original Worksheet appended with an increment number.
In addition, when the overflow Worksheet feature is enabled, you can set a target value for the maximum number of rows to be included on a Worksheet. By default, the row limit will be set to the default value for the LINES parameter (57).
Note: When generating EXL2K output, the WebFOCUS page heading and page footing commands generate Worksheet headings and Worksheet footings.
Add the ROWOVERFLOW=ON attribute to your WebFOCUS StyleSheet
TYPE=REPORT, ROWOVERFLOW=ON, ...
This attribute will work only with EXL2K output, which generates web archive files (.XHT). For all other output types, the ROWOVERFLOW StyleSheet attribute is ignored, and data flow is not affected.
The ROWOVERFLOW=ON attribute is required in the WebFOCUS StyleSheet in order to set a target number of rows for the Worksheets in the EXL2K output file.
In a FOCEXEC or profile, use the following syntax
SET LINES = nnnnn
In a request, use the following syntax
ON TABLE SET LINES nnnnn
where:
Is a target value for the maximum number of lines to be included on any Worksheet in the EXL2K output file when the overflow Worksheet feature is enabled. The value must be less than 65K. Each Worksheet will end within a range of the designated limit. The actual row count for each sheet is calculated individually based on user defined heading/footing lines and other system generated lines added to each sheet by the specific report request. If necessary, you can modify how your report flows across Worksheets by adding or removing space in subheadings and/or subfootings.
(FOC3313) The line number limit per EXCEL 2003 worksheet is 65536.
The following request creates EXL2K report output with overflow Worksheets. The SET LINES command sets the maximum number of rows in each Worksheet to approximately 2000, and the ROWOVERFLOW=ON attribute in the StyleSheet activates the overflow feature. Without this attribute, one Worksheet would have been generated instead of three:
TABLE FILE GGSALES -* ****Report Heading**** ON TABLE SUBHEAD "SALES BY REGION, CATEGORY, AND PRODUCT" " " -* ****Worksheet Heading**** HEADING "SALES REPORT WORKSHEET <TABPAGENO" " " -* ****Worksheet Footing**** FOOTING " " "END OF WORKSHEET <TABPAGENO" PRINT DOLLARS UNITS BUDDOLLARS BUDUNITS BY REGION BY CATEGORY BY PRODUCT BY DATE -* ****Subfoot**** ON REGION SUBFOOT " " " End of Region <REGION" " " -* ****Subhead**** ON CATEGORY SUBHEAD " " " Category <CATEGORY for Region <REGION" " " -* ****Report Footing**** ON TABLE SUBFOOT " " "END OF REPORT" ON TABLE SET LINES 2000 ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, TITLETEXT=EXLOVER, ROWOVERFLOW=ON,$ ENDSTYLE END
The report heading displays on the first Worksheet only, the page heading and column titles display on each Worksheet, and the subhead and subfoot display whenever the associated sort field changes value. The following image shows the top of the first Worksheet, displaying the report heading, page heading, column titles, and first subhead:
Note that the TITLETEXT attribute in the StyleSheet specified the name EXLOVER, so the three Worksheets were generated with the names EXLOVER1, EXLOVER2, and EXLOVER3. If there had been no TITLETEXT attribute, the sheets would have been named SHEET1, SHEET2, and SHEET3.
The Worksheet footing displays at the bottom of each Worksheet and the report footing displays at the bottom of the last Worksheet. The following image shows the bottom of the last Worksheet, displaying the last subfoot, the page footing and the report footing:
How to: Reference: |
You can use the ALT attribute in a StyleSheet for EXL2K report output to provide informational text (a tooltip) for a drilldown hyperlink.
For a drilldown hyperlink to a FOCEXEC:
TYPE=type, [subtype], FOCEXEC=fex[(parameters ...)], [TARGET=frame,] [ALT='tooltip_text',] $
For a drilldown hyperlink to a URL:
TYPE=type, [subtype], URL=url[(parameters ...)], [TARGET=frame,] [ALT='tooltip_text',] $
where:
Identifies the report component that you select in the Web browser to execute the link. The TYPE attribute and its value must appear at the beginning of the declaration.
Are any additional attributes, such as COLUMN, LINE, or ITEM, that are needed to identify the report component that you are formatting.
Identifies the file name of the linked procedure to run when you select the report component.
Identifies any valid URL, including a URL that specifies a WebFOCUS Servlet program, or the name of a report column enclosed in parentheses whose value is a valid URL to which the link will jump.
Values that are passed to the report or URL.
Identifies the target frame in the Web page in which the output from the drill-down link is displayed.
Is the informational text to display when the mouse hovers over the hyperlink.
The JAVASCRIPT and IMAGE drilldown options are not supported with format EXL2K.
The following report request summarizes product sales and sorts the data by region, state, and store code. The store code also displays in the subfootings where links display to detailed reports about the sales for the store (by product or by date). Each line of the subfoot contains two text objects and one embedded field.
TABLE FILE GGSALES HEADING "Sales Report" SUM DOLLARS/I08M BY REGION BY ST BY STCD ON STCD SUBFOOT "View Store <STCD Sales By Product" " " "View Store <STCD Sales By Date" ON TABLE PCHOLD FORMAT EXL2K ON REGION PAGE-BREAK ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=HEADING, SIZE=12, STYLE=BOLD, $ TYPE=SUBFOOT, LINE=1, OBJECT=TEXT, ITEM=2, FOCEXEC=PRDSALES(STOREID=STCD), ALT='Product Sales',$ TYPE=SUBFOOT, LINE=3, OBJECT=TEXT, ITEM=2, FOCEXEC=HSTSALES(STOREID=STCD),ALT='Sales History', $ ENDSTYLE END
Using StyleSheet declarations, the subfoot phrase Sales By Product links to a second procedure named PRDSALES and passes it the value of STCD displayed in the subfoot. The subfoot phrase Sales By Date links to a procedure named HSTSALES and passes it the value of STCD displayed in the subfoot. The ALT attributes in the StyleSheet declarations for the hyperlinks provide informational messages.
The linked PRDSALES report follows:
TABLE FILE GGSALES SUM UNITS BY STCD BY PRODUCT WHERE STCD = '&STOREID' ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The linked HSTSALES report follows:
TABLE FILE GGSALES SUM UNITS BY STCD BY DATE WHERE STCD = '&STOREID' ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The first page of output for the main report follows. If your mouse hovers over the Sales By Date link, the informational text Sales History displays:
Reference: |
The EXL97 format allows you to view reports in Excel 97, which supports full styling and drill-down capability.
When you specify EXL97 format, an HTML-based file is generated with an extension of .e97. The appropriate MIME type is automatically assigned to designate Excel as the active application for this file type.
When using the Microsoft Internet Explorer browser and Excel 97, the Excel client opens in the background and the report launches in your browser. You may see the Excel application open and minimize while viewing your report; leave Excel open when viewing the spreadsheet.
After the report is generated, you can save the document as an Excel spreadsheet locally on your PC. In Excel 97, you will be prompted to save the document as a Microsoft Excel Workbook with an .xls extension. This will save the file as a binary Excel document.
WebFOCUS can also run directly from Excel without using a browser by creating a hyperlink within Excel that calls the WebFOCUS client with the necessary parameters. For details, see Embedding a WebFOCUS Report in an Excel 2000 Spreadsheet.
Format EXL97 is fully compatible with Excel 2000 and Excel 2002.
Note: Although format EXL97 is available, there are some limitations when compared to the Excel 2000 (EXL2K) formats. See Limitations for FORMAT EXL97. Future enhancements in the area of Excel integration will primarily be made to the EXL2K formats. We recommend upgrading to Excel 2000 or higher so you can take full advantage of our Excel integration, as well as all future enhancements.
The following example illustrates how a report displays when using PCHOLD FORMAT EXL97. The request includes drill-downs to another procedure and formatting options, including conditional styling.
TABLE FILE CENTORD
HEADING
"Order Revenue"
"Styled Report in Excel 97"
" "
SUM ORDER_DATE LINEPRICE AS 'Order,Total:'
BY HIGHEST 10 ORDER_NUM
ON TABLE SET PAGE-NUM OFF
ON TABLE SET ACCESSIBLE 508
ON TABLE PCHOLD FORMAT EXL97
ON TABLE SET STYLE *
TYPE=HEADING, COLOR=NAVY, SIZE=14, $
TYPE=HEADING, LINE=2, COLOR=RED, $
TYPE=DATA, BACKCOLOR=AQUA, STYLE=BOLD, WHEN=LINEPRICE GT 200000, $
TYPE=TITLE, STYLE=BOLD, $
TYPE=DATA, COLUMN=ORDER_NUM, FOCEXEC=DETAILS, $
END
The output is:
How to: |
WebFOCUS can integrate with Excel 97 to give you a completely customizable spreadsheet with styling, drill-downs, and formulas.
In an effort to integrate Microsoft Excel with the web, Microsoft introduced a host of new capabilities in Excel 97, including the ability to import HTML directly into Excel spreadsheets with formulas, styling, and AutoFilters. In addition, Excel 97 offers an optional feature of Excel, Web Query, which enables users to query specific web pages or servers in order to pull live data from the web into their spreadsheets while maintaining worksheet layout and formulas. A query can be set to automatically refresh and even prompt the user for parameters.
In Excel 97, web queries are text files that are created in an editor and saved in the appropriate directory with the extension .iqy. (Unlike Excel 2000, there is no graphical environment in which to create queries. For details, see Embedding a WebFOCUS Report in an Excel 97 Spreadsheet.)
A web query consists of three or four lines of text separated by carriage returns. The IQY file is only needed the first time a query is executed to establish the data location and parameters. After a query is run inside a spreadsheet and the spreadsheet is saved, the query information is always present and can be refreshed at any time.
The process of embedding a WebFOCUS report into an Excel 97 spreadsheet has three parts:
An IQY file is constructed as follows
Type_of_query [CR] Version_of_query [CR] URL [CR] {POST|GET} parameters [CR]
where:
Is Web. Since Web is the default value, this is an optional entry.
Is the current version of the Web Query software. 1 is the default value. This entry is optional.
Is a required entry that points to the WebFOCUS server. The URL needs to be constructed as a call to the WebFOCUS Servlet and contain any appropriate parameters that need to be passed.
Is the preferred method of retrieving large amounts of data and sending it data back as a separate line of text. For example:
http://WFserver/ibi_apps/WFServlet[CR] PARAM1=value & PARAM2=value
Is the preferred method of retrieving smaller amounts of data and appending the data to the URL. For example:
http://server/ibi_apps/WFServlet?PARAM1=value&PARAM2=value
Designates required carriage returns.
Step 1: Create the WebFOCUS Report
Create and save the following fully styled WebFOCUS report as webq97. You will embed this report in an Excel 97 spreadsheet. (For proper styling and execution of the request in Excel 97, ensure that Cascading Style Sheets are not in effect; SET HTMLCSS=OFF is the default value.)
The numbers to the left of each line of code correspond to annotations that follow the request.
1. TABLE FILE CENTORD 2. SUM LINEPRICE AS 'Sales' 3. BY YEAR AS 'Year' 4. BY PRODCAT AS 'Category' 5. BY PRODNAME AS 'Product' 6. WHERE YEAR EQ '&YEAR'; 7. ON TABLE SET BYDISPLAY ON 8. ON TABLE PCHOLD FORMAT HTML 9. ON TABLE SET PAGE-NUM TOP 10. ON TABLE SET STYLE * 11. TYPE=REPORT, FONT=ARIAL, SIZE=10, GRID=OFF, BACKCOLOR=YELLOW, $ 12. TYPE=TITLE, SIZE=11, STYLE=BOLD, $ 13. TYPE=DATA, COLOR=RED, WHEN=LINEPRICE LT 15000000, $ 14. TYPE=DATA, COLUMN=PRODCAT, FOCEXEC=webq2(PRODCAT=N1), $ 15. ENDSTYLE 16. END
Line 1 identifies the sample data source, CENTORD, which contains sales data for the Century Corporation.
Lines 2-5 define display and sorting requirements for the report.
Line 6 specifies selection criteria using a variable, &YEAR.
Line 7 sets BYDISPLAY to ON. This setting ensures that repeated sort values in the report are populated with data.
By default, repeated sort values in vertical columns (or BY fields) are suppressed in a WebFOCUS report, leaving blank fields in the report. This behavior is not desirable for Excel reports, which are designed to work with data that is repeated in every row to which it applies. A blank column or row can produce misleading results when sorting data.
Lines 8 defines the output format as HTML.
Important: The report must be in HTML format and not EXL97. This is because Microsoft Query imports fully formatted HTML pages or individual HTML tables into a spreadsheet. Executing an EXL97 request from a query will not return any data to the spreadsheet.
Line 9 turns off page numbering and removes any extra lines generated above the column titles.
Lines 10-15 specify styling attributes for the report: background color, conditional styling, a drill-down to another procedure, and some other miscellaneous styling have been designated. Styling, including drill-downs, carries over into Excel.
Step 2: Create a Web Query (IQY) File
Open a text editor and create the following web query file
WEB
1
http://WFserver/ibi_apps/WFServlet?IBIF_ex=webq97 &YEAR=["YEAR","Select Year"]
where:
Line 1 identifies this as a Web query.
Line 2 identifies the current version of Microsoft Query.
Line 3 is a typical WebFOCUS request using the GET method. The name of the procedure is webq97. The URL line passes a parameter of YEAR into the procedure. The user will be prompted to supply a value for YEAR. Of course, passing parameters is optional. In the example above, we have a dynamic parameter, but the parameters can be static as well. In other words, hard coded in the IQY file.
Note that carriage returns are required between lines in this file.
After you have constructed the query, save the document with an .iqy extension in the Queries directory under Microsoft Office. For example,
<drive>:\Program Files\Microsoft Office\Queries\webq97.iqy
Now that the IQY file is ready, you can create the spreadsheet and embed the query.
Step 3: Embed the Query in an Excel 97 Spreadsheet
This example starts with a blank spreadsheet, embeds the query, and then adds the bells and whistles.
There's no need to set the range in the case of a blank worksheet, however, you may want to output the data in a new worksheet and use formula references to work with the data.
Click OK.
Enter the value 1999.
The query executes and imports the data. The following message is displayed in the spreadsheet:
webq97: Getting Data...
The data appears in the spreadsheet:
You can now save this spreadsheet locally on your PC, save it to a shared network drive where multiple users can access the information, or deploy it within your web application. See Deploying a Spreadsheet With a WebFOCUS Web Query to a Web Server.
Reference: |
Using an optional feature of Excel called Microsoft Web Query, you can embed a WebFOCUS report in a customized Excel spreadsheet that already contains styling, formulas, and macros.
Microsoft Web Query uses a URL to embed external data or an HTML page into the spreadsheet. Since you can easily construct a URL that calls the WebFOCUS engine, you can use this URL as the source of your query. Then, instead of following the typical reporting path in which you execute a request from the browser and display the output in an Excel spreadsheet that conforms to the formatting of the report request, you can execute a request that returns HTML from a query inside an existing Excel spreadsheet whose content and layout you can control in Excel. Said another way, instead of having WebFOCUS push the report into the spreadsheet, you can have Excel pull the report into the spreadsheet. This "pull" technique supports the delivery of real time data directly into your own customized spreadsheets.
The process has two parts:
You must have a web browser installed on your PC to take advantage of this technique.
The following is a customized spreadsheet that was created using this technique. Notice that it includes logos (images), a report, formulas, and an Excel graph. There are two formulas added outside of the query range that sum and average the data brought back by the query. The report is generated as the result of a web query in the area of the spreadsheet that has been designated to contain it. The graph is also based on the results of this query. Each time the query is refreshed, the formulas and the graph update as well.
After you understand the rudiments of this technique, you will be able to adapt it to suit your preferred way of working with Excel. For example, you can:
or
You can implement this technique, with some variations, in Excel 2000 and Excel 97. For illustrations, see Embedding a WebFOCUS Report in a Customized Excel 2000 Spreadsheet and Embedding a WebFOCUS Report in an Excel 97 Spreadsheet. For detail on how to set up a web query in Excel 2000 or Excel 97, see your Microsoft Excel documentation.
Note: Microsoft Web Query may not have been installed by default. If you have not already installed it, you will be prompted to install Web Query the first time you attempt to access the feature. Just follow the install instructions provided.
This example creates the HTML report, then uses Web Query to set up the customized spreadsheet to receive it.
Step 1: Create the WebFOCUS report
Create and save the following request, webq.fex, which you will embed in a customized Excel 200 spreadsheet: The numbers to the left of each line of code correspond to annotations that follow the request.
1. TABLE FILE CENTORD 2. SUM LINEPRICE AS 'Sales' 3. BY PRODCAT 4. BY PRODNAME 5. ON TABLE PCHOLD FORMAT HTML 6. ON TABLE SET HTMLCSS ON 7. ON TABLE SET BYDISPLAY ON 8. ON TABLE SET PAGE-NUM TOP 9. ON TABLE SET STYLESHEET * 10. TYPE=REPORT, FONT=ARIAL, GRID=OFF, BACKCOLOR=YELLOW, $ 11. TYPE=TITLE, STYLE=BOLD, $ 12. TYPE=DATA, COLOR=RED, WHEN=LINEPRICE LT 15000000, $ 13. ENDSTYLE 14. END
Line 1 identifies the sample data source, CENTORD, which contains sales data for the Century corporation.
Lines 2-4 define display and sorting requirements for the report.
Lines 5-6 define the output format as HTML and turn on Cascading Style Sheets, a feature that increases the efficiency and overall styling capabilities of HTML.
Important: The report must be in HTML format and not EXL2K. This is because Web Query imports fully formatted HTML pages or individual HTML tables into a spreadsheet. Executing an EXL2K request from a query will not return any data to the spreadsheet.
Line 7 sets BYDISPLAY to ON. This optional setting ensures that repeated sort values in the report are populated with data.
By default, repeated sort values in vertical columns (or BY fields) are suppressed in a WebFOCUS report, leaving blank fields in the report. This behavior is not desirable for Excel reports, which are designed to work with data that is repeated in every row to which it applies. A blank column or row can produce misleading results when sorting data.
Line 8 turns off page numbering and removes any extra lines generated above the column titles.
Lines 9-12 specify styling attributes for the report: background color, conditional styling, and some other miscellaneous styling have been designated. Styling, including drill-downs, carry over into Excel.
Step 2: Designate the area in the spreadsheet into which Web Query will pull the report
In your spreadsheet, you designate the area where you want your WebFOCUS report to be displayed. You can designate a cell and let Excel determine how much space to allot to the report or you can specify a range of cells to limit the placement. For some techniques that may help you evaluate and control space requirements, see Tips for Populating Excel Spreadsheets With WebFOCUS Reports.
The New Web Query dialog box opens.
In the illustration, the code
http://servername/ibi_apps/WFServlet?IBIF_ex=webq
calls the WebFOCUS Servlet and requests the procedure called webq.fex. This is the report created in Step 1.
Keep in mind that you may also need to pass a user ID and password to get to a secure server. You must add parameters to the query manually. To do this, save the query as an .iqy file and manually add parameters to the URL request. For details, see How to Create a Web Query (IQY) File.
Since WebFOCUS HTML reports are generated using HTML tables, you can select either The entire page or Only the tables. (At the present time, you cannot identify individual tables in a WebFOCUS HTML report.)
Name the query and set its refresh behavior. For example, you can set the query to automatically refresh every time the worksheet opens. (Note that you can also set these properties after the initial execution.)
Click OK to run the web query. The report is pulled into the area of the spreadsheet that has been designated to contain it.
Note: You only need to run Web Query once to embed a query in a worksheet. After it is executed, the static data stays in the spreadsheet as a placeholder for the query. However, as long as you are connected to your network, the internet, or whatever other connection mechanism is in affect for your application, when you open your local spreadsheet, WebFOCUS delivers the latest information directly into your own customized spreadsheet. You can also click the Refresh Data option at anytime to update the information.
If you wish to delete a query, delete all the query data in the spreadsheet.
For an illustration of a customized spreadsheet that contains the report created in step 1, see Embedding a WebFOCUS Report in an Excel 2000 Spreadsheet. The spreadsheet includes logos (images), a report, formulas, and an Excel graph. The graph is also based on the results of this query. Each time the query is refreshed, the formulas and the graph update as well.
In addition to the method described in the example Embedding a WebFOCUS Report in an Excel 2000 Spreadsheet, you can employ other techniques to take advantage of Web Query in your spreadsheet For example, if you have an existing spreadsheet with a lot of pre-defined elements, you may need to run the query in a separate worksheet and see how much space it will take up before adding it to the main "working area" of the spreadsheet. It is a good idea to designate one particular worksheet for your query and have everything else refer to the data via formulas on another worksheet.
Another approach is to include everything in the same worksheet. Other surrounding elements in the spreadsheet should automatically reposition when the data comes back, but you may want to leave a buffer area around the query to ensure sufficient space for the report output.
In both Excel 97 and Excel 2000, you can deploy a customized spreadsheet containing a WebFOCUS Web Query to the web server and access it via a hyperlink. This technique enables you to deploy an Excel "template" that is pumped with live data each time it is accessed by a user. It is intended to work with Excel 97 versions and higher.
You must create a spreadsheet and enable the query to be refreshed when the file opens.
Select Refresh data on file open under the Refresh Control in the External Data Range Properties dialog box.
To ensure that the query is embedded in the worksheet, execute the Query and save the worksheet before deploying.
To set up the launch page, create a link that calls the spreadsheet. For example,
<a href=http://server/ibi_html/webq97.xls>Excel Sales Report</a>
Now, multiple users can benefit from a deployed WebFOCUS/Excel Web Query if running Excel 97 or higher.
Note: To take advantage of this feature, Excel (with Query) needs to be installed on the end-user (client) machine.
WebFOCUS |