Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Proper aggregated file sizes(Proper aggregated file sizes)
Proper aggregated file sizes [message #647629] Fri, 07 January 2011 13:25 Go to next message
Daniel Ohlsson is currently offline Daniel OhlssonFriend
Messages: 2
Registered: January 2011
Junior Member
Hi

I'm creating a report with a table that lists the size of a bunch of files. These files vary greatly in size between KBs and GBs. Their size is given to me in bytes. Currently I format the file sizes into correct KB/MB/GB units with the Expression Builder.

But I also want a sum of the file sizes at the end of the table. I have created a Aggregation in the end of the table that sums the file sizes in bytes together. But I want that aggregation to also display correct units in either KB, MB or GB. I have noticed that the Expression Builder behaves differently for aggregations so I can't use the same solution for them.
Re: Proper aggregated file sizes [message #647643 is a reply to message #647629] Fri, 07 January 2011 14:30 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

In the aggregate items onCreate script use the setDisplayValue function
like:

//get the value
var myval =this.getValue();
//modify it and
this.setDisplayValue(myval +"Kb")

Jason

On 1/7/2011 8:26 AM, Daniel Ohlsson wrote:
> Hi
>
> I'm creating a report with a table that lists the size of a bunch of
> files. These files vary greatly in size between KBs and GBs. Their size
> is given to me in bytes. Currently I format the file sizes into correct
> KB/MB/GB units with the Expression Builder.
>
> But I also want a sum of the file sizes at the end of the table. I have
> created a Aggregation in the end of the table that sums the file sizes
> in bytes together. But I want that aggregation to also display correct
> units in either KB, MB or GB. I have noticed that the Expression Builder
> behaves differently for aggregations so I can't use the same solution
> for them.
Re: Proper aggregated file sizes [message #647793 is a reply to message #647629] Sun, 09 January 2011 09:46 Go to previous message
Daniel Ohlsson is currently offline Daniel OhlssonFriend
Messages: 2
Registered: January 2011
Junior Member
Thanks Jason. It did exactly what I needed.
Previous Topic:Data set window does not show synonym and nickname
Next Topic:REMOTE .rptdocument file
Goto Forum:
  


Current Time: Tue Apr 23 14:46:39 GMT 2024

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

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

Back to the top