Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Why don't display 0 in aggregate information
Why don't display 0 in aggregate information [message #989875] Sun, 09 December 2012 01:53 Go to next message
Hunter Lee is currently offline Hunter LeeFriend
Messages: 10
Registered: December 2012
Junior Member
Hi,

The version is 4.2.1. I use it in a windows7 32bit OS.

In a sales report every week, I group date by region to display sales subtotals by region. In Aggregation Builder, i use the SUM function to compute the sum. If there is no records in a region, then, it will not display 0, but nothing(a blank table cell). So, in script, I select the 'onCreate', then entry script statement as below,
if(this.getValue()==null){
this.setDisplayValue("0");
}

It will display 0 in report designer, but display nothing(a blank table cell) in IE or Chrome when i deployed the report in a Tomcat.

I greatly appreciate all help.
Thanks.

[Updated on: Sun, 09 December 2012 01:54]

Report message to a moderator

Re: Why don't display 0 in aggregate information [message #989898 is a reply to message #989875] Sun, 09 December 2012 17:07 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Can you attach a report showing your issue, that uses the sample database, so I can see the setup and test on it? Thanks.

Michael

Developer Evangelist, Silanis
Re: Why don't display 0 in aggregate information [message #990010 is a reply to message #989898] Mon, 10 December 2012 13:15 Go to previous messageGo to next message
Hunter Lee is currently offline Hunter LeeFriend
Messages: 10
Registered: December 2012
Junior Member
Hi Michael,

I used the sample database to make a cross table report, as the sample of BIRT Report Developer Guide. When you click 'EXTENDED_PRICE_s...', and choose 'Script' in the editor, after that select the 'onCreate', then you will see script statements.

It displayed 0 by Preview in report designer. It displayed nothing(a blank table cell) in IE or Chrome when i deployed the report in a Tomcat, via the URL '.../MyApp/frameset?__report=/displaySample.rptdesign'.

Thanks!
Hunter.


Re: Why don't display 0 in aggregate information [message #990076 is a reply to message #990010] Mon, 10 December 2012 18:12 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Instead of using script, use the mapping option to set your condition. Click on your data element and go to the map section in the property editor. Make a condition for "value of this data item" equal to null -> 0. That should do it.

Michael

Developer Evangelist, Silanis
Re: Why don't display 0 in aggregate information [message #990130 is a reply to message #990076] Tue, 11 December 2012 03:07 Go to previous messageGo to next message
Hunter Lee is currently offline Hunter LeeFriend
Messages: 10
Registered: December 2012
Junior Member
It works well.
Thank you.
Re: Why don't display 0 in aggregate information [message #990135 is a reply to message #990130] Tue, 11 December 2012 03:48 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Glad I was able to help!

Michael

Developer Evangelist, Silanis
Previous Topic:Not receiving an error message on failure to create New Data Set
Next Topic:Postscript font changed
Goto Forum:
  


Current Time: Fri Nov 08 23:20:27 GMT 2024

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

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

Back to the top