One of the best features of System Integrator is its versatility.  More often than not, you can use the software to cover a variety of needs and in several different ways.  This is also extended to the reporting.  You can not only customize the look of custom reports, but also the functionality.  In this blog post, we will adding a true/false parameter to a custom report.  This will give the report the ability to perform an action based on if this parameter is checked or not.  In the example, we will add t he Scope of Work report to a Proposal and add the functionality to show or hide this report.

 

  1. Open System Integrator.
  2. Within SI, click on the blue Start button in the top-left corner and select Reports > Standard Report Designer.



  3. Once the Designer is open, click File > New. While we are adding this functionality to a new report, we could also add it to an existing one.  In that case click File > Open > Open Existing Report and skip to Step 7.



  4. On the Pop-up Window, select “New Report Based on Existing Report” and click Next.



  5. Select the report you want to add the Parameter to, in this example the Proposal report will be used. Once you have the report selected, click Next.

  6. Give the report a name and click Finish.


  7. To add the Scope of Work to the Proposal, click on the “SubReport” object in the Toolbox on the left side and drag it into the GroupHeader2 Section.


    GroupHeader2 Section:


    You may need to change the Height of the Section to do this.  In this case, select the section and input the desired height in the properties on the lower-right of the Window.



  8. Once the “SubReport” object is in the correct section, expand it so it’s the full width of report.



  9. Right-click the “SubReport” box and select “Bind to D-Tools Report”.



  10. Select “Scope Of Work Sub Report”.



  11. Next add the script to the report to show or hide this section. Click on the “Script” button at the bottom of the Window.



  12. Add the Script below on Line 36:

    Private showScope As Boolean = false

    This will allow you to turn the scope on and off. Add a carriage return after the line to place some space between it and the “Sub ReportHeader1_Format” section.

  13. In the “Sub ActiveReport_ReportStart” (Line 219) section, place the text below:

    Dim showScopeParam As object = ReportUtilities.ReturnParameterValue(“ShowScope”)

    If Not showScopeParam Is Nothing Then

    If Not Boolean.TryParse(showScopeParam.ToString, showScope) Then
                    showScope = false
                    End If
    End If



  14. Finally place the script below in the GroupHeader2 section.  If it does not exist click on the Object dropdown at the Top and select “GroupHeader2” and on the Event dropdown select “Format”



    ReportUtilities.SetSectionVisibility(rpt, “GroupHeader2”, showScope)

 

  1. Click on File > Edit DTools Report Information.



  2. Press Next until you get to “Report Parameters” Window.
  3. Scroll down and find a blank row.



  4. In the “Name” column of this row put “ShowScope”. This should match the name in the parenthesis of the ReportUtilities.ReturnParameterValue() method.
  5. In the Description column place a small description of what the parameter does. For example, you can use “Display Scope of Work?”
  6. In the Data Type Column choose Boolean.



  7. The default value can be either true or false based on if the check box is checked.
  8. Clicked Next. In the summary window, make sure the parameter is listed under the “Report Parameters”



  9. Click File > Publish and the report will be available for use.



  10. When right-clicking one of the definitions, the new parameter should be at the bottom.