Eclipse Community Forums Forum Search:

Home » Eclipse Projects » BIRT » how to calculate uptime as java expression
how to calculate uptime as java expression Tue, 19 July 2011 19:44
 kayanserdarMessages: 20Registered: 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?

Re: how to calculate uptime as java expression [message #698615 is a reply to message #698607] Tue, 19 July 2011 20:16
 Jason WeathersbyMessages: 9167Registered: 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
 kayanserdarMessages: 20Registered: April 2011 Junior Member
that works perfect
 Previous Topic: Changing a line style/width/color dynamically? Next Topic: Dynamic prefill of parameter
Goto Forum:

Current Time: Sun May 27 03:43:27 GMT 2018

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