mamelimail-jaspersoftyaho Posted November 21, 2018 Share Posted November 21, 2018 Hello community. I'm using TIBCO Jaspersoft® Studio 6.6.0.My report has a variable that sums the number of seconds of the records listed.In the summary group, I need to display this variable ($V{total_seconds}) with the format DD:HH:MM:SS.How should I do?Many thanks. Link to comment Share on other sites More sharing options...
mamelimail-jaspersoftyaho Posted November 21, 2018 Author Share Posted November 21, 2018 I solved using another post. Thank you. Link to comment Share on other sites More sharing options...
mjmapi Posted May 22, 2023 Share Posted May 22, 2023 This might not be a clean approach, but provides for your requirements,Just copy this into your text field in report and replace $V{Report_TotalDuration} with your seconds variableCONCATENATE(String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format( Math.floor($V{Report_TotalDuration}/(24*3600))))),'days:',INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60/60)% 24))<10? "0"+String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60/60)% 24))):String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60/60)% 24))),':',INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60) %60))<10? "0"+String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60) %60))):String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration}/60) %60))),':',INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration} % 60)))<10? "0"+String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration} % 60)))):String.valueOf(INTEGER_VALUE(new DecimalFormat("#,##0").format(Math.floor($V{Report_TotalDuration} % 60))))) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now