View Single Post
  #2 (permalink)  
Old September 17th, 2003, 05:50 AM
syedjavid syedjavid is offline
Authorized User
 
Join Date: Aug 2003
Location: jeddah, , Saudi Arabia.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default


i Done it,this is the method to pass the parameters to CR 9
    private void SetParameterFieldsNew(CrystalDecisions.CrystalRepo rts.Engine.ReportDocument rptDoc,string ParamNameList,string ParamValuesList)
        {
                    string[] strParamNames = ParamNameList.Split (new char[] {Convert.ToChar(44)});
                    string[] strParamValues = ParamValuesList.Split (new char[] {Convert.ToChar(44)});


            foreach( string N in strParamNames)
            {
                foreach(string V in strParamValues)
                {
                    CrystalDecisions.Shared.ParameterValues objParamField;
                    CrystalDecisions.Shared.ParameterDiscreteValue objDiscreteValue;
                    for(int Index = 0 ; Index < rptDoc.DataDefinition.ParameterFields.Count-1 ; Index++)
                    {
                        objParamField = new CrystalDecisions.Shared.ParameterValues();
                        objDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
                        objDiscreteValue.Value = V;
                        objParamField.Add(objDiscreteValue);

                        if(!rptDoc.DataDefinition.ParameterFields[Index].IsLinked())

                            rptDoc.DataDefinition.ParameterFields[N].ApplyCurrentValues(objParamField);
                    }
                }

            }
        }

syedjavid
Reply With Quote