public CrystalViewer(EMDataSet dataSet,bool isPO) { // // Required for Windows Form Designer support // InitializeComponent(); ParameterFields fields= new ParameterFields(); ParameterField field = new ParameterField(); field.ParameterFieldName = "isPO"; ParameterDiscreteValue discrete = new ParameterDiscreteValue(); discrete.Value = isPO; field.CurrentValues.Add(discrete); fields.Add(field); CrystalReport1 c = new CrystalReport1(); crystalReportViewer1.ParameterFieldInfo = fields; EMDataSet copy = (EMDataSet)dataSet.Copy(); c.SetDataSource(copy); crystalReportViewer1.ReportSource = c; // // TODO: Add any constructor code after InitializeComponent call // }