View Single Post
  #3 (permalink)  
Old April 25th, 2007, 05:57 AM
zaghmout zaghmout is offline
Friend of Wrox
 
Join Date: Aug 2006
Location: Amman, , Jordan.
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well..
I use the following function for setting the parameters and I adjust it on need
so see if it helps you

    private void insertParam()
    {
        try
        {
            string strData = Session["param"].ToString(); ;

            string[] aryData = strData.Split(';');

            ParameterFields paramFields = CrystalReportViewer1.ParameterFieldInfo;

            for (int i = 0; i < aryData.Length; i++)
            {
            ParameterValues param = new ParameterValues();
            ParameterDiscreteValue paramValue = new ParameterDiscreteValue();

            paramValue.Value = aryData[i];

            param.Add(paramValue);

            ParameterField paramField = paramFields[i];
            paramField.CurrentValues = param;
            }
        }
        catch (Exception ex)
        {
            lblError.Text = ex.Message;
        }
    }

Note the following: I sent the parameters seperated by ";" and the parameters types/order should be as it in the report.

Nothing is impossible. The impossible only takes longer. "Digital Fortress, Dan Brown"