Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

How to hide Main report row if Sub report returns no data in SSRS 2008 R2

Posted on by 1,145

Hi,

How to hide Main report row if Sub report returns no data in SSRS 2008 R2 need help.

Thanks in Advance

Sekar V

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to hide Main report row if Sub report returns no data in SSRS 2008 R2

    Hi Sanjay,

    I am facing same issue i did merging all  columns of the row where the sub report is included and at the merged cell of the row insert the sub report and then set the visibility property like =IIF(RowNumber(Nothing)>0,False,True) here problem is Nothing represents scope of main report but i am expecting scope of sub report which i can't access . I need solution of this if anyone of you can help please respond....

    Thanks...

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to hide Main report row if Sub report returns no data in SSRS 2008 R2

    Sekar,

    RowNumber returns a running value of the count of rows within the specified scope, just as RunningValue returns the running value of an aggregate function.

    Read this article, technet.microsoft.com/.../dd255249.aspx for more detail.

    You should be able to hide the sub report if the rowcount is 0 by setting the sub reports visibility property.

    Looks like you have inserted a tablix and in one of the row , column you have inserted a sub report. Suggest you first merge all the columns of the row where the sub report is to be included, and at the merged cell of the row insert the sub report and then set the visibility property.  The sub report will print only if there is a value other wise the a blank report will not be printed.

    You also take a screen shot of the report design post it here so that we can see the design  you are attempting to implement.

    Cheers!

    Sanjay

  • Mike Smith Profile Picture
    Mike Smith 6,840 on at
    RE: How to hide Main report row if Sub report returns no data in SSRS 2008 R2

    While I have not had to find a solution to this requirement, I don't think this is possible.

    This would require that you would determine that the sub-report doesn't have detail and this pass this value to the main report. This functionality is not available in SQL Reporting Services.

  • SekarGP Profile Picture
    SekarGP 1,145 on at
    RE: How to hide Main report row if Sub report returns no data in SSRS 2008 R2

    Hi,

    Thanks for your immediate response, I have applied the code but its not working. I have added sub report in one column remaining columns are empty, what I want means, if there is no data return from sub report, I have to hide row in main report.

    Thanks in Advance,

    Sekar V

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to hide Main report row if Sub report returns no data in SSRS 2008 R2

    Access sub report properties - visibility - show based on expression.

    Enter this code:

    =IIF(RowNumber(Nothing)>0,False,True)

    Detailed steps : www.sanjaykumar.us/.../ssrs-suppress-sub-report-data

    Cheers!

    Sanjay

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans