简体   繁体   中英

How can I pull information from 2 different excel cells on the same worksheet using javascript? I

<script language="javascript" >
function GetData(cell,row){
var excel = new ActiveXObject("Excel.Application");
var excel_file = excel.Workbooks.Open("I:Work/database/72550.xls");
var excel_sheet = excel.Worksheets("CA 2012-2013 HMO Plans");
var data = excel_sheet.Cells(cell,row).Value;
document.getElementById('div1').innerText =data;
}
</script>

<input type="button" value="Hearing Services" onClick="GetData(45,2);" />

This is all in a table but I didn't think it was nec to display that, and of course file names are changed. All I need to know is how to pull from two cells at once from the same work sheet to display on a webpage. I got it working put only from one cell. How can I add another cell data to my result text?

is easier to take all the information inside a database, and do a cross join, as you usuing java, i recommend you use oracle, and so a simple cross join, depends on the head text of your excel sheets. inside your code use odbc connection, you can simple get the connection part if you connect your database inside the sql developer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM