473,624 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4146
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****@discuss ions.microsoft. com> wrote in message
news:1F******** *************** ***********@mic rosoft.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.Cur rent.Response.R edirect("file:///C:/myfile.xls")
HttpContext.Cur rent.Response.W ritefile("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****@discuss ions.microsoft. com> wrote in message
news:1F******** *************** ***********@mic rosoft.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
2890
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 that launches NewReport.xls in Excel. How?
3
41774
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: instead of either opening a file or creating a new one, I'd like to do BOTH. I was thinking of creating a loop where I could basically say something like: if $excelfile exists, then open $excelfile, otherwise, create a new workbook named...
6
6751
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 about the ability. If not, what advice can u provide? thank you in advance. ur help will be appreaciated.
4
3936
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 out at this point. What I have is this : Members.aspx file:
11
5589
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 how to have it open an excel document (or word, etc.) but do not know how to define which document to open. Dim ExApp As Object Set ExApp = CreateObject("Excel.Application") ExApp.Workbooks.Open FileName:="c:\file.xls",...
2
4931
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 FILE.xls, I want VB to open the file so it can be viewed and edited onscreen. If at all possible I'd additionally want to Access to run some
25
2872
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 a utility developed by Tony Toews to handle the distribution and subsequent updates of the software. I'm having some trouble with the overall upgrade process I've implemented, and I'm hoping one of you may have an idea how to go about fixing...
8
9640
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 import and the Excel file isn't open I get the following error: "The wizard is unable to access information in the file "...path info... "Please check that the file exists and is in the correct format." If the files are opened directly in Excel, it...
3
6660
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 network. Can I somehow save it to the client machine and then open it? What is the best method? (using Asp.net 2.0, vb.net)
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8482
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.