Instead of doing this in your application, try using a parameter in the report. Here's what you can do:
1. Create a parameter, which I will call {?SortOrder} which has the values "Code" and "Description".
2. Create a formula that will provide the values for the sort. It might look like this (assuming that both fields are string fields!):
{@SortOrder}
If {?SortOrder} = 'Code' then {invoices.article_cod} else {invoices.article_descrip}
3. Sort the report on this formula.
Your application would then just have to supply the value for this parameter base on what the user selects in the application.
-Dell