I have a Flex web-based application that retrieves data from SQL Server and displays it in a data grid. I'm using FileReference to export the data from data grid into a CSV file, which is fine for small amount of data. I need another method for retrieving and downloading massive data directly without displaying it in the data grid. I was thinking it must be a way to export data on the server using SQL server (like using OPENROWSET method) and then download the exported file. But I couldn't implement it so far. Also I'm not sure if it is the best approach to do such task. I was wondering if anybody could help me out to find a solution for it. I really appreciate it.
I'm using IIS 7 as web server and Adobe Flex Connector for MS SQL Server as web service to connect to SQL Server
You can use FileReference.download(URLRequest) to download the file directly from the remote server. The file itself should be created on the server side. For example, if you use ASP.NET, you can create a service (WCF, Fluorine etc) that fetches data from the DB, puts it into generated file and returns the url of the file to Flex client which can then use FileReference.download.