473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 4133
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.