CSV-export has is slow performance

I have written a web-application that uses a ListGrid to present the result. The application also contains an export-button to export the client data to a CSV-file. It works really great!

But when the ListGrid contains about 4000 rows it becomes so slow that it web-page stops working. Is there any way to improve the performance? The ListGrid contains 7 columns and has pure text content.

private DSRequest getExportProperties(String name) {
	DSRequest req = new DSRequest();
	req.setAttribute("exportAs", "csv");
	req.setAttribute("exportDisplay", "download");
	req.setAttribute("exportFilename", name+".csv");
	req.setExportDelimiter(";");
	return req;
}

exportButton.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(ClickEvent event) {
			listGrid.setExportRawValues(true);
			listGrid.exportClientData(getExportProperties("struct"));
		}
		
	});

The browsers are Internet Exporer and Google Chrome.
I am using SmartGWT Pro 2.4.

Look at the docs for the difference between exportData and exportClientData - use exportData() for larger exports.

Great! Now it works!

Requst for Code

Dear Sir,

         Please provide entire code of listgrid, datasource with one field. i am try to your code i got exception like dsRequest expects only. i am using lgpl version.

Thank in Advance,
Ashok Maddi,
maddhi.ashok@gmail.com,
+919014399945.