Monday, November 21, 2011

Writing Custom Code in SQL Server Reporting Services

To add code to a report 

1.On the Report menu, click Report Properties. 
  Note If the Report menu is not available,
  click within the report design area. 
2.On the Code tab, in Custom Code, type the code.

Methods in embedded code must be written in Visual Basic .NET. The following is a sample function to calculate Last Monday.

Public Function StartDate()
StartDate = Today.AddDays(-6 - Today.DayOfWeek())
End Function

Writing Custom Code in SQL Server Reporting Services

No comments: