how to connection crystal report in c# 2010

HKen's Avatar
Light Poster
1.how to connection crystal report in c# 2010?
2.How to pass parameters to pass parameters to Crystal Reports?
3.How to batch to pass parameters and not the preview mode ?

thanks
pein87's Avatar
Ambitious contributor
You need to download crystal reports separately and install it. I've never used it before but I do know its not included and needs to be downloaded. Once you do it will show as a template when you create a new project.
Sirkrna's Avatar, Join Date: Aug 2012
Newbie Member
connection crystal report in c# 2010, if it can help you:
Code:
string Etype;
string checkBox;

CrystalDecisions.Shared.ParameterDiscreteValue objParameterDiscreteValue = new 
CrystalDecisions.Shared.ParameterDiscreteValue();
CrystalDecisions.Shared.ParameterField objParameterField = new 
CrystalDecisions.Shared.ParameterField();
CrystalDecisions.Shared.ParameterFields objParameterFields = new 
CrystalDecisions.Shared.ParameterFields();

public EquipmentReportTypeByType(string eType, string CheckBox)
        {
            InitializeComponent();
            Etype = eType;
            checkBox = CheckBox;
            if (checkBox == "Type By Type")
            {
               crystalReportViewer1.ReportSource = new ReportTypeByType();
                objParameterDiscreteValue.Value = Etype;
                objParameterField.ParameterFieldName = "@EType";
                objParameterField.CurrentValues.Add(objParameterDiscreteValue);
                objParameterFields.Add(objParameterField);
                crystalReportViewer1.ParameterFieldInfo = objParameterFields;
                crystalReportViewer1.Show();
            }

        }