Skip to main content



      Home
Home » Archived » BIRT » Total.count or aggregation count do not return zero when a table is empty
Total.count or aggregation count do not return zero when a table is empty [message #257478] Mon, 08 October 2007 10:24 Go to next message
Eclipse UserFriend
Originally posted by: lduriez.stva.com

Hi,

We are currently trying to migrate from 2.1.2 to 2.2.1.

When used in a table, it seems that Total.count() in a data element does
not display anymore the value "0" when the table is empty.
We have tried to use the new aggregation count function but the behaviour
is identical, the aggregation only displays values for non-empty tables.

How can we display "0" as a total number for the rows of an empty table ?
(it used to work in 2.1.2)

Thanks

Lionel
Re: Total.count or aggregation count do not return zero when a table is empty [message #257600 is a reply to message #257478] Mon, 08 October 2007 21:46 Go to previous messageGo to next message
Eclipse UserFriend
Hi Lionel,

Is your table binding with a dataset? Or the empty table you mean is a
table without binding a dataset?
Re: Total.count or aggregation count do not return zero when a table is empty [message #257641 is a reply to message #257600] Tue, 09 October 2007 04:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lduriez.stva.com

Hi Tianli,

The table is binded to a dataset(using oracle JDBC driver).

When the SQL query returns rows both Total.count() and the aggregation
count methods work fine.

When the query does not return any row Total.count() and the aggregation
count do not display "0".

The Total.count() method used to return value "0" in BIRT version 2.1.2.

Is it a bug?

Is there a workaround to be able to display that the number of lines is
zero when the dataset is empty?

Thanks

Lionel
Re: Total.count or aggregation count do not return zero when a table is empty [message #257835 is a reply to message #257641] Wed, 10 October 2007 12:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lduriez.stva.com

I figured out what was going wrong in our report,

The following data elements had been deleted in the designer but were
still present in the XML under the cell element containing the aggregation.

<structure>
<property name="name">NbEP</property>
<expression name="expression">Total.count()</expression>
<property name="dataType">any</property>
</structure>
<structure>
<property name="name">NbTotalEP</property>
<expression name="expression">Total.count()</expression>
<property name="dataType">string</property>
</structure>

Removing by hand these structures in the XML fixed the problem.

So actually it seems that the bug is related to the designer which does
not handle properly all the changes made on the report.
For people having the same kind of problems my advice is to look for
errors in the XML because the designer does not show everything.
Re: Total.count or aggregation count do not return zero when a table is empty [message #257887 is a reply to message #257641] Wed, 10 October 2007 20:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi Lionel,

I have tried your case in the latest build, I can get the 0 when the query
returns no value. Which build have you used?

Re: >>Is there a workaround to be able to display that the number of lines
is zero when the dataset is empty?

Yes, there is a expression in expression builder named row.__rownum. It
will return the index of row. you can use it to display your line number.
Expression builder->Available Column Bindings->Table->row.__rownum

Regards!
Re: Total.count or aggregation count do not return zero when a table is empty [message #257906 is a reply to message #257887] Thu, 11 October 2007 03:44 Go to previous message
Eclipse UserFriend
Originally posted by: lduriez.stva.com

Hello,

Thanks for your help.
As stated in my previous message I managed to find out what the problem
was, it was related to the designer not showing data elements that were
present in the XML. The aggregation function works fine indeed when the
query returns no row.

Regards,
Lionel
Previous Topic:lower - upper case in column names are a problem
Next Topic:adding a page break inside a table
Goto Forum:
  


Current Time: Sat Jun 07 01:45:27 EDT 2025

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

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

Back to the top