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
- <script type="text/javascript">
- jQuery(function ($) {
- $("#pdf").click(function () {
-
- var dataSource = shield.DataSource.create({
- data: "#fromdate",
- schema:{
- type:"input",
- fields: {
- fromdate:{type:Date}
- }
- },
-
-
- data: "#tabledata",
- schema: {
- type: "table",
- fields: {
- ID: { type: String },
- Owner: { type: String },
- RegNo: { type: String }
-
- }
- }
-
- });
-
-
-
- dataSource.read().then(function (data) {
- var pdf = new shield.exp.PDFDocument({
- author: "PrepBootstrap",
- created: new Date()
- });
-
- pdf.addPage("a4", "portrait");
-
- pdf.table(
- 50,
- 50,
- data,
- [
- { field: "fromdate", title: "datetime", width: 70 },
- { field: "ID", title: "ID", width: 70 },
- { field: "Owner", title: "Owner", width: 100 },
- { field: "RegNo", title: "RegNo", width: 70 }
-
-
- ],
- {
- margins: {
- top: 50,
- left: 50
- }
- }
- );
-
- pdf.saveAs({
- fileName: "PrepBootstrapPDF"
- });
- });
- });
- });
- </script>