This is a migrated thread and some comments may be shown as answers.

No data message for empty data source

4 Answers 855 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 13 Jul 2012, 08:14 PM
I would like to display "No data available message" for my empty datasource   for a cross tab report and I found this link helpful

http://www.telerik.com/community/forums/reporting/telerik-reporting/conditionally-display-message-if-no-results-found.aspx

But i am not able find where i can do the bindings for the textbox item....has this changed in the new version of telerik reporting..Please guide me... i.e in the  textbox properties->bindings->property path i am not able to find parent.visible....

thank you

4 Answers, 1 is accepted

Sort by
0
Ravi
Top achievements
Rank 1
answered on 16 Jul 2012, 09:41 PM
I have a crosstab in the detail section that is populated by data source CustomerDataSource
and another datasource called ddlCustomerNames which provides drop down options to my parameter CustomerName

So I addded a  Text Box in the Report header with value="No Data" and the set in its bindings
 Parent.Visible
 =Count(1) = 0

and in the bindings of the crosstab i added this
Parent.Visible
 =Count(1) > 0

Bu doing this my cross tab is always being hidden and the NO Data"textbox keeps on showing...

Is there someone who can help me with this...Thank you
0
Accepted
Elian
Telerik team
answered on 18 Jul 2012, 08:02 AM
Hi Ravi,

To your first question: not all properties that can be bound are listed but if you type them manually the statement will be executed. The Parent property points to the direct parent of the current item in this case the ReportHeader. If you want to hide the TextBox only, you can use the following binding:
Property Path         Expression 
Visible                     =Count(1) = 0

This approach works only if you have DataSource assigned to the Report. Because Count(1) will count all the rows in the DataSource of the current context. If you do not have DataSource set on the Report, Count() == 0 always.

In your case you are using crosstab data item, so you have to change the place of the error TextBox. Since you want to count the items coming from the DataSource of the Crosstab, your TextBox must be inside a second Crosstab (List or Table also works) which you can bind to the same DataSource. This additional Crosstab will contain the "No data" TextBox and will only be visible if the count of the items == 0.

Find attached a modified version of our sample report ProductSales demonstrating the described approach. Note items textBox1 and textBox2 that have defined bindings each affecting the visibility of its parent crosstab. The bindings evaluate alternatively to true and false hiding both crosstabs alternatively. Note the "SELECT TOP 0" in the data source query simulating the no data case.
 
Kind regards,
Elian
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Ravi
Top achievements
Rank 1
answered on 18 Jul 2012, 03:19 PM
Thank you Elian  but I had figured it out for myself...But I appreciate your response.

Thank you very much...
0
Andy
Top achievements
Rank 1
answered on 04 May 2018, 09:16 PM

How did you figure this out.

I am trying to hide the attached screen shots, crosstab to show "no data returned" when there's no data, but I guess crosstab space are making it harder. so getting crosstab space headers as shown in screen shot 2 instead.

Please advise

 

Tags
General Discussions
Asked by
Ravi
Top achievements
Rank 1
Answers by
Ravi
Top achievements
Rank 1
Elian
Telerik team
Andy
Top achievements
Rank 1
Share this question
or