Skip to Content
0
Former Member
Jan 12, 2006 at 12:51 PM

How to set formula field in crystal report

779 Views

Hello all,

I develope the code in C#.NET and use SAP B1 2004C. I have a problem with crystal report. I have in crystal report one unbound field. This field is string type. I need in my code change value of this field to another text ex. ("test").

I use this code:

FormulaFieldDefinitions crFormula;
            FormulaFieldDefinition crFormulafieldD1;
            crFormula = crReportDocument.DataDefinition.FormulaFields;
            //FormulaFieldDefinition test;
            
            //bool test = crFormula.IsReadOnly;
            string error = "";
            bool isCorrect = true;
            crFormulafieldD1 = crFormula[1];            
            string ahoj = crFormulafieldD1.FormulaName;
            crFormulafieldD1.Text = " ""+OP.ToString()+"" ";
            isCorrect = crFormulafieldD1.Check(ref error);      

            
            // Display the error message if the syntax is incorrect.
            //if (!isCorrect) MessageBox.Show(error);

The value of the field is set, but on the report isnt it. Why not. Can you help me. Send some sample.

Thanks