public void GetAllEmployee() { var q = EmployeeCmd.GetAll(); ReportDataSource rs = new ReportDataSource(); List<EmployeeReportObj> ls = new List<EmployeeReportObj>(); int counter = 0; foreach (var item in q) { counter++; ls.Add(new EmployeeReportObj() { EmoloyeeID = counter, employeeName = item.EmployeeName , EmployeeGender = item.EmployeeGender, EmployeejobNumber = item.EmployeejobNumber, EmployeeNationalNumber = item.EmployeeNationalNumber, PhoneNumber = item.PhoneNumber, Mobilenumber=item.Mobilenumber, Email=item.Email, }); } rs.Name = "EmplyeeDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptEmolyee.rdlc"; frm.ShowDialog(); }
private void Print() { try { DataTable dtAuditReport = AuditReport.DVAuditReport.Table.Copy(); if (dtAuditReport == null || dtAuditReport.Rows.Count == 0) { ShowInformationMessage(PDMsg.NoRecordsPrint); return; } foreach (DataRow dr in dtAuditReport.Rows) { if (dr["CUS_ISSUEDATE"].ToString() == " 7:01:01PM" || dr["CUS_ISSUEDATE"].ToString() == "12:00:00AM") { dr.BeginEdit(); dr["CUS_ISSUEDATE"] = ""; dr.EndEdit(); } } frmReportViewer rv = new frmReportViewer(dtAuditReport, "AuditReport"); rv.ShowDialog(); } catch (Exception ex) { throw ex.LogException(); } }
private void btnPreview_Click(object sender, EventArgs e) { try { if (TransactionGridView.GetFocusedRow() is Transactions item) { BillingStatementViewModel billingStatementViewModel = new BillingStatementViewModel() { TransactionId = item.Id }; var billing = new UnitOfWork().BillingsRepo.Find(x => x.TransactionId == item.Id); billing.AmountInWord = "**" + StringExtensions.NumberToWords(billing.Amount.ToString("##.##00")) + "**"; billing.BillingStatementViewModels = new List <BillingStatementViewModel>() { billingStatementViewModel }; frmReportViewer frmReportViewer = new frmReportViewer(new rptOfficialReceipt() { DataSource = new List <Billings>() { billing } }); frmReportViewer.ShowDialog(); } } catch (Exception exception) { MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Print() { if (!CostSheet.PART_NO.IsNotNullOrEmpty()) { MessageBox.Show(PDMsg.NotEmpty("Part No"), ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information); return; } if (!CostSheet.ROUTE_NO.IsNotNullOrEmpty()) { MessageBox.Show(PDMsg.NotEmpty("Process No"), ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information); return; } if (CostSheet.DVCostSheet == null || CostSheet.DVCostSheet.Count == 0) { ShowInformationMessage(PDMsg.NoRecordsPrint); } else { DataSet processData = new DataSet(); processData.Tables.Add(CostSheet.DVCostSheet.ToTable("CostSheet")); processData.Tables.Add(CostSheetDetails()); //processData.WriteXmlSchema(@"E:\CostSheet.xml"); frmReportViewer rv = new frmReportViewer(processData, "CostSheet"); rv.ShowDialog(); } }
public void GetAllSupplier() { var q = SuppliersCmd.GetAll(); ReportDataSource rs = new ReportDataSource(); List<SupplierReportObj> ls = new List<SupplierReportObj>(); int counter = 0; foreach (var item in q) { counter++; ls.Add(new SupplierReportObj() { SupplierID = counter, SupplierName = item.Name, SuppliersNatural = item.SuppliersNatural, Faxnumber = item.Fax, Address = item.Adderss, PhoneNumber = item.PhoneNumber, Email = item.Email }); } rs.Name = "SupplierDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptSupplier.rdlc"; frm.ShowDialog(); }
public void GetRptContractByProjectId(int ProjID) { var q = ContractCmd.GetAllContractsByproID(ProjID); ReportDataSource rs = new ReportDataSource(); List<ContractReportObj> ls = new List<ContractReportObj>(); int counter = 0; foreach (var item in q) { counter++; ls.Add(new ContractReportObj() { ContractID=counter, ProjectName=item.ProjectProfile.ProjectName, EmployeeName=item.Employee.EmployeeName, EmployeeJobNumber=item.Employee.EmployeejobNumber, StartDate=item.StartDate.Value, EndDate=item.EndDate.Value, MonthlySalary =item.SelaryAmount.Value, TotalSalary=item.TotalSalary.Value, Coin=item.ProjectProfile.Coin, }); } rs.Name = "ContractDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptContract.rdlc"; frm.ShowDialog(); }
public void GetRptAmountRecvByProjectId(int ProjID) { var q = AmountsReceivedsCmd.GetAllAmountsReceivedBypro(ProjID); ReportDataSource rs = new ReportDataSource(); List<AmountRecvtReportObj> ls = new List<AmountRecvtReportObj>(); foreach (var item in q) { ls.Add(new AmountRecvtReportObj() { ProjectName=item.ProjectProfile.ProjectName, Coin=item.ProjectProfile.Coin, DonerName=item.TheDonorsProject.TheDonor.Name, Date=item.Date.Value, Cost=item.Cost.Value, }); } rs.Name = "AmountsReceivedDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptAmountsReceived.rdlc"; frm.ShowDialog(); }
private void BtnPreview_Click(object sender, EventArgs e) { if (uCPO.POGridView.GetFocusedRow() is PurchaseOrders item) { item = new UnitOfWork().PurchaseOrdersRepo.Find(m => m.Id == item.Id); item.PODetails = item.PODetails.OrderBy(x => x.ItemNo).ToList(); //if (item.PODetails.Count < 15) //{ // var counter = 15 - item.PODetails.Count; // for (var i = 1; i <= counter; i++) // { // item.PODetails.Add(new PODetails()); // } //} frmReportViewer frm = new frmReportViewer(new rptPO(item) { DataSource = new List <PurchaseOrders>() { item } }); frm.ShowDialog(); } }
private void btnPreview_Click(object sender, EventArgs e) { try { if (PISGridView.GetFocusedRow() is PIS item) { item = new UnitOfWork().PISRepo.Find(x => x.Id == item.Id); item.PISDetails = item.PISDetails.OrderBy(x => x.ItemNo).ToList(); if (item.PISDetails.Count < 20) { var counter = 20 - item.PISDetails.Count; for (var i = 0; i <= counter; i++) { item.PISDetails.Add(new PISDetails()); } } frmReportViewer frm = new frmReportViewer(new rptPIS() { DataSource = new List <PIS>() { item } }); frm.ShowDialog(); } } catch (Exception exception) { } }
private void qcpReport() { //SelectDataRowPart(); if (!QCPMODEL.PartNo.IsNotNullOrEmpty()) { ShowInformationMessage(PDMsg.NotEmpty("Part No")); //ShowInformationMessage("Part No does not exists"); // Jeyan return; } else { DataTable processData; processData = qcpBll.GetQCP(PccsModel, QCPMODEL); if (processData == null || processData.Rows.Count == 0) { ShowInformationMessage(PDMsg.NoRecordsPrint); } else { frmReportViewer rv = new frmReportViewer(processData, "QCP"); rv.ShowDialog(); } } }
private void PSWPreviewReport() { //PartSubmissionWarrantModel pswm = new PartSubmissionWarrantModel(); if (PARTSUBMISSIONWARRANT.CSQSRYES == true && PARTSUBMISSIONWARRANT.CSQSRNO == false) { //partSubmissionBll.GetBIFPSW(PARTSUBMISSIONWARRANT); DataSet ds = new DataSet(); DataTable dt = null; List <PartSubmissionWarrantModel> li = new List <PartSubmissionWarrantModel>(); li.Add(PARTSUBMISSIONWARRANT); dt = li.ToDataTableWithType <PartSubmissionWarrantModel>(); if (dt != null) { dt.Columns.Add("NAME"); dt.Columns.Add("Application"); dt.Rows[0]["NAME"] = PARTSUBMISSIONWARRANT.PUTNAME.ToString(); dt.Rows[0]["Application"] = PARTSUBMISSIONWARRANT.PUTAPPLICATION.ToString(); dt.AcceptChanges(); } if (dt == null || dt.Rows.Count == 0) { ShowInformationMessage(PDMsg.NoRecordsPrint); } else { frmReportViewer rv = new frmReportViewer(dt, "PartSubmissionWarrant"); rv.ShowDialog(); } } else if (PARTSUBMISSIONWARRANT.CSQSRYES == false && PARTSUBMISSIONWARRANT.CSQSRNO == true) { ShowWarningMessage("Confirm verification of CSQSR for this Part? Please Check to proceed...", MessageBoxButton.OK); } }
private void LeadTime_Print() { try { String subheading = ""; MFMDevelopment.DTLeadTimePrint = null; LeadTime_Refresh(); if (MFMDevelopment.DTLeadTimePrint != null && MFMDevelopment.DTLeadTimePrint.Rows.Count > 0) { //MFMDevelopment.DTLeadTimePrint.WriteXmlSchema(@"E:\LeadTime.xml"); subheading = " Lead Time For Parts Devloped During " + MFMDevelopment.START_DATE.ToFormattedDateAsString() + " to " + MFMDevelopment.END_DATE.ToFormattedDateAsString() + " From Activity " + MFMDevelopment.STAGE_START + " To Activity " + MFMDevelopment.STAGE_END + " under " + MFMDevelopment.TARGET_TIME + " days "; frmReportViewer rv = new frmReportViewer(MFMDevelopment.DTLeadTimePrint, "LeadTime", subheading); rv.ShowDialog(); } else { ShowInformationMessage(PDMsg.NoRecordsPrint); } } catch (Exception ex) { throw ex.LogException(); } }
private void PrintReport() { try { DataTable dtData; string reportName = "APQPReport"; if (!PartNo.IsNotNullOrEmpty()) { ShowInformationMessage(PDMsg.NotEmpty("Part No")); return; } dtData = DvAPQP.ToTable().Copy(); //dtData.Rows.Clear(); DataSet dsReport = new DataSet(); dsReport.DataSetName = "DSAPQPDATA"; //dtData.Rows.Clear(); dsReport.Namespace = "APQP"; dtData.TableName = "APQP"; dsReport.Tables.Add(dtData); //dsReport.WriteXml("E:\\APQP.xml", XmlWriteMode.WriteSchema); Dictionary <string, string> dictFormula = new Dictionary <string, string>(); dictFormula.Add("PartNo", "SFL Part No : " + PartNo); frmReportViewer reportViewer = new frmReportViewer(dsReport, reportName, CrystalDecisions.Shared.ExportFormatType.NoFormat, dictFormula); if (!reportViewer.ReadyToShowReport) { return; } reportViewer.ShowDialog(); } catch (Exception ex) { throw ex.LogException(); } }
public void GetAllDonor() { var q = TheDonorCmd.GetAllDonors(); ReportDataSource rs = new ReportDataSource(); List<DonaorReportObj> ls = new List<DonaorReportObj>(); int counter = 0; foreach (var item in q) { counter++; ls.Add(new DonaorReportObj() { DonorID = counter, DonorName = item.Name, DonorAgentname = item.agentName, DonorFaxnumber = item.Fax, DonorAddress = item.Adderss, DonorPhoneNumber = item.PhoneNumber, DonorEmail = item.Email }); } rs.Name = "DonorDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptDonor.rdlc"; frm.ShowDialog(); }
private void PSW_Print() { try { String subheading = ""; MFMDevelopment.DTPSWPrint = null; PSW_Refresh(); if (MFMDevelopment.DTPSWPrint != null && MFMDevelopment.DTPSWPrint.Rows.Count > 0) { //MFMDevelopment.DTPSWPrint.WriteXmlSchema(@"E:\PSW.xml"); if (MFMDevelopment.AwaitingPSWApproval) { subheading = "Parts PSW NOT Approved and Devloped During " + MFMDevelopment.START_DATE.ToFormattedDateAsString() + " to " + MFMDevelopment.END_DATE.ToFormattedDateAsString(); frmReportViewer rv = new frmReportViewer(MFMDevelopment.DTPSWPrint, "PSW", subheading); rv.ShowDialog(); } else { subheading = "Parts PSW Approved and Devloped During " + MFMDevelopment.START_DATE.ToFormattedDateAsString() + " to " + MFMDevelopment.END_DATE.ToFormattedDateAsString(); frmReportViewer rv = new frmReportViewer(MFMDevelopment.DTPSWPrint, "PSWApp", subheading); rv.ShowDialog(); } } else { ShowInformationMessage(PDMsg.NoRecordsPrint); } } catch (Exception ex) { throw ex.LogException(); } }
private void PrintReport() { try { DataTable dtData; string reportName = "PerformanceReport"; dtData = PerformanceResult.ToTable().Copy(); //dtData.Rows.Clear(); DataSet dsReport = new DataSet(); //dsReport.DataSetName = "DSREPORTDATA"; dtData.TableName = "REPORTDATA"; dsReport.Tables.Add(dtData); //dsReport.WriteXml("E:\\" + dsReport.DataSetName + ".xml", XmlWriteMode.WriteSchema); Dictionary <string, string> dictFormulas = new Dictionary <string, string>(); dictFormulas.Add("lblColumn0", HEADER[0]); dictFormulas.Add("lblColumn1", HEADER[1]); dictFormulas.Add("lblColumn2", HEADER[2]); dictFormulas.Add("lblColumn3", HEADER[3]); dictFormulas.Add("lblColumn4", HEADER[4]); dictFormulas.Add("lblColumn5", HEADER[5]); dictFormulas.Add("lblHeader", _reportTitle); reportName = (_perfOption == performanceOption.DocumentReleased || _perfOption == performanceOption.SampleSubmitted ? "PerformanceReport1" : "PerformanceReport"); frmReportViewer reportViewer = new frmReportViewer(dsReport, reportName, CrystalDecisions.Shared.ExportFormatType.NoFormat, dictFormulas); if (!reportViewer.ReadyToShowReport) { return; } reportViewer.ShowDialog(); } catch (Exception ex) { throw ex.LogException(); } }
private void btnPreview_Click(object sender, EventArgs e) { if (PayrollDiffGridView.GetFocusedRow() is PayrollDifferentials _item) { var res = new UnitOfWork().PayrollDifferentialsRepo.Find(x => x.Id == _item.Id); if (res.PayrollDifferentialDetails.Count() < 7) { res.PayrollDifferentialDetails.Add(new PayrollDifferentialDetails() { EmployeeName = "*******Nothing follows*******" }); var count = 7 - res.PayrollDifferentialDetails.Count(); for (var i = 0; i <= count - 1; i++) { res.PayrollDifferentialDetails.Add(new PayrollDifferentialDetails() { EmployeeName = "" }); } } frmReportViewer frm = new frmReportViewer(new rptPayrollDifferential() { DataSource = new List <PayrollDifferentials>() { res } }); frm.ShowDialog(); Init(); } }
private void button1_Click(object sender, EventArgs e) { string str = comboBox1.Text; string vtype = ""; if (str == "Journal") { vtype = "J"; } else if (str == "Payment") { vtype = "Y"; } else if (str == "Receipt") { vtype = "R"; } else if (str == "Contra") { vtype = "T"; } DateTime dt = dateTimePicker2.Value; DateTime dt1 = dt; DateTime addt = dt1.AddDays(1); //addt = Convert.ToDateTime("dd/mm/yyyy"); // DateTime todt = Convert.ToDateTime(mskTo.Text, "yyyy/mm/dd"); string qry = "DELETE from tblprintvoucher"; SqlCommand com = new SqlCommand(qry, clsConnection.Conn); com = new SqlCommand(qry, clsConnection.Conn); com.ExecuteNonQuery(); qry = "insert into tblprintvoucher (finyr,BrCode,GLID,SLID,GL_L_Name,SL_L_NAME,VNO,TRANTYPE,AMTTYPE,AMT,InventoryVNo,VDT,ANYSL,BrName) select finyr,BrCode,GLID,SLID,GL_L_Name,SL_L_NAME,VNO,TRANTYPE,AMTTYPE,AMT,NAR,VDT,ANYSL,BrName from viewvoucher where finyr='" + Global.finyr + "' and brcode='" + Global.branch + "' and trantype='" + vtype + "' and (VDT >= '" + dateTimePicker1.Value + "' and VDT < '" + addt + "') order by vdt,vno,amttype desc"; com = new SqlCommand(qry, clsConnection.Conn); com.ExecuteNonQuery(); ReportDocument rp = new ReportDocument(); string rPath = Application.StartupPath.ToString() + "\\prntvoucher.rpt"; rp.Load(rPath); frmReportViewer rpt = new frmReportViewer(); rpt.crystalReportViewer1.ReportSource = rp; rpt.Text = "Voucher Report"; rpt.ShowDialog(); rpt.WindowState = FormWindowState.Maximized; this.Cursor = Cursors.Default; }
void CuadredeCaja() { unitOfWork = new BO.DAL.UnitOfWork(); DateTime dFechaIni; DateTime dFechaFin; dFechaIni = txtFecha.Value.Date; dFechaFin = txtFecha.Value.Date.AddDays(1); int iCounterId = -1; iCounterId = Convert.ToInt32(cmbCounter.SelectedValue); var sQuery = unitOfWork.vwCuadreCajaRepository.Get(filter: s => s.FECHA == dFechaIni && s.COUNTER_ID == iCounterId); BO.DAL.dsReportes.VW_CUADRE_CAJADataTable oTable = new BO.DAL.dsReportes.VW_CUADRE_CAJADataTable(); foreach (var oQuery in sQuery) { BO.DAL.dsReportes.VW_CUADRE_CAJARow oFactRow = oTable.NewVW_CUADRE_CAJARow(); oFactRow.CAJERO = oQuery.CAJERO; oFactRow.COUNTER_ID = oQuery.COUNTER_ID; oFactRow.CTE_ID = oQuery.CTE_ID; oFactRow.CTE_NUMERO_EPS = oQuery.CTE_NUMERO_EPS; oFactRow.IMPORTE = oQuery.IMPORTE; oFactRow.MOVCAJA_ID = oQuery.MOVCAJA_ID; oFactRow.NUM_FISCAL = oQuery.NUM_FISCAL; oFactRow.REC_CREDITO = oQuery.REC_CREDITO; oFactRow.RECIBO = oQuery.RECIBO; oFactRow.RECIBO_ID = oQuery.RECIBO_ID; oFactRow.SUC_ID = oQuery.SUC_ID; oFactRow.TIP_MOV = oQuery.TIP_MOV; oFactRow.TIPO_DESCR = oQuery.TIPO_DESCR; oFactRow.TIPO_REC_DESC = oQuery.TIPO_REC_DESC; oTable.Rows.Add(oFactRow); } oTable.TableName = "VW_CUADRE_CAJA"; // string sPath = @".\Reportes\CuandreCaja.rdlc"; string sPath = @".\Reportes\rCuadreCaja2.rdlc"; frmReportViewer x = new frmReportViewer(sPath, oTable, "Reporte de Movimientos de Caja -" + txtFecha.Value.Date.ToShortDateString()); x.ShowDialog(); }
private void BtnSOA_Click(object sender, EventArgs e) { if (uc.AppropriationGrid.GetFocusedRow() is Appropriations item) { frmReportViewer frm = new frmReportViewer(new rptSOA() { DataSource = new UnitOfWork().AppropriationsRepoRepo.Get(m => m.Id == item.Id) }); frm.ShowDialog(); } }
private void btnImport_Click(object sender, EventArgs e) { if (EmployeesGridControl.DataSource is BindingList <Employees> model) { frmReportViewer frm = new frmReportViewer(new rptEmployees() { DataSource = model }); frm.ShowDialog(); } }
public void ShowReportByGrid(List<AmountRecvtReportObj> ls) { ReportDataSource rs = new ReportDataSource(); rs.Name = "AmountsReceivedDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptAmountsReceived.rdlc"; frm.ShowDialog(); }
public void ShowSuppReportByGrid(List<SupplierReportObj> ls) { ReportDataSource rs = new ReportDataSource(); rs.Name = "SupplierDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptSupplier.rdlc"; frm.ShowDialog(); }
private void btnPrint_Click(object sender, EventArgs e) { if (UserGridControl.DataSource is BindingList <Users> model) { frmReportViewer frm = new frmReportViewer(new rptUsers() { DataSource = model.ToList() }); frm.ShowDialog(); } }
private void btnPrint_Click(object sender, EventArgs e) { if (RecipientGridView.GetFocusedRow() is Payees payees) { frmReportViewer frmReportViewer = new frmReportViewer(new rptRecipientLists() { DataSource = new UnitOfWork().PayeesRepo.Get(x => x.Id == payees.Id) }); frmReportViewer.ShowDialog(); } }
private void btnPreview_Click(object sender, EventArgs e) { if (this.PARGridView.GetFocusedRow() is PAR item) { frmReportViewer frm = new frmReportViewer(new rptPAR() { DataSource = new UnitOfWork().PARRepo.Get(x => x.Id == item.Id) }); frm.ShowDialog(); } }
private void btnPreview_Click(object sender, EventArgs e) { try { UnitOfWork unitOfWork = new UnitOfWork(); if (AIGridView.GetFocusedRow() is AIReports item) { item = unitOfWork.AIReportsRepo.Find(x => x.Id == item.Id); item.AIRDetails = item.AIRDetails.OrderBy(x => x.ItemNo).ToList(); //if (item.AIRDetails.Count < 25) //{ // var counter = 25 - item.AIRDetails.Count; // for (var i = 1; i <= counter; i++) // { // item.AIRDetails.Add(new AIRDetails()); // } //} var rpt = new rptAcceptanceAndInspections() { DataSource = new List <AIReports>() { item } }; StaticSettings staticSettings = new StaticSettings(); if (staticSettings.Offices.ResponsibilityCenterCode == "1032") { rpt.grpStandard.Visible = false; rpt.grpHR.Visible = true; } if (string.IsNullOrEmpty(item.PropertyOfficer2)) { foreach (var ctrl in rpt.AllControls <XRControl>().Where(x => x.Tag == "hide_isnull")) { ctrl.Visible = false; } } if (string.IsNullOrEmpty(item.Head)) { foreach (var ctrl in rpt.AllControls <XRControl>().Where(x => x.Tag == "Head hide_isnull")) { ctrl.Visible = false; } } frmReportViewer frm = new frmReportViewer(rpt); frm.ShowDialog(); } } catch (Exception exception) { } }
private void btnPreview_Click(object sender, EventArgs e) { allotmentLetter.User = User.UserName; frmReportViewer frm = new frmReportViewer(new rptAllotmentLetters() { DataSource = new List <AllotmentLetter>() { allotmentLetter } }); frm.ShowDialog(); }
private void btnPreview_Click(object sender, EventArgs e) { if (OBGridView.GetFocusedRow() is Obligations item) { item = new UnitOfWork().ObligationsRepo.Find(m => m.Id == item.Id); var rpt = new rptObligationRequestPreview() { DataSource = new List <Obligations>() { item } }; if (item.Offices.IsDivision == true) { rpt.lblDivisionChief.Visible = true; rpt.lblDivisionChiefPos.Visible = true; rpt.lblDivisionChief.ExpressionBindings.Clear(); rpt.lblDivisionChiefPos.ExpressionBindings.Clear(); rpt.lblDepartmentChief.ExpressionBindings.Clear(); rpt.lblDepartmentChiefPosition.ExpressionBindings.Clear(); rpt.lblDivisionChief.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Offices].[Chief]")); rpt.lblDivisionChiefPos.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Offices].[ChiefPosition]")); if (string.IsNullOrEmpty(item.OBRApprovedBy)) { rpt.lblDepartmentChief.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Offices].[UnderOfOffice].[Chief]")); rpt.lblDepartmentChiefPosition.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Offices].[UnderOfOffice].[ChiefPosition]")); } else { rpt.lblDepartmentChief.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[OBRApprovedBy]")); rpt.lblDepartmentChiefPosition.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[OBRApprovedByPos]")); } } else { foreach (XRControl control in rpt.AllControls <XRControl>().Where(x => x.Tag == "division")) { control.Visible = false; } rpt.lblDepartmentChief.ExpressionBindings.Clear(); rpt.lblDepartmentChiefPosition.ExpressionBindings.Clear(); rpt.lblDepartmentChief.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Offices].[Chief]")); rpt.lblDepartmentChiefPosition.ExpressionBindings.Add(new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Offices].[ChiefPosition]")); } frmReportViewer frm = new frmReportViewer(rpt); frm.ShowDialog(); } }
private void BtnPreview_Click(object sender, EventArgs e) { if (ucPR.PRGrid.GetFocusedRow() is PurchaseRequests pr) { UnitOfWork unitOfWork = new UnitOfWork(); var model = unitOfWork.PurchaseRequestsRepo.Find(m => m.Id == pr.Id); var officeId = User.OfficeId(); var office = unitOfWork.OfficesRepo.Find(x => x.Id == officeId); model.PRDetails = model?.PRDetails.OrderBy(x => x.ItemNo).ToList(); model.ControlNo = IdHelper.ReplaceOldControlNo(officeId, "PR", model.ControlNo); foreach (var i in model.PRDetails.Where(x => !x.Item.Contains("rtf1"))) { var rtf = new RichTextBox(); rtf.Font = new Font("Calibri", 9.5f); rtf.Text = i.Item; i.Item = rtf.Rtf; } unitOfWork.Save(); var rpt = new rptPurchaseRequest() { DataSource = new List <PurchaseRequests>() { model } }; if (office.IsDivision != true) { foreach (XRControl control in rpt.AllControls <XRControl>().Where(x => x.Tag == "Division")) { control.Visible = false; } rpt.lblDepName.DataBindings.Clear(); rpt.lblDepName.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Offices].[OfficeName]") }); } rpt.CreateDocument(); if (rpt.Pages.Count == 1) { rpt.grpFooter.PrintAtBottom = true; } frmReportViewer frm = new frmReportViewer(rpt); frm.ShowDialog(); } }
private void PrintCommand() { if (!TFCMODEL.PartNo.IsNotNullOrEmpty() || !TFCMODEL.ROUTENO.IsNotNullOrEmpty()) { ShowInformationMessage(PDMsg.NotEmpty("Part No and Process No")); return; } else { DataTable dt; GridValues(); dt = tfcbll.GetPrint(TFCMODEL); if (dt == null || dt.Rows.Count == 0) { ShowInformationMessage(PDMsg.NoRecordsPrint); } else { if (!dt.Columns.Contains("PCR_NO")) { dt.Columns.Add("PCR_NO", typeof(string)); } if (!dt.Columns.Contains("PCR_DATE")) { dt.Columns.Add("PCR_DATE", typeof(DateTime)); } if (dt.Columns.Contains("PCR_NO") && dt.Columns.Contains("PCR_DATE")) { try { dt.Rows[0]["PCR_NO"] = TFCMODEL.PCR_NO; if (TFCMODEL.PCR_DATE != null) { dt.Rows[0]["PCR_DATE"] = TFCMODEL.PCR_DATE; } } catch (Exception ex) { ex.LogException(); } } frmReportViewer frmrv = new frmReportViewer(dt, "TFC-PCR"); frmrv.ShowDialog(); } } }
private void BtnPreview_Click(object sender, EventArgs e) { if (uCPQ.PQGridView.GetFocusedRow() is PriceQuotations item) { item.PQDetails = item.PQDetails.OrderBy(x => x.ItemNo).ToList(); frmReportViewer frm = new frmReportViewer(new rptPurchaseQuotation(item) { DataSource = new List <PriceQuotations>() { item } }); frm.ShowDialog(); } }
public void GetRptAcrivitiesByProjectId(int ProjID) { var q = SubActivityCmd.GetAllSubActivitiesByProjectID(ProjID); ReportDataSource rs = new ReportDataSource(); List<ActivitesRecvtReportObj> ls = new List<ActivitesRecvtReportObj>(); foreach (var item in q) { ls.Add(new ActivitesRecvtReportObj() { ProjectName=item.ProjectProfile.ProjectName, Coin=item.ProjectProfile.Coin, ActivitesID=item.ProjectActivity.ID, ActivitesName=item.ProjectActivity.ActivityName, ActivitesDec=item.ProjectActivity.Description, StartDate=item.ProjectActivity.StartDate.Value, Enddate=item.ProjectActivity.EndDate.Value, ActivitesCost=item.ProjectActivity.TotalCost.Value, Progress=item.ProjectActivity.Progress.Value, Stauts=item.ProjectActivity.Status, //// SubActivitesName= item.SubActivityName, SubActivitesDec=item.Description, SubStartDate=item.Startdate.Value, SubEnddate=item.enddate.Value, SubCost=item.TotalCost.Value, SubProgress=item.Progress.Value, SubStauts=item.Status, AllTotalActivites = ActivityCmd.GetTotalActivity(InformationsClass.ProjID), TotalExpensess= ProjectExpensesCmd.GetTotalExpensesBySubActivity(item.ID) }); } rs.Name = "ActivitiesDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptActivties.rdlc"; frm.ShowDialog(); }
private void btnPreview_Click(object sender, EventArgs e) { try { if (LRGridView.GetFocusedRow() is Liquidations item) { frmReportViewer frm = new frmReportViewer(new rptLR() { DataSource = new UnitOfWork().LiquidationsRepo.Get(x => x.Id == item.Id) }); frm.ShowDialog(); } } catch (Exception exception) { } }
private void btnPrint_Click(object sender, EventArgs e) { try { UnitOfWork unitOfWork = new UnitOfWork(); var res = unitOfWork.InventoryRepo.Get(x => x.TransactionNumber == transactionNumber); frmReportViewer frmReportViewer = new frmReportViewer( new rptPrintReceipt() { DataSource = res }); frmReportViewer.ShowDialog(); } catch (Exception exception) { } }
private void btnPrint_Click(object sender, EventArgs e) { try { if (DeliveriesGrid.GetFocusedRow() is Deliveries item) { frmReportViewer frm = new frmReportViewer(new rptItemquipmentWidrawalSlip() { DataSource = new UnitOfWork().DeliveriesRepo.Get(x => x.Id == item.Id) }); frm.ShowDialog(); } } catch (Exception exception) { MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnPreview_Click(object sender, EventArgs e) { try { UnitOfWork unitOfWork = new UnitOfWork(); var document = unitOfWork.DocumentActionsRepo.Get(x => x.RefId == refId && x.TableName == tableName); rptDocumentLedger rpt = new rptDocumentLedger() { DataSource = document }; frmReportViewer frm = new frmReportViewer(rpt); frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void PrintSubmitCommand() { DataSet dsReport = null; if (!dsReport.IsNotNullOrEmpty() || !dsReport.Tables.IsNotNullOrEmpty() || dsReport.Tables.Count < 0) { ShowInformationMessage(PDMsg.NoRecordsPrint); return; } frmReportViewer reportViewer = new frmReportViewer(dsReport, "FRCS"); if (!reportViewer.ReadyToShowReport) { return; } reportViewer.ShowDialog(); }
public void GetByProjectId(int ProjID) { var q1 = ProjectProfileCmd.GetProjectData(ProjID); var q = TheDonorsProjectCmd.GetAllDonorsByproID(ProjID); ReportDataSource rs = new ReportDataSource(); List<ProjectReportObj> ls = new List<ProjectReportObj>(); FrmMainUserPro Mainfrm = new FrmMainUserPro(); int counter = 0; foreach (var item in q) { counter++; ls.Add(new ProjectReportObj() { //// DonerID=counter, DonorsName=item.TheDonor.Name, Cost=item.TotalCost.Value, ProjectName=item.ProjectProfile.ProjectName, ProjectDescription=item.ProjectProfile.ProjectDescription, progress=item.ProjectProfile.progress.Value, TotalCost=item.ProjectProfile.TotalCost.Value, StartDate=item.ProjectProfile.StartDate.Value, EndDate=item.ProjectProfile.EndDate.Value, Coin=item.ProjectProfile.Coin, TotalExpenses=ProjectExpensesCmd.GetTotalExpensesByProject(ProjID), TotalSalay=SalariesCmd.GetTotalSalaryByProject(ProjID), AmountRecv=AmountsReceivedsCmd.GetTotalAmountsByProject(ProjID), }); } rs.Name = "ProjectDataSet"; rs.Value = ls; frmReportViewer frm = new frmReportViewer(); frm.reportViewer1.LocalReport.DataSources.Clear(); frm.reportViewer1.LocalReport.DataSources.Add(rs); frm.reportViewer1.LocalReport.ReportEmbeddedResource = "UcasProWindowsForm.Reports.rptProject.rdlc"; frm.ShowDialog(); }
public void GenerateReport() { DataSet ds = new DataSet(); string whereClause = "Where 1=1"; builder.ConnectionString = m_Conn.ConnectionString; ModuleParaList.Add("Module ID;{Blank for All};&&&&&&&&&&& ;False;False;None;Modules List;Module ID"); frmParameter.frmParameter frmPara = new frmParameter.frmParameter(); frmPara.rptTitle = "Module List"; frmPara.rtpID = "LS001"; frmPara.ParaList = ModuleParaList; frmPara.ShowDialog(); foreach (string value in frmPara.ParaList) { if (frmPara.ParaList[0].ToString() != "") { whereClause += " And ModuleID IN (" + value + ")"; } } Comm.CommandTimeout = 0; Comm.CommandType = CommandType.Text; string SQL = "SELECT ModuleID, mdlName, mdlType, mdlCategory, frmName, Discontinued FROM M_ERP_ModulesList"; SQL = SQL + " " + whereClause; Comm.CommandText = SQL; Comm.Connection = m_Conn; Comm.Connection.Open(); SqlDataAdapter ad = new SqlDataAdapter(Comm); ad.Fill(ds); oReport = new ReportDocument(); oReport.Load("H:\\BMC-ERP\\ERPGUI\\ERP_Report\\Administration\\rptModuleList.rpt"); oReport.SetDatabaseLogon(builder.UserID, builder.Password); oReport.Database.Tables[0].SetDataSource(ds); frmReportViewer rpt = new frmReportViewer(oReport); rpt.ShowDialog(); }
private void ConfigureCrystalReports() { DataSet dsBaptismalAll = new DataSet(); ParishDataManagement.Dataset.BaptismalDataSetSchema dsBaptismal = new ParishDataManagement.Dataset.BaptismalDataSetSchema(); ParishDataManagement.Dataset.SponsorDataSetSchema dsSponsor = new ParishDataManagement.Dataset.SponsorDataSetSchema(); ParishDataManagement.Reports.rptBaptismal rptBaptismal = new ParishDataManagement.Reports.rptBaptismal(); frmReportViewer newViewer = new frmReportViewer(); MySqlConnection conn = new MySqlConnection(MyConnection.connectionString); String strQuery = "SELECT tblBaptismal.BaptismalID, CONCAT(tblPerson.Firstname,' ',tblPerson.Middlename,' ',tblPerson.Lastname) as Fullname, tblPerson.Birthdate, tblPerson.BirthPlace, " + "tblBaptismal.DateofBaptism, tblBaptismal.PlaceofBaptism, tblBaptismal.BookID, tblBaptismal.MinisterNo, tblBaptismal.ParentsIDForFather, tblBaptismal.ParentsIDForMother FROM dbparish.tblBaptismal " + "LEFT JOIN tblPerson ON tblBaptismal.PersonID = tblPerson.PersonID WHERE tblBaptismal.BaptismalID = '" + lstRecords.SelectedItems[0].Text + "'"; String strSponsorQuery = "SELECT tblSponsor.EventNo, CONCAT(tblPerson.Firstname,' ',tblPerson.Middlename,' ',tblPerson.Lastname) as Fullname FROM dbparish.tblPerson" + " LEFT JOIN tblSponsor ON tblPerson.PersonID = tblSponsor.PersonID WHERE tblSponsor.EventNo IS NOT NULL AND tblSponsor.EventNo = '" + lstRecords.SelectedItems[0].Text + "'"; conn.Open(); MySqlDataAdapter adapter = new MySqlDataAdapter(strQuery, conn); MySqlDataAdapter adapterSponsor = new MySqlDataAdapter(strSponsorQuery, conn); // adapter.Fill(dsBaptismal, "Baptismal"); adapterSponsor.Fill(dsSponsor, "Sponsor"); // dsBaptismalAll = dsBaptismal.Copy(); dsBaptismalAll.Tables[0].Merge(dsSponsor.Tables[0], true); rptBaptismal.SetDataSource(dsBaptismalAll.Tables[0]); //rptBapti smal.Subreports["rptSponsor"].SetDataSource(dsSponsor.Tables[0]); newViewer.crystalReportViewer.ReportSource = rptBaptismal; newViewer.crystalReportViewer.Refresh(); newViewer.ShowDialog(); }