JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 8th, 2011, 08:47 PM
tsalama tsalama is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2011
Posts: 1 tsalama User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m
Reputation Power: 0
Unhappy Other - Coding Help: Display Excel Worksheets in a web page

I am trying to display a excel worksheet on a web page. I have four tabs (sheets) in one excel document that needs to be displayed separately in intervals. So in other words I would like to see Tab 1 displayed on a web page for 10 seconds, followed by tab 2 etc.... I want this to continue without stopping. This is the code I have right now. It displays only one tab.

<html>
<head>
<title>Cast App Dashboard</title>
<style type="text/css">
h1 {font-family: Tahoma; font-size: 24pt; text-align: center}
h2 {font-family: Tahoma; font-size: 16pt; text-align: center; font-weight:normal}
table {font-family: Tahoma; font-size: 7pt; text-align: center; background: black; border-width: 0 0 1px 1px; border-spacing: 0; border-collapse: collapse; border-style: solid; }
td {margin: 0;padding: 4px; border-width: 1px 1px 0 0; border-style: solid;}

</style>
<script>


function start() {

var excel = new ActiveXObject("Excel.Application");
var book = excel.Workbooks.Open("....xlsx");
var sheet = book.Sheets.Item(1);


var body = document.getElementsByTagName("body")[0];
var tbl = document.createElement("table");
var tblBody = document.createElement("tbody");

for (var j = 0; j < 9; j++) {
var row = document.createElement("tr");

for (var i = 0; i < 17; i++) {
var cell = document.createElement("td");
cell.style.background = "#E6E6E6";

var cellBackground = sheet.Cells(j+1,i+1).Interior.colorIndex;
if (cellBackground == 6) { cell.style.background = "#F7FE2E"; }
if (cellBackground == 37) { cell.style.background = "#2E64FE"; }
if (cellBackground == 43) { cell.style.background = "#088A08"; }
if (cellBackground == 3) { cell.style.background = "red"; }

var cellText = document.createTextNode(sheet.Cells(j+1,i+1).Value );
if (j==0) { cell.style.color = "white"; }
if (i<3 && j==0) { cell.style.background = "#424242"; }
if (i>=3 && i<6 && j==0) { cell.style.background = "#990000"; }
if (i>=6 && i<10 && j==0) { cell.style.background = "#2A120A"; }
if (i>=10 && j==0) { cell.style.background = "#0B173B"; }

cell.appendChild(cellText);
row.appendChild(cell);
}
tblBody.appendChild(row);
}

tbl.appendChild(tblBody);
body.appendChild(tbl);
tbl.setAttribute("border", "2");

excel.Quit();
}

</script>
</head>
<body onload="start()">
<h1>Cast App Dashboard</h1>
<h2>Sub-domain: Analytics</h2><br><br>

</body>
</html>

Any help would be appreciated.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Other - Coding Help: Display Excel Worksheets in a web page


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap