InScope Function in SSRS

Posted on 2011-10-18
Last Modified: 2013-11-05
We're trying to count a grand total at the very end of our report.  We have 2 lists with totals that work fine.  However, when we try to perform the grand total, with the expression outside the list box, we get an inscope error.  If we move the expression inside the list box, the totals aren't giving a grand total.  How do we write the correct inscope function?  Here is the current expression that is giving the errors:

="Grand Total -    Inspections:    " & CountDistinct(Fields!INSP_ID.Value, "Compliance") &
";    Inspections With Violations: " & CountDistinct(IIF((Fields!VIOL_ID.Value, "Compliance") > 1, (Fields!INSP_ID.Value, "Compliance"),Nothing)) &
";    Violations:    " & CountDistinct(Fields!VIOL_ID.Value, "Compliance") &
";    Enforcements:    " & CountDistinct(Fields!ENF_ID.Value, "Compliance")
Question by:GaleMellinger
    LVL 25

    Expert Comment

    Its because the grouping is not valid outside the list. Make a wrapper group and try adding them in the wrapper group.

    Author Comment

    Can you please provide details on how to make a wrapper group?  Are you referring to a parent group?
    LVL 21

    Accepted Solution

    LVL 25

    Expert Comment

    Yes, its parent group. Just do grouping without the field which is involved in the total.

    Author Closing Comment

    Thank you.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
    This code started out as a fix for a customer that had incoming data that was hunderds of numbers and words long that was to fit in one column. The problem was that the customer did not want to split words or numbers when wrapping in the column. …
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now