No data message for empty data source

5 posts, 1 answers
  1. Ravi
    Ravi avatar
    15 posts
    Member since:
    Jun 2012

    Posted 13 Jul 2012 Link to this post

    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
  2. Ravi
    Ravi avatar
    15 posts
    Member since:
    Jun 2012

    Posted 16 Jul 2012 Link to this post

    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
  3. Answer
    Elian
    Admin
    Elian avatar
    435 posts

    Posted 18 Jul 2012 Link to this post

    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 >

  4. Ravi
    Ravi avatar
    15 posts
    Member since:
    Jun 2012

    Posted 18 Jul 2012 Link to this post

    Thank you Elian  but I had figured it out for myself...But I appreciate your response.

    Thank you very much...
  5. Andy
    Andy avatar
    2 posts
    Member since:
    May 2018

    Posted 04 May 2018 in reply to Ravi Link to this post

    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

     

Back to Top