将数据导出到Excel并下载excel文件

问题描述:



我正在尝试将数据从数据集或数据表导出到excel并下载它。这是在我的本地机器上工作但是当我将项目部署到服务器端时我能够导出并在用户登录服务器时下载excel文件,但在用户注销时无法执行相同的操作。



我已经设置了



identity impersonate =trueusernname =xxxpassword =yyy



也在web.config文件中

即使我无法导出和下载excel文件。



所以请帮助我。

Hi,
I am trying to export data from dataset or datatable to excel and download it.This is working in my local machine but when i deployed the project to server side i am able to export and download the excel file when the user is logged in the server but couldnt perform the same operation when the user is logged out.

I have set the

identity impersonate="true" usernname="xxx" password="yyy"

also in web.config file
even though i couldnt export and download excel file.

so please help me.

您可以尝试为运行应用程序池的用户(网络服务?)提供对所需文件夹(读写)的完全访问权限。
You could try to give full access to the required folder(read-write), to the user who runs through the application pool(Network Service?)