Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » how to calculate uptime as java expression
how to calculate uptime as java expression [message #698607] Tue, 19 July 2011 19:44 Go to next message
kayanserdar is currently offline kayanserdarFriend
Messages: 20
Registered: April 2011
Junior Member
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 20:16 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 20:12 Go to previous message
kayanserdar is currently offline kayanserdarFriend
Messages: 20
Registered: April 2011
Junior Member
that works perfect Smile
Previous Topic:Changing a line style/width/color dynamically?
Next Topic:Dynamic prefill of parameter
Goto Forum:
  


Current Time: Tue Apr 16 16:24:46 GMT 2024

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

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

Back to the top