2
Answers

datepicker value in pdf

scropio gurl

scropio gurl

8y
304
1

I have date-picker value now i want when i select value from date-picker and then click on button then want value in pdf which i select from date-picker this is what i try

Through this code i successfully export html data to pdf now i try to display datepicker in pdf

but i did not get the value

  1. <script type="text/javascript">  
  2.         jQuery(function ($) {  
  3.             $("#pdf").click(function () {  
  4.                 // parse the HTML table element having an id=exportTable  
  5.                 var dataSource = shield.DataSource.create({  
  6.                     data: "#fromdate",  
  7.                     schema:{  
  8.                         type:"input",  
  9.                         fields: {  
  10.                             fromdate:{type:Date}  
  11.                         }  
  12.                     },  
  13.   
  14.   
  15.                     data: "#tabledata",  
  16.                     schema: {  
  17.                         type: "table",  
  18.                         fields: {  
  19.                             ID: { type: String },  
  20.                             Owner: { type: String },  
  21.                             RegNo: { type: String }  
  22.   
  23.                         }  
  24.                     }  
  25.   
  26.                 });  
  27.   
  28.   
  29.                 // when parsing is done, export the data to PDF  
  30.                 dataSource.read().then(function (data) {  
  31.                     var pdf = new shield.exp.PDFDocument({  
  32.                         author: "PrepBootstrap",  
  33.                         created: new Date()  
  34.                     });  
  35.   
  36.                     pdf.addPage("a4""portrait");  
  37.   
  38.                     pdf.table(  
  39.                         50,  
  40.                         50,  
  41.                         data,  
  42.                         [  
  43.                             { field: "fromdate", title: "datetime", width: 70 },  
  44.                             { field: "ID", title: "ID", width: 70 },  
  45.                             { field: "Owner", title: "Owner", width: 100 },  
  46.                             { field: "RegNo", title: "RegNo", width: 70 }  
  47.   
  48.   
  49.                         ],  
  50.                         {  
  51.                             margins: {  
  52.                                 top: 50,  
  53.                                 left: 50  
  54.                             }  
  55.                         }  
  56.                     );  
  57.   
  58.                     pdf.saveAs({  
  59.                         fileName: "PrepBootstrapPDF"  
  60.                     });  
  61.                 });  
  62.             });  
  63.         });  
  64. </script>  
Answers (2)