Referencing a report parameter to hide a section's visibility

Forum Forums SI 2015 Reporting Referencing a report parameter to hide a section's visibility

This topic contains 3 replies, has 2 voices, and was last updated by  Richard Guinness 1 year ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11490 Reply

    Richard Guinness
    Participant

    Hi – I’ve created a new report parameter (boolean) and I’m trying to use it to allow me to easily hide or show my terms & conditions within a client proposal report.

    I’ve tried the following:

     Sub grpTermsAndConditions_Format

    ‘ Hide Terms And Conditions if necessary

    ReportUtilities.SetSectionVisibility(rpt, “grpTermsAndConditions”, showTerms)

    End Sub

    But have no success. I know that

    ReportUtilities.SetSectionVisibility(rpt, “grpTermsAndConditions”, false)

    works fine. So I expect I’m missing something very simple… perhaps to do with the declaration at the top of the file:

    Private showTerms As Boolean

    or the position of the Sub grpTermsAndConditions_Format

    Any help v much appreciated!

    #11491 Reply

    Richard Guinness
    Participant

    Is Naresh on here?

    #11492 Reply

    Narayana Karthik
    Participant

    Hi,

    You have missed the code to read the “ShowTerms” param value.

    I am assuming your report parameter “show terms & conditions” key is “ShowTerms”.

    In the ActiveReport Report start event procedure “Sub ActiveReport_ReportStart” add the following code to read the param value

    =====================================================

     Dim showTermsParam As object = ReportUtilities.ReturnParameterValue(“ShowTerms”)

    If Not showTermsParam Is Nothing Then

    If Not Boolean.TryParse(showTermsParam.ToString, showTerms) Then

    showTerms = true

    End If

    End If

    ========================================================

    Once you added the above code, “showTerms” report param will work in your custom report.

    Hope it helps.

    Regards,

    Narayana Karthik

     

     

    #11503 Reply

    Richard Guinness
    Participant

    Thank you Narayana! That’s done it. Really useful, thank you.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Referencing a report parameter to hide a section's visibility
Your information:





<a href="" title="" rel="" target=""> <blockquote cite=""> <code> <pre> <em> <strong> <del datetime=""> <ul> <ol start=""> <li> <img src="" border="" alt="" height="" width="">