COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sg24 on 28 Mar 2011 01:20:20 AM

Title: Display Message when no records are returned
Post by: sg24 on 28 Mar 2011 01:20:20 AM
Hi ,

I have a list which has the master query and other 6 deatiled queries inside. I want to display a message when there are no records returned. I tried to create a boolean varaibale and displayed when Rownumber > 0 , display the whole list when false, hide it. But it doesn't work. Any ideas how this could be achieved?

Please suggest ASAP. Your response is highly appreciated.

thanks,
sg
Title: Re: Display Message when no records are returned
Post by: barrysaab on 28 Mar 2011 01:28:25 AM
It is pretty simple,in the properties select "No data content" to yes and drop a text in there and write whatever display message you intend to use.hope it helps.
Title: Re: Display Message when no records are returned
Post by: sg24 on 28 Mar 2011 02:16:26 AM
Thank you the response. But I do not have the property as i am using cognos version 8.

Any inputs ?

Title: Re: Display Message when no records are returned
Post by: bvk.cognoise on 28 Mar 2011 02:20:51 AM
Hi,
>create a report
>then select entire report using ancestor
>then select NODATA propertie in properties
>set No data property to yes
>then drag a text item into Page1 box
>then enter required message.
>runt the report

easyyyyyyyyyyyy :) no deed to use  variable

thanks
bvk
Title: Re: Display Message when no records are returned
Post by: bvk.cognoise on 28 Mar 2011 02:25:58 AM
Hi sorry for my first reply because i dont know which cognos version ur using before that reply ,then i came to know that.anyway follow these steps

1. Add Order Year, Order Method and Quantity to the list.
2. Add a filter to the list with the expression [Order year] = ?parYear?
3. Add a second list to the report, below the first list.
4. Add a Text Item to the second list.
5. For the Text property, simply click OK.
6. Unlock the report.
7. Drag a Text Item inside the List column title beside the words 'Text Item'.
8. Set the property for this Text Item to 'No data returned.'
9. Select the text beside this new Text Item ('Text Item') and delete this text from the List column title.
10. Select anywhere in the second list.
11. Click the ancestor button and choose list.
12. Set the Query property to Query1.
13. Click beside the Style Variable property and then click the elipses beside the Style Varible property.
14. Choose <New boolean vaiable> and click Ok for the Name Boolean1.
15. Set the Report Expression for this variable to '[Query1].[Order year] is null' and click Ok twice.
16. Point to the Conditional Explorer and Boolean1 -> No
17. Set the Box Type property to None.
18. Point to Page Explorer and Select Page1.
19. Having the 2nd list still selected, Select the Properties property and then click the elipses beside the Properties property.
20. In the dialog that appears, ensure that the check box beside Order Year is checked and click Ok.
21. Select anywhere in the first list.
22. Click the ancestor button and choose list.
23. Set the Style Variable property for this list to Boolean1.
24. Point to the Conditional Explorer and Boolean1 -> Yes.
25. Set the Box Type property for to None.
26. Run the report.
27. In the prompt for Order Year, type in 2006 and hit Ok.
28. You will see a report with the first list showing.
29. Run the report again and enter 2007 in the prompt and hit Ok.
30. This time, you will see a list column title only with the words 'No data returned.' displayed.

You can also substitute step 19 and 20 by skipping them and and after step 25 do the following.

25. a. Point to Page Explorer and Select Page1.
25. b. Click the ancestor button and choose Page
25. c. Set the Query property to Query1


thanks
bvk ;)
Title: Re: Display Message when no records are returned
Post by: sg24 on 28 Mar 2011 03:38:52 AM
Hi ,

Thank you for the reply. But i do not have only one list inside another list. I have one master list and 7 detailed lists in the report. i need to drag a text item and perform the same steps to all the lists?

Thanks.
Sg.
Title: Re: Display Message when no records are returned
Post by: bvk.cognoise on 28 Mar 2011 03:46:14 AM
yes u have to do it :)

bvk
Title: Re: Display Message when no records are returned
Post by: sg24 on 28 Mar 2011 04:17:29 AM
I did the same thing by using header and footer for the list. In the footer , the message "No data" is written. And created a boolean variable where Rownumber>0 when yes, display and when no, hide. It works perfectlly well. the message is displayed.

When i try to do the same thing for the whole list which contains master query and detailed lists it doesn't work.

It almost the same thing which u ahve suggested :)

thanks,
Sg