LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: edwinantonykc on April 26, 2018, 02:38:30 pm
-
I am creating a Invoice using lime report. I need to make a date calculation here.
I have two variables InvoiceDate and DueDate. Assume the InvoiceDate is 26-04-2018 and DueDate is 15 then, I need to calculate 15 days from 26-04-2018 and show the result 11-05-2018 in a Text Item. Is that possible to do in the report?. Kindly help me.
-
Hi!
You can add this javascript function to init script
function addDate(date, dayCount){
var lDate = new Date(date);
lDate.setDate(lDate.getDate()+dayCount);
return lDate;
}
and use it in TextItem like this:
$S{dateFormat(addDate(now(),15))}
-
Hello,
Thank you very much for the reply and solution. Great job.. All the best and success
Regards,
Edwin Antony