Re: generating MS-Excel report through ASP.Net without installing

From: Lau Lei Cheong (leu_lc_at_yehoo.com.hk)
Date: 09/18/04


Date: Sat, 18 Sep 2004 10:03:11 +0800

I don't know, but adding "MACHINENAME\ASPNET" account to the MS Office
directory with
execute permission may help.

Users can't create process from files in a directory if they do not have
execute permission of the
directory.

"hari krishna" <harikrishna@discussions.microsoft.com> ¦b¶l¥ó
news:1E0F7F54-6C07-4839-9ADC-1427A9D81F69@microsoft.com ¤¤¼¶¼g...
> HI Shamshad,
> Thanks for the advise.
> I need ur help in this regard.
> I don't want to open the xl in browser, and it should not ask for the
name
> of the file to save?open etc.. it should automatically generate the xl
file
> and store it to the physical folder dynamically. This is our users
request.
> my web server is on Win 2000 server machine and IIS 5.0, ASP.NET 1.1
> installed.
> the code i wrote is giving permissions problem. I did give Launch and
Access
> permissions through DCOMCNFG for MSExcel application. But still it denied
the
> permissions. At the line "Dim oExcel As Excel.Application = New
> Excel.Application", it gave the following error. pls help me how to do
this.
> 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()
>
>
>
>
>
>
>
>
> "Lau Lei Cheong" wrote:
>
> > I've heard that new version of CrystalReport(10?) have this
> > function(generate PDF format report), but not verified yet.
> >
> > Maybe you can take a look on that...
> >
> > "Shamshad" <shamshad_ali74@hotmail.com> |b?l¢Do
> > news:OICDMiInEHA.2612@TK2MSFTNGP15.phx.gbl ?????g...
> > > If u don't install Excel library on ur Server how ur vb code will
create
> > > object for Excel files? I had done this on IIS 5.0 with office
installed
> > on
> > > server and I code that all upon users request from website. It does
> > > automatically and make attachment and send email to waterver user
input
> > > email address. It makes a temp folder and create .xls file and attach
for
> > > email and delete it. That is not a good practice but we do for users
> > > request.
> > > I also want to conevert it for PDF, any one has idea how to make
dynamic
> > PDF
> > > upon users given criteria on web and send that report as email
attachment
> > in
> > > PDF format?
> > > Let's discuss more if any one had done. Hari if u need any furhter
> > > assistance let me know.
> > > Shamshad Ali.
> > > "hari krishna" <harikrishna@discussions.microsoft.com> wrote in
message
> > > news:CFF07264-8DF0-4B4A-8405-11D1866BEDA5@microsoft.com...
> > > > hi srini thanks,
> > > > But i want a code in vb code.
> > > > And also i gave permissions through dcomconfig to launch
permissions ,
> > > > access permissions to excel application. but it did not work through
> > > asp.net.
> > > > it still gave permissions denied.
> > > > and more over i know that excel is not recommended for automation
> > through
> > > > server side. that is why i don't want to install xl, and create
reports
> > > with
> > > > .xls extension and when i open it on a machine where xl is installed
it
> > > > should open in xl.
> > > > Is there any code using response object sending to xl like that.
> > > > pls reply.
> > > >
> > > > "srini" wrote:
> > > >
> > > > > hi hari,
> > > > > Please go thru this article before getting into coding.
> > > > > http://support.microsoft.com/default.aspx?kbid=257757
> > > > > MS does not recommend server side automation of office.
> > > > > And for writing to Excel the following link helps :)
> > > > > http://www.eggheadcafe.com/articles/20021012.asp
> > > > >
> > > > > the best
> > > > > srini
> > > > >
> > > > > "hari krishna" wrote:
> > > > >
> > > > > > hi,
> > > > > > I want to send the data from dataset information to Excel
through
> > > ASP.Net.
> > > > > > there will be no XL installed on web server. web server is win
2000
> > > server
> > > > > > machine. I am using visual basic code in asp.net.
> > > > > > The Xl *** should not be opened in the browser. All the
> > information
> > > from
> > > > > > dataset(datatable,datarows) should be sent to XL and the file
name
> > > should be
> > > > > > given dynamically through program and the xl file should be
saved
> > > dynamically
> > > > > > through program. it should not ask for file name and it should
not
> > ask
> > > to
> > > > > > save.
> > > > > > Kindly let me know if any body has done this or any body knows
how
> > to
> > > do.
> > > > > > pls send me the code to vhari_krishna@rediffmail.com
> > > > > >
> > > > > > regards,
> > > > > > Hari,
> > > > > > vhari_krishna@rediffmail.com.
> > > > > >
> > > > > >
> > >
> > >
> >
> >
> >


Quantcast