BusinessObjects Board

How to display 0 in one row when there is no data in query

I am facing one issue. I have this query which i am running. The problem is i want to show atleast 1 row with “0” in it if the query returns no data. When the query returns no data the report is empty… i mean it shows only headers and then no rows in the report. So in this case, if report is empty i want to show at least one row with something in it like 0. :hb:

Any help?

Thanks a lot

karan_aries (BOB member since 2005-02-17)

By the way i also tried isnull function . Something like

=If(Isnull()) then 0 else .

Count is number of the rows if there is data.

This doesn’t work either. The formula works but it doesn’t show 0 in the place when there are no records. :reallymad:

karan_aries (BOB member since 2005-02-17)

You have to create another table… with a single row hard coded…

Display this table when the query returns 0 records… and hide the original table. You have to add a boolean expression on both the tables to automatically HIDE and SHOW.

BO_Chief :us: (BOB member since 2004-06-06)

This won’t even work. I tried it before i asked this question. But i found the solution guys…i created another query with just count of rows and used case statement to say that if “count>1 then count else 0 end”.
I used this count in the bottom of the report to show atleast one field which will be count and will show 0 if there is no data. :lol:

karan_aries (BOB member since 2005-02-17)

You could have just used the numberofrows(dataprovider) function in a free standing cell as

= If NumberOfRows("Query1") = 0  Then "No Data"  Else  " " 

And there is no need to create a second query for that


haider :es: (BOB member since 2005-07-18)

Or even better,

you can right click the column and choose format cell.
Then, in the format number, choose the number category, and put 0 on Undefined.

rjac :portugal: (BOB member since 2008-09-22)

Can you pls explain in brief how you have created extra query to display '0 'when there is no data to display in data provider.

I dont want to insert any free-standing cells at report level OR even dont want to hard code the values…

Need to display the table with one row with ‘No data’ OR ‘0’ message,when the data provider returns empty…

m_shamanth :india: (BOB member since 2007-07-25)

What Hyder said is the only way at the report level, though you have someother alternatives that were discussed here:

Jansi :india: (BOB member since 2008-05-12)