Add the required parameters to filter the datasets

Standard and custom log reports must include a hidden lead or project parameter to filter the dataset. The name of this parameter and the SQL syntax depends on whether the report is for a single lead, single project, or multi-project.

Parameters

Type of log report Parameter name SQL syntax
Single lead ProjectLeadId WHERE (ViewName.ProjectLeadId = @ProjectLeadId)

For example:

  • WHERE (vw_LeadInfo.ProjectLeadId = @ProjectLeadId)
  • WHERE (vw_LeadInfoSimple.ProjectLeadId = @ProjectLeadId)
Single project ProjectId WHERE (ViewName.ProjectId = @ProjectId)

For example:

  • WHERE (vw_ProjectInfo.ProjectId = @ProjectId)
  • WHERE (vw_ProjectInfoSimple.ProjectId = @ProjectId)
Multi-project ProjectIds WHERE (ViewName.ProjectId IN (@ProjectIds))

For example:

  • WHERE (vw_ProjectInfo.ProjectId IN (@ProjectIds))
  • WHERE (vw_ProjectInfoSimple.ProjectId IN (@ProjectIds))
Estimate log reports* EstimateId WHERE (ViewName.EstimateId = @EstimateId)

For example:

  • WHERE (vw_EstimateInfo.EstimateId = @EstimateId)

* Log reports accessed from the estimate's Summary and Proposals tab must use EstimateId as the filter parameter, regardless of whether the estimate is associated with a lead or project.

Filter the dataset for a single project report

  1. With the custom report open, select the parameters icon () and select + New Parameter.
  2. Enter ProjectId in the Name and Prompt fields.

    This parameter is also used in the standard log reports and is populated dynamically based on the account.

  3. Select Integer from the Data Type dropdown.

  4. Select Hidden from the Visibility dropdown.

  5. Select Save.

  6. Select the database icon ().
  7. Hover over the main dataset and select the three dot menu icon ().
  8. Select Edit.
  9. Toggle the Code field to the right to view the SQL.
  10. Add the ProjectId parameter using the SQL WHERE clause at the bottom.
  11. Select Finish.

Filter the dataset for a multi-project report

  1. With the custom report open, select the parameters icon () and select + New Parameter.
  2. Enter ProjectIds in the Name and Prompt fields.

    This parameter is also used in the standard log reports and is populated dynamically based on the account.

  3. Select String from the Data Type dropdown.

  4. Select Allow multiple values.

  5. Select Hidden from the Visibility dropdown.

  6. Select Save.

  7. Select the database icon ().
  8. Hover over the main dataset and select the three dot menu icon ().
  9. Select Edit.
  10. Toggle the Code field to the right to view the SQL.
  11. Add the ProjectIds parameter using the SQL WHERE clause at the bottom.
  12. Select Finish.