473,396 Members | 1,918 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,396 software developers and data experts.

Showing Excel Sheet on Webpage

Hello Friends
I am using asp.net 2005 C#,I have to show a Excel Sheet on my Webpage,how can i do it.
Aug 6 '07 #1
4 5919
ammoos
100 100+
pls try this if u want to display as exsisting excelsheet in ur asp.net page

write the following code on the asp.net code page

lnkViewSpreadsheet.Attributes.Add("onclick","openE xcel('"+ excelSheetName +"')");

in this example 'lnkViewSpreadsheet' is a link button.. and the excelSheetName is the fullpath of the excel file

and then write the following javascript inthe asp.net html page


<script language=JavaScript>
<!--
onerror=handleErr
var txtErr=""
function handleErr(msg,url,l)//Function to handle errors
{
txtErr="There was an error on this page.\n\n"
txtErr+="Error: " + msg + "\n"
txtErr+="URL: " + url + "\n"
txtErr+="Line: " + l + "\n\n"
txtErr+="Click OK to continue.\n\n"
alert(txtErr)
return true

}
function openExcel(strExcelFile)// function to open the selected excel file

{
var excelApplication = new ActiveXObject("Excel.Application");//create the object of the excel
if (excelApplication != null)
{
excelApplication.visible = true;
excelApplication.workbooks.open(strExcelFile);// open the selected file
}
}
</script>
Aug 6 '07 #2
kenobewan
4,871 Expert 4TB
Please outline the problem that you are having. Thanks.
Aug 6 '07 #3
pls try this if u want to display as exsisting excelsheet in ur asp.net page

write the following code on the asp.net code page

lnkViewSpreadsheet.Attributes.Add("onclick","openE xcel('"+ excelSheetName +"')");

in this example 'lnkViewSpreadsheet' is a link button.. and the excelSheetName is the fullpath of the excel file

and then write the following javascript inthe asp.net html page


<script language=JavaScript>
<!--
onerror=handleErr
var txtErr=""
function handleErr(msg,url,l)//Function to handle errors
{
txtErr="There was an error on this page.\n\n"
txtErr+="Error: " + msg + "\n"
txtErr+="URL: " + url + "\n"
txtErr+="Line: " + l + "\n\n"
txtErr+="Click OK to continue.\n\n"
alert(txtErr)
return true

}
function openExcel(strExcelFile)// function to open the selected excel file

{
var excelApplication = new ActiveXObject("Excel.Application");//create the object of the excel
if (excelApplication != null)
{
excelApplication.visible = true;
excelApplication.workbooks.open(strExcelFile);// open the selected file
}
}
</script>


Hi Thanks for the Quick Reply but I dont want to open that excel sheet in excel,I want to just show it on the same web page...For Exapmle I have a excel sheet say Book1.xls.Now when My web page loads than first of all io want to Boook1.xls on the same webpage.How can i do it.
Aug 6 '07 #4
Please outline the problem that you are having. Thanks.
Hi,
When My pageloads i have to show a excel sheet on the same webpage,is there any way to show the Complete Excel sheet on webpage.
Aug 6 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
3
by: Jeremy | last post by:
Hi, I have a webpage that is taking input from a form and using it as criteria to select data out of an sql database. The page displays an html table with the results. The user can then click a...
3
by: nicholas | last post by:
What would be the best and easiest way to implement a web page that allows me to: - import an Ms Excel-sheet in a database on a Ms Sql 2000 Server - this should be done through an asp.net...
5
by: Narshe | last post by:
Is there a way to have an excel sheet inside a web page? I don't mean have it prompt for open or save, then open in the browser, but an actual mini excel sheet that can be edited. Maybe through...
1
by: RickH | last post by:
..Cells(1,y).GetType ownly shows instead of .Value, .Copy, etc. The code below is derived from samples, it should work, but I've messed up somewhere... Imports System.Windows.Forms Imports...
9
by: smk17 | last post by:
I'm not even sure what to put in the Subject for this. Here is what I'm doing and what I need to know I've made a website about high school basketball in New York State. One thing I want to...
5
by: Rishika14 | last post by:
Hi, Somebody pls tell me how to export data from webpage to excel sheet using java script. rishika
2
by: fluff | last post by:
Hello Is there a way to connect to an excel file and just display a certain chart or graph or sheet? I can make a hyperlink to the excel and open the whole thing, but it would be nice to just...
9
by: totomalas | last post by:
I want to develop a webpage that works like an Excel sheet... it has some textbox where the visitor can enter numbers inside them, then presses on a button "calculate"...then it gives the result...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.