Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to load an excel file to the server using ASPxUploadControl and display its data in ASPxSpreadsheet

$
0
0
This example shows how to load an excel file from your computer to the server using ASPxUploadControl and then display its data in ASPxSpreadsheet.
To do this, you first need to place the ASPxSpreadsheet and ASPxUploadControl controls on a page and, secondly, handle the ASPxSpreadsheet.Load event and both the server-side and the client-side ASPxUploadControl.FileUploadControl events.
After uploading the excel file from your computer, save it in the "~/XlsTables/" directory using the ASPxUploadControl.FileUploadControl event handler on the server-side. You may choose any filename and then save it in the Session["FileName"] object to use later.
In the ASPxSpreadsheet.Load event handler you need to check the value of the Session["FileName"] object. If it's null, do nothing. Otherwise use the ASPxSpreadsheet.Open method with this name as a parameter.

See also: How to load an excel file to the server using ASPxUploadControl and display its data in ASPxGridView

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>