Click here to Skip to main content
15,905,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to export the data to excel. When running on localhost, the code is working fine but its not working in the server, the page is getting reloaded without displaying any error message.
Posted
Comments
Albin Abel 15-Mar-11 8:43am    
If you are using excel components to export, then server has to installed with excel components. As you are saying no error message, you may need to post relevant code snippets to get answer effectively
raju melveetilpurayil 15-Mar-11 9:18am    
did you check the MIME type of excel already set in your IIS??

This[^] may help.
 
Share this answer
 
If it works in local, but not in the server then it is clear that there is a configuration issue. Either you are missing dependencies, or your application configuration has errors. A wise way to find out what is going on is to turn on Failed Request Tracing for the given application and read the logs. There is sometimes valuable information in there doesn't appear in the response.
 
Share this answer
 
Comments
Espen Harlinn 17-Mar-11 18:55pm    
Good advice :) I guess he may run into some problems when (probably) using a desktop application from IIS on a server, even if it was installed on the server ...
You need something like EPPlus[^]

Excel is a desktop application - so it will work wonderfully during development, and quite possibly not be available on the server, and even if it is - it's usually not a good idea to use from IIS, as this is a windows service.

Best regards
Espen Harlinn
 
Share this answer
 
pl make sure that these lines are present in your code.
MIDL
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");


or share your code.
 
Share this answer
 
Use elmah to get the proper error
 
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