This is a description of the import processing and execution sample.
Import Processing
Receive the file to import, and receive the import command from the application.
Create a temporary folder in the specified path and save the transmitted file.
Read the saved file and extract the data according to the command.
Convert to dataset (PlatformData).
Transmit the data to the application.
The created file is deleted immediately following task completion.
When importing in server mode, the file already saved in the server is used, and the file is not deleted even after task completion. Please refer to Nexacro help for the import file mode.
Execution Sample
This is a description of how to upload the Excel file to Nexacro-xeni, extract data, and display it in the grid component.
Nexacro Screen
1
If you click the File Open button in the figure below, then the file selection dialog box is displayed.
2
The selected file is uploaded to Nexacro-xeni and the imported result is displayed on the grid.
Nexacro Source
Please refer to the Nexacro help for an explanation of ExcelImportObject.importData.
this.Button00_onclick = function(obj:Button, e:nexacro.ClickEventInfo) { this.url = "http://127.0.0.1:8080/nexacro-xeni/XExportImport"; this.importObj = new ExcelImportObject("Import00",this); this.importObj.set_importtype(nexacro.ImportTypes.EXCEL); this.importObj.addEventHandler("onsuccess", this.Import00_onsuccess, this); this.importObj.addEventHandler("onerror", this.Import00_onerror, this); this.importObj.set_importurl(this.url); this.importObj.importData("","Body=Sheet1!A1:F6;output=ds","ds_excel=ds"); }
ExcelImportObject Event
You can check the Import processing and results through events.
Event Name | Description |
---|---|
onerror | Event that occurs when an error occurs during Import |
onsuccess | Event that occurs when Import is completed |