WIN 2003 asp.net site cannot connect SQL with username + password
Source: Internet
Author: User
Asp.net| site in a Web application, we cannot export a report as it does in a Windows application, because the program is executed on the server side, and when the export is performed, the result is on the server side, how should the full client export be achieved? Actually this is not difficult, the method is to specify that the report be exported to a previously established report staging file on a Web site, and then use the Response.Redirect () directive to point the browser URL to the report location so that the user's browser will try to download the newly exported file and the file will be downloaded to the client In order to achieve the results we need. Some of the code is as follows:
public string Exportreport ()
{
Exportoptions Creo = new Exportoptions ();
Diskfiledestinationoptions Crdo = new Diskfiledestinationoptions ();
String FileName = Request.physicalapplicationpath + "Exportfile\exap.xls";
Note that when exporting to the web, you need to have permissions to establish files on the exported directory, and if there is insufficient permissions, the error "Deny access to the report file ..." will appear. Let the ASPNET user (the system user that is automatically generated when the. NET framework is installed) have the Write permission in the export directory text.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service