70-466 · Question #140
You are developing a new SQL Server Reporting Services (SSRS) report in SQL Server Data Tools (SSDT). The report must define a report parameter to prompt the user for the business unit. Each business
The correct answer is D. Add two Microsoft Visual C# functions to the code block of the report to implement FontFamily and FontSize functions. For each header text box, use expressions to set the FontFamily and FontSize properties by using the functions.. SSRS custom code functions allow centralized, reusable logic for dynamic font properties driven by report parameters, making them the best solution for per-business-unit font schemes.
Question
Options
- AAdd one report variable for FontFamily Assign it with an expression to return the appropriate colors.
- BFor each header text box, set the Color and FontSize properties by using the variables.
- CFor each header text box, assign expressions to the FontFamily and FontSize properties. Add two report variables named FontFamily and FontSize. Assign them with expressions to return the appropriate colors. For each header text box, use expressions to set the FontFamily and FontSize properties by using the variables.
- DAdd two Microsoft Visual C# functions to the code block of the report to implement FontFamily and FontSize functions. For each header text box, use expressions to set the FontFamily and FontSize properties by using the functions.
How the community answered
(52 responses)- A10% (5)
- B15% (8)
- C4% (2)
- D71% (37)
Why each option
SSRS custom code functions allow centralized, reusable logic for dynamic font properties driven by report parameters, making them the best solution for per-business-unit font schemes.
Adding only one variable for FontFamily ignores FontSize, which is also required by the font scheme, and the description incorrectly references color properties instead of font properties.
Setting Color and FontSize properties from variables omits FontFamily, which is a required part of the font scheme, making this an incomplete solution.
While report variables can store computed values, they are evaluated once per report scope and cannot be invoked with arguments like functions can, making them less flexible for per-business-unit font logic.
Adding C# functions to the SSRS report code block creates a centralized, parameterizable implementation that can evaluate the business unit parameter and return the correct FontFamily and FontSize values. Each header text box then references these functions via expressions, ensuring consistent font scheme application across all headers. This approach is more maintainable and reliable than duplicating logic in individual expressions.
Concept tested: SSRS custom code functions for dynamic property expressions
Source: https://learn.microsoft.com/en-us/sql/reporting-services/report-design/custom-code-and-assembly-references-in-expressions-in-report-designer-ssrs
Topics
Community Discussion
No community discussion yet for this question.