This is a description of the export processing and execution sample.
Export Processing
The application divides the data (command, export data, style) for export in certain sizes, and it sequentially transmits the divided data (chunked data) to the Nexacro-xeni server.
The Nexacro-xeni server configures the transmitted data into the file stream to be saved according to the command.
Create an arbitrary folder in the specified pathway and create the stream as a file with the specified name.
The URL of the created file is transmitted to the application so that the file may be downloaded.
Request the URL.
The Excel file is transmitted.
The created file is managed/deleted according to the settings.
Execution Sample
This is a description of how to export the data of the Nexacro grid component to an Excel file.
Nexacro Screen
1
If you click the export button in the sample figure below, then the contents of the grid are divided and transmitted to Nexacro-xeni.
2
When the task in Nexacro-xeni is completed, the following dialog box is displayed.
3
Check the downloaded file.
Nexacro Source
this.Button00_onclick = function(obj:Button, e:nexacro.ClickEventInfo) { this.url = “http://127.0.0.1:8080/nexacro-xeni/XExportImport”; this.exportObj = new ExcelExportObject(); this.exportObj.addEventHandler("onprogress", this.ExcelExportObject00_onprogress, this); this.exportObj.addEventHandler("onsuccess", this.ExcelExportObject00_onsuccess, this); this.exportObj.addEventHandler("onerror", this.ExcelExportObject00_onerror, this); var ret = this.exportObj.addExportItem(nexacro.ExportItemTypes.GRID, this.gd_excel, "Sheet1!A1"); this.exportObj.set_exportmessageprocess("%d [ %d / %d ]"); this.exportObj.set_exportuitype("exportprogress"); this.exportObj.set_exporteventtype("itemrecord"); this.exportObj.set_exporttype(nexacro.ExportTypes.EXCEL2007); this.exportObj.set_exportfilename("ExcelExport_Sample"); this.exportObj.set_exporturl(this.url); this.exportObj.exportData(); }
ExcelExportObject Event
You can check the export processing and results through events.
Event Name | Description |
---|---|
onerror | Event that occurs when an error occurs during Export |
onprogress | Event that occurs according to the progress during Export |
onsuccess | Event that occurs when Export is completed |
Error Response
When the File Dialog Box Does Not Open or the File is Displayed as Broken
If the file dialog box does not open or the file contents are displayed as broken on the browser after Export is completed, then add mime-mapping to web.xml and restart the WAS.