Translate

> | > Crystal Report Parameter Pass C# , C-sharp

Crystal Report Parameter Pass C# , C-sharp

Posted on Thursday, October 18, 2012 | No Comments

        ParameterField paramerterField = new ParameterField();
        ParameterFields parameterFields = new ParameterFields();
        ParameterDiscreteValue pdvReprint = new ParameterDiscreteValue();

        private void setParameter()
        {
            string rep = "";

            try
            {
                rep = Request.QueryString["Rep"].ToString();
            }
            catch (Exception ex)
            {
                rep = "";
            }
            if (rep != "")
            {
                paramerterField.ParameterFieldName = "@Reprint";
                pdvReprint.Value = rep;
                paramerterField.CurrentValues.Add(pdvReprint);
                parameterFields.Add(paramerterField);
                CrViewer.ParameterFieldInfo = parameterFields;
            }
            else
            {
                paramerterField.ParameterFieldName = "@Reprint";
                pdvReprint.Value = "";
                paramerterField.CurrentValues.Add(pdvReprint);
                parameterFields.Add(paramerterField);
                CrViewer.ParameterFieldInfo = parameterFields;
            }
        }

Leave a Reply

Powered by Blogger.