excel name missing issue fix

This commit is contained in:
Surendiran 2023-09-27 12:34:50 +05:30
parent babbc9d132
commit 1c307c6f60
4 changed files with 54 additions and 17 deletions

Binary file not shown.

View File

@ -250,9 +250,22 @@ if(order.length>0){
}
download(){
var element = document.getElementById('table');
// Create a new date object using the selectDate value
const selectedDate = new Date(this.selectDate[0]);
// Get the year, month, and day components
const year = selectedDate.getFullYear();
const month = String(selectedDate.getMonth() + 1).padStart(2, '0'); // Add leading zero if needed
const day = String(selectedDate.getDate()).padStart(2, '0'); // Add leading zero if needed
// Format the components as "yyyy-mm-dd"
const formattedDate = `${day}-${month}-${year}`;
console.log(formattedDate);
var opt = {
margin: 1,
filename: 'sheet.pdf',
filename: 'Delivery_Sheet_'+formattedDate+'_'+this.driverName,
image: { type: 'jpg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }

View File

@ -308,14 +308,26 @@ if(order.length>0){
}
download(){
console.log(this.driverName,this.selectDate[0])
// Create a new date object using the selectDate value
const selectedDate = new Date(this.selectDate[0]);
// Get the year, month, and day components
const year = selectedDate.getFullYear();
const month = String(selectedDate.getMonth() + 1).padStart(2, '0'); // Add leading zero if needed
const day = String(selectedDate.getDate()).padStart(2, '0'); // Add leading zero if needed
// Format the components as "yyyy-mm-dd"
const formattedDate = `${day}-${month}-${year}`;
console.log(formattedDate);
var element = document.getElementById('table');
var opt = {
margin: 1,
filename: 'sheet.pdf',
image: { type: 'jpg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};
var opt = {
margin: 1,
filename: 'Return_Sheet_'+formattedDate+'_'+this.driverName,
image: { type: 'jpg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};
// New Promise-based usage:
html2pdf().from(element).set(opt).save();

View File

@ -282,14 +282,26 @@ console.log(result)
}
download(){
var element = document.getElementById('table');
var opt = {
margin: 1,
filename: 'sheet.pdf',
image: { type: 'jpg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};
console.log(this.driverName,this.selectDate[0])
// Create a new date object using the selectDate value
const selectedDate = new Date(this.selectDate[0]);
// Get the year, month, and day components
const year = selectedDate.getFullYear();
const month = String(selectedDate.getMonth() + 1).padStart(2, '0'); // Add leading zero if needed
const day = String(selectedDate.getDate()).padStart(2, '0'); // Add leading zero if needed
// Format the components as "yyyy-mm-dd"
const formattedDate = `${day}-${month}-${year}`;
console.log(formattedDate);
var element = document.getElementById('table');
var opt = {
margin: 1,
filename: 'Delivery_Summary_'+formattedDate+'_'+this.driverName,
image: { type: 'jpg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};
// New Promise-based usage:
html2pdf().from(element).set(opt).save();