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:
public static string DataMethod1(string itemId)
string demoString = '(' + itemId + ')';
Then add a field to your design, and in the Expression editor for the field add the code to call your datamethod: