private void btnViewEmployeeIncentives_Click(object sender, EventArgs e) { ProductionManagementDetailMng mUserDone = new ProductionManagementDetailMng(conn); if (mUserDone.IsNulltrptViewGetAllAssignedProduction() == false) { //Report Document Object ReportDocument cryUser = new ReportDocument(); cryUser.Load("E:\\MyProject\\ProductionManagementSystem\\ProductionManagementSystem\\ProductionManagementSystem\\Reprots\\rptIncentiveApplied.rpt"); //Data Source set cryUser.SetDataSource(mUserDone.rptViewGetAllAssignedProduction()); //ParameterFieldDefinitions crParameterFieldDefinitions; //ParameterFieldDefinition crParameterFieldDefinition; //ParameterValues crParameterValues = new ParameterValues(); //ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); //crParameterDiscreteValue.Value = "1000"; //crParameterFieldDefinitions = cryUser.DataDefinition.ParameterFields; //crParameterFieldDefinition = crParameterFieldDefinitions["FromDate"]; //crParameterValues = crParameterFieldDefinition.CurrentValues; //crParameterValues.Clear(); //crParameterValues.Add(crParameterDiscreteValue); //crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); //ParameterFieldDefinitions crParameterFieldToDates; //ParameterFieldDefinition crParameterFieldToDate; //ParameterValues crParameterValuesToDate = new ParameterValues(); //crParameterDiscreteValue.Value = "2000"; //crParameterFieldToDates = cryUser.DataDefinition.ParameterFields; //crParameterFieldToDate = crParameterFieldToDates["ToDate"]; //crParameterValuesToDate = crParameterFieldToDate.CurrentValues; //crParameterValuesToDate.Clear(); //crParameterValuesToDate.Add(crParameterDiscreteValue); //crParameterFieldToDate.ApplyCurrentValues(crParameterValuesToDate); frm_UserEvaluvation fUE = new frm_UserEvaluvation(); fUE.crystalReportViewer1.ReportSource = cryUser; fUE.crystalReportViewer1.Refresh(); fUE.Show(); } else { MessageBox.Show("There is no data to load.", "No Data", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnCheckIncentives_Click(object sender, EventArgs e) { ProductionManagementDetailMng mUserDone = new ProductionManagementDetailMng(conn); if (mUserDone.UserIsExistrptViewGetAllAssignedProduction(lblUID.Text) == true) { //Report Document Object ReportDocument cryUser = new ReportDocument(); cryUser.Load("E:\\MyProject\\ProductionManagementSystem\\ProductionManagementSystem\\ProductionManagementSystem\\Reprots\\rptIncentiveAppliedByUser.rpt"); //Data Source set cryUser.SetDataSource(mUserDone.rptViewGetAllAssignedProduction()); ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); //Set Parameter crParameterDiscreteValue.Value = lblUID.Text; crParameterFieldDefinitions = cryUser.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["UserID"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); //Load Report Viewer frm_UserEvaluvation fUE = new frm_UserEvaluvation(); fUE.crystalReportViewer1.ReportSource = cryUser; fUE.crystalReportViewer1.Refresh(); fUE.Show(); } else { MessageBox.Show("There is no data to load for user: "******"No Data", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnGenerate_Click(object sender, EventArgs e) { if (radioAllUser.Checked == true) { EmployeeProductionMng mEMP = new EmployeeProductionMng(conn); //Report Document Object ReportDocument cryUser = new ReportDocument(); cryUser.Load("E:\\MyProject\\ProductionManagementSystem\\ProductionManagementSystem\\ProductionManagementSystem\\Reprots\\rptEmployeeProductionAllShipment.rpt"); //Data Source set cryUser.SetDataSource(mEMP.GetAllEmployeeProduction()); frm_UserEvaluvation fUE = new frm_UserEvaluvation(); fUE.crystalReportViewer1.ReportSource = cryUser; fUE.crystalReportViewer1.Refresh(); fUE.Show(); } if (radioUserWise.Checked == true) { if (cmbUID.Text == "") { MessageBox.Show("User ID cannot be empty!", "Invalid User ID", MessageBoxButtons.OK, MessageBoxIcon.Error); cmbUID.Focus(); } else { EmployeeProductionMng mEMP = new EmployeeProductionMng(conn); //Report Document Object ReportDocument cryUser = new ReportDocument(); cryUser.Load("E:\\MyProject\\ProductionManagementSystem\\ProductionManagementSystem\\ProductionManagementSystem\\Reprots\\rpt_EmpProduction.rpt"); //Data Source set cryUser.SetDataSource(mEMP.GetAllEmployeeProduction()); ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = cmbUID.Text; crParameterFieldDefinitions = cryUser.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["UserID"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); frm_UserEvaluvation fUE = new frm_UserEvaluvation(); fUE.crystalReportViewer1.ReportSource = cryUser; fUE.crystalReportViewer1.Refresh(); fUE.Show(); } } if (radioButtonShipmentName.Checked == true) { if (cmbShipment.Text == "") { MessageBox.Show("Shipment name cannot be empty!", "Invalid Shipment", MessageBoxButtons.OK, MessageBoxIcon.Error); cmbShipment.Focus(); } else { EmployeeProductionMng mEMP = new EmployeeProductionMng(conn); //Report Document Object ReportDocument cryUser = new ReportDocument(); cryUser.Load("E:\\MyProject\\ProductionManagementSystem\\ProductionManagementSystem\\ProductionManagementSystem\\Reprots\\rptEmployeeProductionShipmentWise.rpt"); //Data Source set cryUser.SetDataSource(mEMP.GetAllEmployeeProduction()); ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = cmbShipment.Text; crParameterFieldDefinitions = cryUser.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["ShipmentID"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); frm_UserEvaluvation fUE = new frm_UserEvaluvation(); fUE.crystalReportViewer1.ReportSource = cryUser; fUE.crystalReportViewer1.Refresh(); fUE.Show(); } } }