Recent

Custom Controls Using Angular Material

Git Repo:  https://github.com/yawahang/ohcontrols Features DatePicker (Date Picker, Time Picker, Date Time Picker, and many more) RatingPicker (Vertical, Horizontal, Custom Icons) Select (Single Select, MultiSelect, Single Column, MultiColumn) Recursive Treeview

Html to Excel

<table id="tableId">
  <thead>
    <tr>
      <th>HireDate</th>
      <th>Organization</th>
      <th>Skill</th>
      <th>Office</th>
      <th>DOB</th>
      <th>Department</th>
      <th>Status</th>
      <th>Recruiter</th>
      <th>since</th>
      <th>JobPortal</th>
      <th>Task</th>
      <th>Address</th>
      <th>SSN</th>
      <th>Title</th>
      <th>ContactInformation</th>
      <th>PersonId</th>
      <th>Name</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>null</td>
      <td> sadfas</td>
      <td>asd</td>
      <td>asdf</td>
      <td>asd</td>
      <td>asdfasde</td>
      <td>dfd</td>
      <td>asdf</td>
      <td>6</td>
      <td>dsfsdf</td>
      <td>0/15</td>
      <td>asdfasd</td>
      <td>564221111</td>
      <td>ddfd</td>
      <td>test@dff.com</td>
      <td>648218</td>
      <td>TEST asdf</td>
    </tr>
  </tbody>
</table>
<div id="editor"></div>
<button id="cmd">generate Excel</button>

$('#cmd').click(function() {
    var str = '<table><thead="color:red"><tr><th>HireDate</th><th>Organization</th><th>Skill</th><th>Office</th><th>DOB</th><th>Department</th><th>Status</th><th>Recruiter</th><th>since</th><th>JobPortal</th><th>Task</th><th>Address</th><th>SSN</th><th>Title</th><th>ContactInformation</th><th>PersonId</th><th>Name</th></tr></thead><tbody><tr><td>null</td><td> sadfas</td><td>asd</td><td>asdf</td><td>asd</td><td>asdfasde</td><td>dfd</td><td>asdf</td><td>6</td><td>dsfsdf</td><td>0/15</td><td>asdfasd</td><td>564221111</td><td>ddfd</td><td>test@dff.com</td><td>648218</td><td>TEST asdf</td></tr></tbody></table>';
    // 1, pass string directly
    window.open('data:application/vnd.ms-excel,' + encodeURIComponent(str));
    // 2, search by id, with extra proprties
    // https://bl.ocks.org/Flyer53/1de5a78de9c89850999c
  });



Comments

Top Posts

SQL Server Symmetric Key & Certificate based Encryption With AES_256 Algorithm

Kendo Grid Angular Column Width, minResizableWidth dynamic

Kendo Grid AutoFit Columns