Use Workbook Parameters for Download
An organization may choose to embed different values in an integrated workbook—for example, when it is retrieved—based on the context. Let's consider an example. Suppose your organization has a web app that includes an Employees page and that this page includes a button for downloading an integrated workbook. The web developer could use a server-side mechanism to write the same filter values to the workbook used by the business user in the web app.
For example, a business user may filter the employees list in the web app to show only employees in the Sales department with a salary greater than or equal to $7000. If this user then clicks the download button on the page, the web server embeds the filter values— Dept=Sales
and MinSal=7000
—in the integrated workbook before sending it to the user.
If you configure a search, a row finder, or a download parameter that references these workbook parameters, then the user sees the same data as in the web page when they open the downloaded workbook and click Download Data. For more information about using expressions that reference workbook parameters, see Workbook Parameters in Expressions.
How these workbook parameters are written to the workbook is up to you. However, if your organization plans to take advantage of this technology, your web developers will need to know where to write these workbook parameters and in what format. You can point them to Embedding Workbook Parameters in a Workbook for these details.
See also:
Test a Download with Workbook Parameters
Before you distribute the workbook, it is recommended that you test the search behavior of a configured search, row finder, or download parameter that references a workbook parameter.
Use the Network Monitor to review the requests and responses to and from the REST service during a download. The Network Monitor shows the URLs that the add-in constructs using the search or row finder settings. See Network Monitor.
You can also view or modify workbook parameters while testing using the Workbook Parameters dialog.
Note:
The Workbook Parameters dialog should only be used for testing purposes. Any parameters added or edited using this dialog are removed when the workbook is published.To test the search behavior:
Embedding Workbook Parameters in a Workbook
Workbook parameters might be name-value pairs that correspond to URL arguments passed when the workbook is downloaded from a web app. They may also represent some state from a web app page. Or they might be arbitrary named values.
Oracle Visual Builder Add-in for Excel does not include functionality for embedding workbook parameters programmatically. An organization that wants to use this functionality must provide their own custom solution for embedding these parameters in a given workbook. This topic is intended for the programmer or web developer tasked with coding this solution.
Workbook parameters must be written to a specific location and in a specific format. Before you proceed, review the parameter requirements carefully to make sure you embed your workbook parameters correctly.
Sample Methods
Here are some possible methods to consider when planning a solution:
- A server-side mechanism using a J2EE servlet or filter to examine and update the workbook during download
- A client-side/browser-based (JavaScript) mechanism that can examine and update the contents of the workbook after it is retrieved from the server and before it is written to the local computer file system
Location
All workbook parameters are stored as a string on a hidden worksheet named _VBCS_WorkbookInfo
at cell address $B$15
.
Format
The format for the packed string is:
<paramName1>=<paramValue1>/<paramName2>=<paramValue2>/...
with these conditions:
- Each paramName and paramValue must be separately URL-encoded.
- Each name must be separated from its value using the equals character (
=
). - When there are multiple name and value pairs in the string, each name value pair is separated from others by the forward slash (
/
) character. - The equals (
=
) and forward slash (/
) characters must not be encoded.
Notes
- The total size for the packed string format for the set of embedded parameters is limited to 32,759 characters.
- The specific worksheet cell (
_VBCS_WorkbookInfo!$B$15
) may:- Be empty (no parameters)
- Contain a packed string of 1 or more parameter name and value pairs
- Contain the special placeholder string,
$$VbafeWorkbookParameters$$
This value is set by default when a workbook is first integrated using the add-in, and also when the workbook is published.
The add-in treats this value, if found, the same as an empty string (no parameters available)
- Workbook parameters are removed when the workbook is published. This applies to all workbook parameters embedded as described here or created using the Edit Workbook Parameters dialog.