Displaying text in those columns whose value doesn't exist at all!!

9 posts, 0 answers
  1. HAREE
    HAREE avatar
    7 posts
    Member since:
    Dec 2011

    Posted 16 Apr 2012 Link to this post

    Hello,

    I have created a Master report and a sub report. The Master report has a few columns to be displayed. The sub report is displayed adjacent to the last column of the Master report which has another 2 columns such that when previewed it all appears together as if it is a single report. 

    The Sub report has a report parameter whose values are displayed based on one of the columns in the Master report called Column A. The report is absolutely working fine!! But, only some of the values of Column A has corresponding values in the Sub report columns. Most of the values in Column A haven't got any corresponding values in the sub report.Even null values doesn't exist in these sub report columns. So, when I try to preview the report, obviously, only the values that exist appear on the Sub report. And the rest of the columns in the Sub report appears blank which doesn't look great.

    So,  I would like to have a text displayed in those blank columns of the sub report like " Data not found". Please help me how to proceed further.


    Many Thanks,

    Haree
  2. Steve
    Admin
    Steve avatar
    10940 posts

    Posted 17 Apr 2012 Link to this post

    Hello Haree,

    Currently there is no out of the box solution to show a "Data not found" message when there is no data. however there is a workaround you can use instead. Just add a TextBox item within the Report Header section of the report used as subreport. Then set the textbox value to "Data not found". To hide the Report Header section when the datasource returns data, add a Binding with Property Path - Parent.Visible and Expression - =Count(1) = 0. To hide the Detail section when there are no records found you have to add a Binding with Property Path - Parent.Visible and Expression set to =Count(1) > 0.

    Kind regards,
    Steve
    the Telerik team
    NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
  3. HAREE
    HAREE avatar
    7 posts
    Member since:
    Dec 2011

    Posted 17 Apr 2012 Link to this post

    Hello Steve,

    Thanks very much for your quick response and solution!!!!

    I followed the instructions like you said. When there is no data returned, it perfectly appears as " No Data found". But, the problem is, when some data is returned, the data is not being displayed on the report. i.e. when the data is returned, both the header and the detail sections are hidden. So, "No Data found" text appears in the place of blank columns which is perfectly fine and the data which is supposed to be displayed is now disappeared resulting in new blank columns!!!.

    Could you help me to sort out this issue, please?? 


    Many Thanks,

    Haree
  4. HAREE
    HAREE avatar
    7 posts
    Member since:
    Dec 2011

    Posted 25 Apr 2012 Link to this post

    Hello Steve,

    I have figured it on my own. The solution you suggested was almost right.

    To hide the Report Header section when the datasource returns data,  a Binding with Property Path - Parent.Visible and Expression - =Count(1) = 0 should be added to the TextBox of the Header Section rather than adding it to the Header Section itself.

    And,to hide the Detail section when there are no records found, I have just followed your solution which is to add a Binding to the Detail Section with Property Path - Parent.Visible and Expression set to =Count(1) > 0 and it is working perfect!!.

    Thanks for your help, Steve. Really appreciate it!!!!!


    Thanks,

    Haree

  5. Sean Drun
    Sean Drun avatar
    6 posts
    Member since:
    Jun 2012

    Posted 29 Oct 2012 Link to this post

    Hi Steve,
    I am assigned to evaluate Telerik Reporting. Right now, I am converting our in house report to Telerik Reporting.
    I run into same problem but different layout.
    I have master - detail report. The detail are two Telerik.Reporting.Table contained in report detail section.
    If detail Table does not have data, either hide it or show "no data".
    Q1 - I tried hide the Table with setting Table.Visible to false in Table's NeedDataSource event.
    The Table is hidden but leave empty space taken up by Table's header/row textbox.
    I don't know how to shrink it.
    Q2 - Afterwards I tried to do "no data" approach.
    But mine is using Report.Table, standalone designer does not allow me to add another textbox to row area.
    Could you please help me to solve the problem?
    It would be nice you can provide solution to both Q1 and Q2.

    Thanks,
    Sean Drun
  6. Peter
    Admin
    Peter avatar
    1652 posts

    Posted 01 Nov 2012 Link to this post

    Hi Sean,

    Up to the "no data" message inquiry you can find a solution with sample project in the following thread: No data message for empty data-source.

    In your case, you can shrink the empty tables by setting them very small initial size. This way, the tables will grow if they have data and if they don't, they will take virtually no space. For the purpose, you need to set size to the table rows and all the items that are inside the row.

    Generally a table cell can contain only one item. If you want to add multiple items to a cell you have to use container item. Depending on the particular requirements the container can be a panel or another data item (table, list, crosstab or subreport)

    Additionally you may find useful the Design Considerations for Report Item Layout help article.

    All the best,
    Peter
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  7. Chris
    Chris avatar
    20 posts
    Member since:
    Nov 2013

    Posted 25 Mar 2014 in reply to Steve Link to this post

    When there is no data, the header doesn't show at all, so I'm unclear how the text box in the header would help. Please can you advise.
  8. Peter
    Admin
    Peter avatar
    1652 posts

    Posted 26 Mar 2014 Link to this post

    Hello Chris,

    The forum thread is from 2012 and is outdated. Currently Telerik Reporting data items support No Data Message functionality. For more information see: How to: Set a No Data Message help article.

    Regards,
    Peter
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  9. Andy
    Andy avatar
    2 posts
    Member since:
    May 2018

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

    Can you please show step by step instructions for this one?
Back to Top