Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6l

Application v 6.6b

  

 

Chapter Eight — Data Functions (continued)

DataSheetExportRegion Function

Overview

The DataSheetExportRegion function exports an area of a sheet to HTML, CSV or XML.

Syntax/Parameters

Syntax

string = DataSheetExportRegion ( handle hSheet, [int start_row], [int start_col],
                                            [int end_row], [int end_col],
                                            [int format], [dword flags] );

Parameters

hSheet

A handle to a Data Sheet Object.

start_row   start_col   end_row   end_col

Optional int values specifying the zero-based area to export. Start points are inclusive, end points are exclusive. If not provided, the values are zero. If the ending row or ending column are zero, they are set to the last row or column, respectively.

format

An optional int specifying the format to write. If not specified, the default is HTML (FT_HTML).

flags

An optional dword specifying flags for the export. See Remarks below. The default value is 0x00000000, or no flags.

Return Value

A string containing the result or empty on failure. Use the GetLastError to retrieve a formatted error code.

Remarks

The formats supported are: FT_ANSI, FT_CSV, FT_HTML and FT_XDS_II. If the format is not known, it will default to FT_XDS_II.

The XML export does not write a schema or XML wrapper for XDS. This is done to facilitate the option of writing multiple sheets into a single output as a workbook.

The following bits can optionally be set for various export formats:

  Definition   Bitwise   Description  
  XML/XDS Flags          
    DS_EXPORT_NO_STYLE_INDEX   0x00000001   Do Not Output Style Index  
    DS_EXPORT_NO_COLUMN_LAYOUT   0x00000002   Do Not Output Column Layout  
  Non XDS Flags           
  General Flags           
    DS_EXPORT_OPTIONS_MASK   0x0FFFF000   Options Mask (format based)  
   Encoding           
    DS_EXPORT_ENCODING_MASK   0x00000003   CSV Export Encoding Mask  
    DS_EXPORT_ENCODING_RAW   0x00000000   Export as Raw (UTF-8, no header)  
    DS_EXPORT_ENCODING_ANSI   0x00000001   Export as ANSI (Convert from UTF-8)  
    DS_EXPORT_ENCODING_UTF_8   0x00000002   Export as UTF-8  
    DS_EXPORT_ENCODING_UNICODE   0x00000003   Export as Unicode  
   Line Endings (file only)           
    DS_EXPORT_LINE_ENDINGS_MASK   0x0000000C   File Export Line Endings Mask  
    DS_EXPORT_LINE_ENDINGS_CRLF   0x00000000   Return/Line Feed  
    DS_EXPORT_LINE_ENDINGS_LF   0x00000004   Line Feed (new line)  
    DS_EXPORT_LINE_ENDINGS_CR   0x00000008   Return  
  CSV Flags          
    DS_EXPORT_CSV_EXCEL_STYLE   0x00001000   Use Quotes Only when Required  
    DS_EXPORT_CSV_INHIBIT_HEADER   0x00002000   Do not Encoding Write Header  
    DS_EXPORT_CSV_SHEET_BOUNDARY   0x00004000   Insert a Sheet Boundary  
  HTML Flags          
    DS_EXPORT_XHTML   0x00001000   HTML as XHTML  
    DS_EXPORT_HTML_HEADER   0x00002000   Add Header/Footer  
    DS_EXPORT_HTML_COLUMNS_AS_FIXED   0x00004000   Do Not Adjust Column Widths  
    DS_EXPORT_CELL_NAMES   0x00008000   Export the Cell Names  
  Text Flags           
    DS_EXPORT_TEXT_PRINT_IMAGE   0x00001000   Export as Print Image (spaces)  
    DS_EXPORT_TEXT_INHIBIT_HEADER   0x00002000   Do not Encoding Write Header  
    DS_EXPORT_TEXT_SHEET_BOUNDARY   0x00004000   Insert a Sheet Boundary  

 

See the Appendix E, XML Data Sheet Format Specification for additional information. Legacy XDS (Mark I) cannot be exported from a Data Sheet Object.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic