p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Crystal Reports (http://p2p.wrox.com/forumdisplay.php?f=113)
-   -   How to pass multiple parameters to CR 9 (http://p2p.wrox.com/showthread.php?t=3914)

syedjavid September 16th, 2003 02:41 PM

How to pass multiple parameters to CR 9
 
Hi all
How can i pass multiple parameters to Crystal Report 9
in Dot net framework latest version 2003,
in previous version i use to pass parameters using
the SetParametervalues method of ReportDocument Class.
But in this version i did not found this method in the
reportdocuement class.

Thanks in advance
javid





syedjavid

syedjavid September 17th, 2003 05:50 AM


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


All times are GMT -4. The time now is 07:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.