Click here to Skip to main content
15,566,615 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html id="Htm1" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

<script type="text/javascript" >

function exportToExcel() {

//copy innerHTML of YourTable to strCopy Variable.
debugger;
var strCopy = document.getElementById("anil").outerHTML;


// clickExcel

//getElementById("Bdy1").innerHTML;
//copy strCopy to clipboardData, this

window.clipboardData.setData("Text", strCopy);

var objExcel = new ActiveXObject("Excel.Application");

objExcel.visible = true;

var objWorkbook = objExcel.Workbooks.Add;

var objWorksheet = objWorkbook.Worksheets(1);
objWorksheet.Paste;

}





//
// var tableToExcel = (function() {
// var uri = 'data:application/vnd.ms-excel;base64,'
// , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:excelworkbook xmlns:x="#unknown"><x:excelworksheets><x:excelworksheet><x:name>{worksheet}<x:worksheetoptions><x:displaygridlines></xml><![endif]--></head><body>{table}
</body></html>'
// , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
// , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
// return function(table, name) {
// if (!table.nodeType) table = document.getElementById(table)
// var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
// window.location.href = uri + base64(format(template, ctx))
// }
//})()
function clickExcel_onclick() {

}

</script>

<style type="text/css" userdata="Global">
body
{
font-size: 12pt;
font-family: Calibri;
padding : 10px;
}

table
{
border: 1px solid black;

}
th
{
border: 1px solid black;
padding: 5px;
color: white;

}
td
{
border: 1px solid black;
padding: 5px;
}

div.menu1c {
border-color: #f00 #f00 #f0a35d #f00;
border: solid 2px;
height: 19px;
}

.content {
height:75%;
width:50%;
border-color:maroon;
border-style:solid;
border-width:1px;
float:left;
}

div.example
{

margin-left: 5px;
height: 100px;
width: 100px;
border: 2px solid black;

}

input
{
font-size: 12pt;
font-family: Calibri;
}
</style>

</head>
<body>
<form id="form1" runat="server">


rules="groups" frame="hsides" border="2">



CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page

ID
Name
ACP
OEMCP
Windows

NT 3.1
Windows

NT 3.51
Windows

95
1200
Unicode (BMP of ISO/IEC-10646)
X
X
*
1250
Windows 3.1 Eastern European
dewfrwerf

sdwedf

X

fdgdhg

dewfrwerf

sdwedf

fdgdhg

dewfrwerf

sdwedf

fdgdhg

dewfrwerf

sdwedf

X
1251
Windows 3.1 Cyrillic
fdgdhg

dewfrwerf

sdwedf

fdgdhg

dewfrwerf

sdwedf

fdgdhg

dewfrwerf

sdwedf

fdgdhg

dewfrwerf

sdwedf

1252
Windows 3.1 US (ANSI)
fdgdhg

dewfrwerf

sdwedf

X
X
X
1253
Windows 3.1 Greek
X
X
X
X
1254
Windows 3.1 Turkish
X
X
X
X
1255
Hebrew
X
X
1256
Arabic
X
X
1257
Baltic
X
X
1361
Korean (Johab)
X
**
X
437
MS-DOS United States
X
X
X
X
708
Arabic (ASMO 708)
X
X
709
Arabic (ASMO 449+, BCON V4)
X
X
710
Arabic (Transparent Arabic)
X
X
720
Arabic (Transparent ASMO)
X
X

<input id="clickExcel" type="button" style="height:35px;width:189px" value="BtnExport" onclick="javascript:exportToExcel();" önclick="return clickExcel_onclick()" />

</form>
</body>
</html>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900