Add Custom Log Report - Step 2 - Add Required Paramater To Filter Dataset(s)
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 if the report is for a single lead, project or cross projects.
Parameter Names
Type of Log Report | Parameter Name | SQL Syntax |
Single Lead | ProjectLeadId |
WHERE (View Name.ProjectLeadId = @ProjectLeadId)
Examples: WHERE (vw_LeadInfo.ProjectLeadId = @ProjectLeadId) WHERE (vw_LeadInfoSimple.ProjectLeadId = @ProjectLeadId) |
Single Project | ProjectId |
WHERE (View Name.ProjectId = @ProjectId)
Examples: WHERE (vw_ProjectInfo.ProjectId = @ProjectId) WHERE (vw_ProjectInfoSimple.ProjectId = @ProjectId) |
Cross Projects | ProjectIds |
WHERE (View Name.ProjectId IN (@ProjectIds))
Examples: WHERE (vw_ProjectInfo.ProjectId IN (@ProjectIds)) WHERE (vw_ProjectInfoSimple.ProjectId IN (@ProjectIds)) |
Estimate Log Reports * | EstimateId |
WHERE (View Name.EstimateId = @EstimateId)
Example: WHERE (vw_EstimateInfo.EstimateId = @EstimateId) |
* Note: Log reports that will be accessed from the Estimate's Summary and Proposals tab must use EstimateId as the filter parameter. This is regardless of whether the Estimate is associated with a Lead or Project.
Single Project Parameter Example
- Click the 'Parameters' icon on the far right then click '+ New Parameter' at the bottom.
- Enter a hidden report parameter for ProjectId. This is the same parameter used in the Standard Log Reports and will be populated dynamically based on the account.
- Saved parameter.
- Click the 'Data' icon on the far right then click the three vertical dot button on the main dataset. See image below.
- Click Edit
- Toggle the Code field to the right to view the SQL code.
- Add the ProjectId parameter filter using the SQL WHERE clause as shown in the image below.
- Click Finish
Cross Project Parameter Example
- Click the 'Parameters' icon on the far right then click '+ New Parameter' at the bottom.
- Enter a hidden report parameter for ProjectIds. This is the same parameter used in the Cross Project Log Reports and will be populated dynamically based on the account.
- Saved parameter.
- Click the 'Data' icon on the far right then click the three vertical dot button on the main dataset. See image below.
- Click Edit
- Toggle the Code field to the right to view the SQL code.
- Add the ProjectIds parameter filter using the SQL WHERE clause as shown in the image below.
- Click Finish