generte excel through asp.net
From: hari krishna (harikrishna_at_discussions.microsoft.com)
Date: 09/20/04
- Next message: Girish bharadwaj: "Re: Folder permissions"
- Previous message: Jeff Johnson: "User controls inside a Repeater?"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 19 Sep 2004 20:53:01 -0700
hi,
i am trying to generate excel reprots through asp.net.
i am using win2000 web server, office 2000 (excel 2000), IIS 5.0, .NET 1.1
versions.
I have a sample code to generate XL reports through VB.NET windows
applications.
It is working fine with windows application.
But when i tried to do the same through ASP.NET (code behind is VB), at the
time of accessing Excel.application (at the line: Dim oExcel As
Excel.Application = New Excel.Application) it gave error and says permissions
denied. I already added a reference for Excel component.
I searched through internent and i came to know that i should give some
launch/access permissions for excel 2000 application through DCOMCNFG. And i
did give those permissions. Even it says 'access denied' as below.any body
has any idea about this. pls give solution.
Error it gave is:
Access is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request identity.
ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or
Network Service on IIS 6) that is used if the application is not
impersonating. If the application is impersonating via <identity
impersonate="true"/>, the identity will be the anonymous user (typically
IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
appropriate user or group. Highlight the ASP.NET account, and check the boxes
for the desired access.
Source Error:
Line 28: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Line 29:
Line 30: Dim oExcel As Excel.Application = New Excel.Application
Line 31:
Line 32: Dim oBooks As Excel.Workbooks, oBook As Excel.Workbook
Source File: E:\Inetpub\wwwroot\WebApplication1\WebForm3.aspx.vb Line: 30
Stack Trace:
[UnauthorizedAccessException: Access is denied.]
WebApplication1.WebForm3.Page_Load(Object sender, EventArgs e) in
E:\Inetpub\wwwroot\WebApplication1\WebForm3.aspx.vb:30
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
- Next message: Girish bharadwaj: "Re: Folder permissions"
- Previous message: Jeff Johnson: "User controls inside a Repeater?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|