I could figure out that a DataMethod was needed but it took me some time to figure out how connect the method with a field on the report and how to pass parameters to the DataMethod.
You add a datamethod like this:
...
[DataMethod(), AxSessionPermission(SecurityAction.Assert]
public static string DataMethod1(string itemId)
{
string demoString = '(' + itemId + ')';
return demoString;
}
Then add a field to your design, and in the Expression editor for the field add the code to call your datamethod:
=DataMethod1(Fields!ItemId.Value)