SQL Server paginated reports can use expressions for calculations and formatting; older SSRS designs also allowed custom Visual Basic routines under supported circumstances.
Concept and purpose
Keep business rules and secure filters in the dataset or application layer where they can be tested and reused. Use expressions for display calculations and use embedded code only when it is supported and adds real value.
Example or practical exercise
An expression such as =IIF(Fields!Quantity.Value > 0, “Available”, “Out of stock”) can label rows without embedded custom code. Verify behaviour for NULL and different field types.
Good practices
Test renderers, localization, report parameters and security, and avoid embedding secrets or treating report-level visibility as authorization.
Version and compatibility notes
Report-server capabilities vary by version. Microsoft consolidates on-premises reporting under Power BI Report Server beginning with SQL Server 2025; verify custom code support on the target platform.
AI content disclosure: This article is AI-generated, based on an existing Open Education article (original post 5723). New explanations and examples may be included; it is not necessarily a transcript of any video linked in the original. You may reuse the generated text with or without attribution to this site. Third-party works and trademarks retain their rights. AI can make mistakes, so verify the details against official documentation and test before applying to real databases.
