By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Open EXCEL file that exists on the network from a webcontrol

P: n/a
I have an ASP.NET page that invokes a web control written in C#. What I want
to do is (based on the session ID) display a certain spreadsheet that exists
on a
network drive. I want the webcontrol to open the spreadsheet using my
log on credentials since they won't have priviliges to access their particular
file from the network drive. BTW, I am guessing I will have to use HTTP as
this file exists in a Sharepoint document library.

I can use OLEDB but don't really want to rebuild the spreadsheet. I would like
to open the existing one for them so they could do what they wished with it.
It also contains many graphs and charts so I definitely would like to open the
existing one for them. I guess I could FTP the file locally and then open it
for them. Are there any other easier methods I can use to accomplish this?
Jun 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If it is a plain user control (no embedded activex objects) the best you can
do is read the data and push it out to the page formated with content type
excel. That will get your entire page, not your user control, as a
spreadsheet. To solve that problem, you can wrap the control in a frame and
stream the excel file to the frame instead.

On the other hand, if your user control is an activex object, OWC for
instance, you can simply read the file in from the share.

hope this helps

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Peter S." <Pe****@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
I have an ASP.NET page that invokes a web control written in C#. What I
want
to do is (based on the session ID) display a certain spreadsheet that
exists
on a
network drive. I want the webcontrol to open the spreadsheet using my
log on credentials since they won't have priviliges to access their
particular
file from the network drive. BTW, I am guessing I will have to use HTTP as
this file exists in a Sharepoint document library.

I can use OLEDB but don't really want to rebuild the spreadsheet. I would
like
to open the existing one for them so they could do what they wished with
it.
It also contains many graphs and charts so I definitely would like to open
the
existing one for them. I guess I could FTP the file locally and then open
it
for them. Are there any other easier methods I can use to accomplish this?

Jun 21 '06 #2

P: n/a
It sounds reasonable. So would I pull the file using the Excel .COM library
then push that out to the frame? Are there any examples out there that you
might be able to point me to?

The ultimate would be to open up another browser window. I tried both
HttpContext.Current.Response.Redirect("file:///C:/myfile.xls")
HttpContext.Current.Response.Writefile("file:///C:/myfile.xls")
but nothing happened. What I am thinking of doing is mapping a local
network drive and replace "C:" with "I:" for example.

"Alvin Bruney [MVP]" wrote:
If it is a plain user control (no embedded activex objects) the best you can
do is read the data and push it out to the page formated with content type
excel. That will get your entire page, not your user control, as a
spreadsheet. To solve that problem, you can wrap the control in a frame and
stream the excel file to the frame instead.

On the other hand, if your user control is an activex object, OWC for
instance, you can simply read the file in from the share.

hope this helps

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Peter S." <Pe****@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
I have an ASP.NET page that invokes a web control written in C#. What I
want
to do is (based on the session ID) display a certain spreadsheet that
exists
on a
network drive. I want the webcontrol to open the spreadsheet using my
log on credentials since they won't have priviliges to access their
particular
file from the network drive. BTW, I am guessing I will have to use HTTP as
this file exists in a Sharepoint document library.

I can use OLEDB but don't really want to rebuild the spreadsheet. I would
like
to open the existing one for them so they could do what they wished with
it.
It also contains many graphs and charts so I definitely would like to open
the
existing one for them. I guess I could FTP the file locally and then open
it
for them. Are there any other easier methods I can use to accomplish this?


Jun 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.