We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Async Excel downloading in Web app using Aspose.Cells

can any body help me to download excel asynchronolsly in web app

here is my code

using Aspose.Cells;
{

Aspose.Cells.License lic = new Aspose.Cells.License();
lic.SetLicense(HttpContext.Current.Server.MapPath("Aspose.Cells.lic"));


DataTable dataTable = null;
dataTable = Reports.GetReportPopupData("2", "18-MAR-2014");

Workbook wb = new Workbook();
wb.Worksheets.Add();

Worksheet worksheet = wb.Worksheets[0];

worksheet.Cells.ImportDataTable(dataTable, true, 0, 0, dataTable.Rows.Count, dataTable.Columns.Count, true, "d-mmm-yyyy");

wb.Save(HttpContext.Current.Response, "FirstAspose.Xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions(SaveFormat.Xlsx));

}using Aspose.Cells;
{

Aspose.Cells.License lic = new Aspose.Cells.License();
lic.SetLicense(HttpContext.Current.Server.MapPath("Aspose.Cells.lic"));


DataTable dataTable = null;
dataTable = Reports.GetReportPopupData("2", "18-MAR-2014");

Workbook wb = new Workbook();
wb.Worksheets.Add();

Worksheet worksheet = wb.Worksheets[0];

worksheet.Cells.ImportDataTable(dataTable, true, 0, 0, dataTable.Rows.Count, dataTable.Columns.Count, true, "d-mmm-yyyy");

wb.Save(HttpContext.Current.Response, "FirstAspose.Xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions(SaveFormat.Xlsx));

}

Hi,


Well, Aspose.Cells is a class library used to create, manipulate, convert or render Excel file formats only. It is a pure .NET component created in managed C# for managing spreadsheets. You would use the APIs provided by Aspose.Cells to create or manipulate Excel spreadsheets. And, you may use the component in your projects (e.g Winforms, web forms, etc.) for your needs. Although we are not completely sure about your issue/ requirements but they looks not relevant to the component. I think your requirements are not concerned with the product or there is nothing to do with the library.

Let us know if we can be of any further help.

Thank you.

my issue is when we run above code my asp.net page should not wait for excel file to down load once i click button to process excel i should be able to do other things with my asp.net web page. client should not wait for excel to finished down loading data. i want to make sure how excel down loading is asynchronously process so it will not block thread for other we b processing. user should not wait for excel because we trying to down load more than 100K records in excel from server to client.

how can i make this process ASYNC. we are not using WebGrid control as well just Aspose.Cells library to load data from database (above code works fine and we area ble to get file with data on client) and than client can save on theire local machine.

your help will greatly appriciated. as we have lot's of projects at bank use web pages to download excel without using webGrid.

we want to use this functionality across all group.

Hi,

Thanks for using Aspose.Cells.

Aspose.Cells will write the workbook into the stream and you must wait before it could write the workbook into stream fully.

You should use AJAX controls in your ASP.NET application which will let you work other parts of your web application while one part of your web application is hanged.

if i use EebGrid control on my web page and set Async property to true and import excel file.

in this case WebGrid control on webpage will load excel file anysnchronosly ??

does WEbGrid control load excel file in asynchronously on web page ??

Hi Piyush,

Thanks for using Aspose.Cells.

When Async property is set to true, then GridWeb loads portion of the data that it displays asynchronously. However, it loads sample xls/xlsx file completely inside memory once.

For your purpose, AJAX control like Update Panel will serve the purpose. You can keep the portion of your web page which gets hanged inside the Update Panel, it will then not hang/stop rest of your web page working.

http://msdn.microsoft.com/en-us/library/bb399001.aspx