Click here to Skip to main content
15,031,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need to check all the records in a table.I'm having a foreach loop in my web application. I need to use this loop in crystal report's formula field. I'm new to crystal reports and I have no idea with how to write it in formula field. Can anyone help me?

foreach (DataRow dr in ds.Tables[0].Rows)
    type = (dr["type"]).ToString();
    if (type == "c")
        c_total = c_total + Convert.ToDouble(dr["amount"]);
    else if (type == "d")
        d_total = d_total + Convert.ToDouble(dr["amount"]);

1 solution

This[^] might give you an idea.[^] might also help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900