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

Friday, November 18, 2011

Run MS Test via the command-line tool MSTest.exe

  • Right-click the ‘List of Tests’ option in the tree view on the left and select the ‘New Test List…’ option.
  • Fill out the dialog with a meaningful name and description.
  • Click the ‘All Loaded Tests’ option in the tree view to display a list of available tests. Right click on the displayed list and select the menu item.
  • Running MSTest at the command prompt with the ‘testmetadata’ option pointing to your new vsmdi file will run the tests.
"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testmetadata:%1.vsmdi

Wednesday, November 09, 2011

Replay an IIS web server log

  1. Click Test and then click New Test.
    The Add New Test dialog box is displayed.
  2. Under Add to Test Project, choose one of the options for creating a new test project. For example, click Create a new Visual C# Test Project.
    Note:
    By default, the type of test project shown under Add to Test Project is the type that is currently set as the default in the Options dialog box, which is available onthe Tools menu. For more information, see How to: Configure Test Project Creation.
  3. In the Templates pane, select the type of test you want to add.
  4. Click OK.
    The New Test Project dialog box appears.
  5. Enter a name for the new test project, or accept the default name, and click Create.
  6. Depending on the type of test you chose, you can either hand-code or generate the newly added test.
Microsoft.VisualStudio.TestTools.WebTesting namespace is in
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\ Microsoft.VisualStudio.QualityTools.WebTestFramework.dll
Application must target .NET Framework 4.

To reference the Log Parser, look for the “MS Utility 1.0 Type Library – LogParser Interfaces collection” COM component in the Add Reference dialog.


MSDN: Create a Test Project
Josh Christie: Replay an IIS web server log
VS 2010 compiler error: Interop type XXX cannot be embedded. Use the applicable interface instead.