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.
- Open System Integrator.
- Within SI, click on the blue Start button in the top-left corner and select Reports > Standard Report Designer.
- 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.
- On the Pop-up Window, select “New Report Based on Existing Report” and click Next.
- 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.
- Give the report a name and click Finish.
- 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.
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.
- Once the “SubReport” object is in the correct section, expand it so it’s the full width of report.
- Right-click the “SubReport” box and select “Bind to D-Tools Report”.
- Select “Scope Of Work Sub Report”.
- Next add the script to the report to show or hide this section. Click on the “Script” button at the bottom of the Window.
- 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.
- 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
- 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)
- Click on File > Edit DTools Report Information.
- Press Next until you get to “Report Parameters” Window.
- Scroll down and find a blank row.
- In the “Name” column of this row put “ShowScope”. This should match the name in the parenthesis of the ReportUtilities.ReturnParameterValue() method.
- In the Description column place a small description of what the parameter does. For example, you can use “Display Scope of Work?”
- In the Data Type Column choose Boolean.
- The default value can be either true or false based on if the check box is checked.
- Clicked Next. In the summary window, make sure the parameter is listed under the “Report Parameters”
- Click File > Publish and the report will be available for use.
- When right-clicking one of the definitions, the new parameter should be at the bottom.