Maptitude GISDK Help |
Export mulitple views to an ExcelX file,
Added to Version 2021.
ExportSheetsToExcelX(string excel_file, array sheets)
Argument |
Contents |
excel_file |
Name of the Excel workbook (.xlsX) file |
sheets |
An array of options arrays where the option name is the "view|set"to be exported and the option value is another option array according to the table below |
new_file |
Name of the new table file |
Option |
Type |
Contents |
SheetName |
String |
The name of the worksheet in the Excel workbook (.xlsX) file |
Row Order |
Array |
An array that indicates the desired sort order, or null for natural order. The array is an array of field name-order pairs with two strings, the name of the field and "Ascending" or "Descending," for each field in the sort order |
Fields |
Array |
An array of field names to be exported |
If the Sheet option is omitted, Maptitude exports the first worksheet.
// Exports selection sets form tow layers to separate worksheets in an Excel file
out_file = "c:\\temp\\test.xlsx"
sheets = {
{"State|Selection",
{
"SheetName": "State" ,
"Row order" : {{"ID", "Ascending"}},
"Fields": {"State Abbrev", "Land Area", "Population" }
}
},
{"Census Tract|Selection",
{
"SheetName": "Census Tract" ,
"Row order" : {{"State Abbrev", "Ascending"}, {"Tract", "Ascending"}},
"Fields": {"State Abbrev", "Land Area", "Tract", "Population"}
}
}
}
ExportSheetsToExcelX(out_file, sheets )
Error Type |
Meaning |
NotFound |
Field name not found or view name not found or selection set name not found |
Error |
Invalid fields array. |
Function |
Summary |
Lists all the worksheets in an Excel workbook (.xls) file |
|
Opens a table from a file on disk and creates a view |
|
Reads an Excel workbook (.xls) file and exports one of its sheets to a new table |
©2025 Caliper Corporation | www.caliper.com |