# Change dinamically a formula in the report

I need to change a formula dinamically

So I'm doing this (some try catch omitted but presents), just to try I'm replacing ALL of formulas to string '1';

Fields<IFormulaField> formulas = null;

formulas = myRpt.getDataDefinition().getFormulaFields();

IFormulaField formula = null;

for (int f = 0; f < formulas.size(); f++)

{

formula = myRpt.getDataDefinition().getFormulaFields().get(f);

String oldText = formula.getText();

String newText = new String("1");

formula.setText(newText);

}

But report actually go on using the OLD formula text... Why?