Excel transformation (-XLS) command

The -XLS command allows the map to transform map data in delimited format to Excel formatted data using the GET map rule. PUT receives map data in delimited format and transforms it to Excel formatted data. This command allows the same with GET, so that it can return Excel formatted data back to the map by performing in-memory transformation. The delimited format data has to conform to the Excel importer generated type tree for the corresponding worksheet in the Excel workbook.

This command is generally useful in environments where file system access is restricted to the users, and Excel transformations must be performed in memory and then transformed output to be returned to the map for further processing. A stream of Excel formatted data is passed back to the map with GET:

=GET("EXCEL","-XLS -TEMPLATE memory://<template-document-id>",<delimited-map-data>)

A template should also be added to the memory, if it is not a remote file, using the -ADOC command when performing in-memory transformation of delimited formatted data to Excel formatted data. The -ADOC command returns a user specified document ID, or a system generated ID for the template.

This two step process is shown here:
  • template-document-id=GET("EXCEL","-ADOC <my-template-documentid>",<template-file-data-as-stream>) or template-document-id=GET("EXCEL","-ADOC",<template-file-data-as-stream>)
  • excel-data-out=GET("EXCEL,"-XLS -TEMPLATE memory://<template-document-id>",<delimited-map-data>)

Store output document in memory

With out the -XLS command, instead of streaming to a map, output operation can keep the output document in memory until it is fetched with -GDOC command. This is a two step process:
  • =PUT("EXCEL","-FILE memory://<my-output-doc-id> -TEMPLATE memory://<template-document-id>",<delimited-map-data>) or the adapter command line can be with the output card

  • excel-data-out=GET("EXCEL","-GDOC <my-output-doc-id>")

Default File URL

It is required to specify memory:// for memory documents, or http:// for remote documents, or file:/// for local file system documents using the -FILE (-F) and -TEMPLATE (-P) commands. If file:/// is not specified in the path to the local file system documents, such paths are resolved relative to the map directory.

Reference delimited data

-FILE memory://<delimited-data-document-id> can be specified. Delimited data is in memory and can be referenced instead of passing map data as a third parameter of GET, third parameter has precedence over -FILE option.