Export Function

This is a description of the export processing and execution sample.

Export Processing

  1. 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.

  2. The Nexacro-xeni server configures the transmitted data into the file stream to be saved according to the command.

  3. Create an arbitrary folder in the specified pathway and create the stream as a file with the specified name.

  4. The URL of the created file is transmitted to the application so that the file may be downloaded.

  5. Request the URL.

  6. The Excel file is transmitted.

  7. 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 Platform grid component to an Excel file.

nexacro platform 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 Platform 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.