Guest User

Untitled

a guest
May 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. convert() {
  2.  
  3. const doc = new jsPDF('p', 'pt', 'A4');
  4. const col = ['Discharge Date', 'Case Number', 'Patient', 'Hospital', 'Payee', 'Total Doctor Fee', 'To be Collected', 'Payor', 'Remarks', 'Paid', 'Unpaid'];
  5.  
  6. const rows = [];
  7.  
  8.  
  9. /* The following array of object as response from the API req */
  10.  
  11. const itemNew = this.finalArList;
  12.  
  13. itemNew.forEach(element => {
  14.  
  15. const temp = [element.dischargeDate, element.caseNo, element.patientName, element.instName, element.clinicName, element.formattedTotalDrFee, element.formattedUnpaidAmounr, element.payor, element.remark, element.formattedTotalDrFee, element.formattedUnpaidAmounr];
  16. rows.push(temp);
  17. doc.autoTable(col, rows, {margin: {top: 10}, height: 'auto' });
  18.  
  19. });
  20. doc.save('MyReport.pdf');
  21. }
Add Comment
Please, Sign In to add comment