Skip to main content



      Home
Home » Archived » BIRT » how to calculate uptime as java expression
how to calculate uptime as java expression [message #698607] Tue, 19 July 2011 15:44 Go to next message
Eclipse UserFriend
Hi there, i am working on a report in BIRT where i need to calculate uptime as below in BIRT.
Up time= number of days per month X 23 X 60
I would like to have this calculation in one of computed columns as java expression and as number of days in a month change, formula should calculate accordingly.

i.e Up time for june = 30 * 23 * 60
uptime for July = 31 * 23 * 60

can you please assist to create this logic as java expression in BIRT?

Thanks in advance.
Re: how to calculate uptime as java expression [message #698615 is a reply to message #698607] Tue, 19 July 2011 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Can you try an expression like:

importPackage(Packages.java.util);
cal = new GregorianCalendar();
cal.setTime(new Date());
days = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
days*23*60;

Jason

On 7/19/2011 3:44 PM, forums-noreply@eclipse.org wrote:
> Hi there, i am working on a report in BIRT where i need to calculate
> uptime as below in BIRT.
> Up time= number of days per month X 23 X 60
> I would like to have this calculation in one of computed columns as java
> expression and as number of days in a month change, formula should
> calculate accordingly.
>
> i.e Up time for june = 30 * 23 * 60
> uptime for July = 31 * 23 * 60
>
> can you please assist to create this logic as java expression in BIRT?
>
> Thanks in advance.
>
Re: how to calculate uptime as java expression [message #699096 is a reply to message #698615] Wed, 20 July 2011 16:12 Go to previous message
Eclipse UserFriend
that works perfect Smile
Previous Topic:Changing a line style/width/color dynamically?
Next Topic:Dynamic prefill of parameter
Goto Forum:
  


Current Time: Wed Jul 23 16:28:04 EDT 2025

Powered by FUDForum. Page generated in 0.03433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top