7 Download Data

When a business user clicks Download Data from the Oracle Visual Builder tab, Oracle Visual Builder Add-in for Excel fetches data from the REST service and displays that data in the integrated workbook's Excel worksheet. This action generally involves one or more GET requests on the business object's collection path.

The Download Data icon is disabled if the Download Enabled check box is not selected in the Layout Designer. See Manage Layout Capabilities. It may also be disabled if the GET operation is not configured on the collection path for the business object. See Manage Metadata Path Information.

Table Download

Here is what happens when the business user clicks Download Data for a Table layout:

  1. If the business user is not logged in, they are prompted to log in.
  2. If polymorphic business objects are used in the layout(s), then the polymorphic metadata is refreshed.
  3. The add-in may display one or more prompts in this order. If any of the prompts are canceled, the download operation is terminated.
    1. If the table has any pending changes, a warning is displayed and the business user can cancel to avoid losing changes.
    2. If path parameter values are required, the business user is prompted for these.
    3. If a row finder is configured and the finder includes row finder variables, the business user is prompted to provide values for the variables.
    4. If a graphical search is configured, the business user is prompted to provide values for the search conditions.
  4. When the final prompt has been accepted, a progress window is displayed. The business user may cancel the download at any time.
  5. During download:
    1. If there are any worksheet filters, these are cleared.
    2. All existing data is cleared from the table.
    3. Table, including headers, is fully redrawn.

      All polymorphic field sets are expanded at this time to include the global segments, discriminator (context segment), and context-sensitive segments.

  6. List of values (LOV) columns are initialized.

    If a given LOV already has choices cached, that cache is used at this point. If a given LOV has no cache, a REST request is sent for the first 300 choices.

  7. The first page of items is requested from the REST service.

    The add-in issues a GET request on the business object collection path. This request includes various query parameters and request headers.

  8. The add-in uses a single background thread to request the second page of items while processing the response from the first page.
  9. For each row received, the add-in:
    1. Prepares the values to be written to the worksheet.
    2. Determines the appropriate cell styling.
    3. For LOVs, the identity values are exchanged for display values using the cache. Missing identity values are captured for later.
  10. If there are more rows to download after the first page is processed, the add-in prompts the business user to continue.

    If the business user clicks Stop Now, the download operation stops immediately. If they click Download All, the operation continues to retrieve additional pages until no more pages are available.

  11. For each page of rows, the add-in:
    1. Issues additional GET requests on the LOV data source for LOV cache misses, and completes the swap of identity values for display values.
    2. Writes blocks of values to the worksheet.
    3. Applies appropriate styling to blocks of cells.
  12. The add-in continues to fetch page after page until there are no more items to fetch.
  13. The columns are resized to fit the current content.
  14. The table row height is reset to the add-in's standard height.
  15. If the table is not visible, the upper-left corner is selected to make it visible.
  16. A post-download macro is invoked, if configured.
During the download operation:
  • The add-in populates a special column called the "Key" column. The content of the cells in the key column is not human-readable. This columns contains "housekeeping" information for each row. This information is essential to the proper working of the table features. You should never edit or attempt to remove the key column. If you sort the table, you must include the key column in the range of sorted cells. Otherwise, you may get data corruption.
  • The status viewer is updated at various stages.

Note:

Problems communicating with the REST service may interrupt the download process. You can use the Network Monitor to see details of each request and response. See Network Monitor.

Form-over-Table Download

When a business user invokes a download for a Form-over-Table layout, the add-in downloads the form data first, then downloads the child rows for the current form row.

The download process is similar to the table download with these differences:

  • For the form download:
    • The add-in sets the count/limit query parameter to "1" (one) since only one row is displayed in the form.
    • There is no pagination at the form level.
    • The add-in populates the form region with data from the first row in the response from the GET request on the collection path.
  • For the table download, the path parameters for the child collection path are managed automatically by the add-in based on the current parent row.
  • The post-download macro is invoked, if configured, when the form and table downloads have completed successfully.

Dependent Layouts Download

The download process for a set of dependent layouts is similar to the other processes with these differences:

  • When a download is invoked on any layout in a set of dependent layouts, the download process applies to all the layouts in the set.
  • A download always starts with the primary layout even if a different worksheet is currently active.
  • The check for pending changes applies to all layouts in the hierarchy.
  • The entire hierarchy is cleared of current data.
  • Query prompts are only available for the primary layout.
  • Additional search parameters, if configured, are applied at each respective level. See Filter Data for a Set of Dependent Layouts.
  • The prompt to continue after the first page appears once only for the primary layout.

    If the parent layout is a Form-over-Table layout, this prompt applies to the child table. There is no prompt for descendant layouts.

  • Each layout in the hierarchy uses the specific pagination settings, such as Limit and Offset, from their respective business objects. See Configure Pagination for a Business Object.

Descendant Table Layout Download

For descendant table layouts, the rows the add-in downloads depend on the rows in the direct parent table layout. For each row in the direct parent table layout, the add-in retrieves and processes all relevant child rows. If there are search parameters defined on the descendant table layout, the search criteria may limit the number of child rows retrieved for each parent row. See Filter Data for a Set of Dependent Layouts.

To retrieve child rows, the add-in makes a GET request to retrieve the first page of child rows for a given parent.

Much like the standard download, the add-in processes the retrieved rows for the page, requests the next page in the background, and writes the page's rows to the worksheet. It keeps iterating over pages until all children for the parent row are retrieved and processed.

Note:

Up to 4 GET requests may be made on background threads, in parallel.

If ancestor columns, including direct parent columns, are present in the descendant table, those cells are populated with the appropriate values. These cells are read-only.

Writing the child rows to the worksheet takes place in order: all child rows for parent row 1 are written, then the rows for parent 2, and so on.

Notes

  • NetSuite services do not return full row details when responding to a GET request on the collection path. As a result, the add-in must issue individual GET requests on the item path for each item returned from the collection path.
  • For Oracle ADF REST Resource and Visual Builder Business Objects services, the add-in sends additional GET requests to the LOV data source to get rows with missing identity values only. For other service types, the add-in may get all rows in the LOV data source to fix the cache miss.

    If the add-in still can't find the display value for an identity value, the identity value is written to the worksheet without the swap.

  • REST services are stateless. As a result there are several issues to consider:
    • The query is re-executed for each page request
    • REST services cannot guarantee "read consistency" across multiple requests. If the data is changed during a multi-page download, it is possible for some rows to be missed entirely or downloaded more than once.

    Note:

    If pagination is not configured for a given business object, the add-in attempts to fetch and process all available rows in a single request. For larger volumes, such requests may time out.
  • If Send Only Changed Data During Upload is enabled, the add-in caches a copy of the data during download to be used for comparisons later on during upload.