Click here to Skip to main content
15,915,160 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have certain URLs for downloading the excel files. I have to combine data from all the excel files into 1 excel file and download( without actually downloading the individual files).

Can anyone help me with this?

Thanks in advance.
Posted
Updated 26-Nov-13 20:12pm
v2
Comments
Maciej Los 27-Nov-13 2:19am    
Does the files are placed on the same server?
Reshma Babu 27-Nov-13 4:46am    
yes.
All these files are on the same server
Bernhard Hiller 27-Nov-13 2:42am    
Do I undertand it correctly:
You want to create one new Excel file, in a procedure executed on the server. That new file contains data from some other files which are already available on the server.
Reshma Babu 27-Nov-13 4:50am    
I have reports in several excel files in the server. But, when I click on download icon, only 1 excel should be downloaded, which has data from all the reports. ( read from all the excel sheets, put it in 1 excel & enable that for download)
Maciej Los 27-Nov-13 5:37am    
Why do you use several Excel files? Isn't possible to use database instead Excel? Please, be more specific and provide more details about your needs. Why Excel?

Refer the link which takes care of the same.

Excel c#.net retrieving data without opening excel in the background[^]

Hope this helps you...
 
Share this answer
 
Comments
Maciej Los 27-Nov-13 5:31am    
Interesting link ;)
A5!
JoCodes 27-Nov-13 5:32am    
Thanks Maciej :)
You need a tool for reading and writing excel files. Do not use Excel itself, it may cause problems when called from IIS. With that tool, open the individual files, and create a new excel workbook into which you add the data depending on your requirements (e.g. just copying over all of the worksheets). Then place the file into a position which can be accessed via the web, and add a link to it in the web page.
Note: creating that new file might take some time, and depending on the updates of the individual files and requests of the combined file, it might be appropriate to check if the creation needs to be done again, or a previously created file could be retrieved.
 
Share this answer
 
WebClient wc = new WebClient();
byte[] data = wc.DownloadData(url);



This downloads the data and it can be written files using filestream
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900