zeroCode-Excel Note
 
   
   
 
 
JavaScript in built sites

 
<script>
function sendtoexcel(){

var exApp;
exApp = new ActiveXObject("Excel.Application");
exApp.Visible=true; 
exApp.Workbooks.Add;
exApp.Worksheets.Add;
var ActiveSheet = exApp.Workbooks(1).Worksheets(1);
var i=2;
var j=4; 

exApp.ActiveSheet.Range("A2","Z2").Font.Bold=true; 
exApp.ActiveSheet.Cells(i,j).Value="Name";
j=j+2;


exApp.ActiveSheet.Cells(i,j).Value="Short Name";
j=j+2;


exApp.ActiveSheet.Cells(i,j).Value="Employee Type";
j=j+2;

exApp.ActiveSheet.Cells(i,j).Value="Department";
j=j+2;
i=i+2;
<list Employee.Employee as e1>
<assign id e1.Id>

var j=2; 
<assign cellContent e1.Id>
exApp.ActiveSheet.Cells(i,j).Value = ""; 

j=j+2; 


<assign cellContent e1.First_Name + " " +e1.Last_Name>
exApp.ActiveSheet.Cells(i,j).Value = "" + " "; 

j=j+2; 

<assign cellContent e1.Short_Name>

exApp.ActiveSheet.Cells(i,j).Value = ""; 

j=j+2; 


<assign id e1.Employee_Type__deref.derefValue>
exApp.ActiveSheet.Cells(i,j).Value = ""; 

j=j+2; 

<assign id e1.Department>
exApp.ActiveSheet.Cells(i,j).Value = ""; 

j=j+2; 

i=i+1;
</list>
var str1="/zcSite/faqx/auto/list/Employee.html"; 
window.location.href=str1;
}
</script>