472,378 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

Open EXCEL file that exists on the network from a webcontrol

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
2 3998
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim | last post by:
This should really be simple, but I can't figure it out. I have some VB that exports a table in an Excel format ("C:\NewReport.xls"). After the export is done, I simply want to have some code...
3
by: sandycat05 | last post by:
Hello all, I am a new Perl programmer. Below is the beginnings of a code that I am using to manipulate an Excel spreadsheet via Perl using win32::OLE. However, what I'd like to do is the following:...
6
by: Daniel | last post by:
Hi all, Can i open and edit the excel sheet on web page after downloading? After editing, i close the web page and the excel file auto upload to the server. Is it possible? I really struggling...
4
by: Frank | last post by:
Hello All, I ham using VS.NET 2003. Have followed instructions from http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several other articles to no avail. I am pulling my hair...
11
blyxx86
by: blyxx86 | last post by:
Alright, I'm trying to create a form that would allow certain documents to be opened by selecting an option within a combo box and then having a single button to open the pertaining file. I know...
2
by: Jim | last post by:
This should be simple... I have Access export a query to an Excel file on the network at: Y:\Enterprise\CLD_OE\POP Database\FILE.xls After the visual basic code is done exporting the file to...
25
by: Andy_Khosravi | last post by:
I just recently changed my database that I'm running from a monolithic DB to a split FE/BE. The front end resides on the client machine and the BE resides on a network drive. I'm experimenting with...
8
by: shenkel55 | last post by:
I'm using Access and Excel 2003. Using either the import wizard or code, I have the same problem. This problem only happens with Excel files automatically generated by Corp IT. If I try to do an...
3
by: Mel | last post by:
How do I open an Excel file as a read only document? It would be okay if it opened in the browser window but I don't want the user to save any changes and stomp over my original file on the...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.