private static void ShowPreview() { XtraReport1 report = new XtraReport1(); ReportPrintTool tool = new ReportPrintTool(report); tool.ShowPreview(); }
private void button1_Click(object sender, EventArgs e) { // Show the report's print preview. ReportPrintTool printTool = new ReportPrintTool(CreateReport()); printTool.ShowPreview(); }
private void btnShowReport_Click(object sender, EventArgs e) { try { var ids = (from CheckedListBoxItem item in cmbUsers.Properties.Items where item.CheckState == CheckState.Checked select(int) item.Value).ToArray(); DateTime frm = new DateTime(cmbDate.DateTime.Year, cmbDate.DateTime.Month, cmbDate.DateTime.Day, 0, 0, 0); DateTime to = new DateTime(cmbDate.DateTime.Year, cmbDate.DateTime.Month, cmbDate.DateTime.Day, 23, 59, 59); int branchId = Convert.ToInt32(cmbBranch.EditValue); //vwInventoryBindingSource.DataSource = null; var list = from s in db.vw_SaleReport where s.BranchID == branchId && s.Flag == 1 && s.Date > frm && s.Date < to && ids.Contains(s.UserID) select s; if (list.Count() <= 0) { MessageBox.Show("الفاتورة لا تحتوي علي أصناف", "طباعة فاتورة", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } //if (rgSortBy.SelectedIndex == 1) //{ // if (rgSortDirection.SelectedIndex == 1) // { // list = from s in list orderby s.Name select s; // } // else if (rgSortDirection.SelectedIndex == 0) // { // list = from s in list orderby s.Name descending select s; // } //} //else if (rgSortBy.SelectedIndex == 0) //{ // if (rgSortDirection.SelectedIndex == 1) // { // list = from s in list orderby s.CurrentQuanity select s; // } // else if (rgSortDirection.SelectedIndex == 0) // { // list = from s in list orderby s.CurrentQuanity descending select s; // } //} RedaPOS.Reports.SaleSummaryReport rpt = new RedaPOS.Reports.SaleSummaryReport(); string BranchName = cmbBranch.GetColumnValue("BranchName").ToString(); rpt.parameterBranchName.Value = BranchName; rpt.DataSource = list.ToList(); try { ReportPrintTool tool = new ReportPrintTool(rpt); tool.ShowPreview(); } catch (Exception ex) { ModuleClass.ShowExceptionMessage(this, ex, "خطأ", null); } } catch (Exception ex) { ModuleClass.ShowExceptionMessage(this, ex, "خطأ", null); } }
private void ucRo_Menu_Reportes1_event_cmdCargar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { idnomina = ucRo_Menu_Reportes1.getIdNominaTipo() == ""?0: Convert.ToInt32(ucRo_Menu_Reportes1.getIdNominaTipo()); iddivision = (ucRo_Menu_Reportes1.getIdDivision() == "")?0: Convert.ToInt32(ucRo_Menu_Reportes1.getIdDivision()); if (iddivision != 0) { listado_Rubos_x_Empleado = Bus_list_Rubros.Get_list_Rubros_X_Empleados(param.IdEmpresa, Convert.ToInt32(idnomina), Convert.ToInt32(iddivision)); } else { listado_Rubos_x_Empleado = Bus_list_Rubros.Get_list_Rubros_X_Empleados(param.IdEmpresa, Convert.ToInt32(idnomina)); } XROL_Rpt014_Rpt reporte = new XROL_Rpt014_Rpt(); reporte.Set_Lista(listado_Rubos_x_Empleado); ReportPrintTool pt = new ReportPrintTool(reporte); reporte.CreateDocument(); pt.ShowPreview(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
void bbiPrintPreview_ItemClick(object sender, ItemClickEventArgs e) { var uc = new XtraReportSumOfContracts(); ReportPrintTool reportPrintTool = new ReportPrintTool(uc); reportPrintTool.ShowPreview(); }
public void Execute() { try { viewModel.Data = repo.GetPipelineElements( viewModel.PipeNumber, viewModel.CheckedPipeTypes.Select <PipeMillSizeType, string>(x => x.Type).ToArray <string>()); if (viewModel.Data == null || viewModel.Data.Rows.Count <= 0) { log.Warn(string.Format("Data Table for Pipe Report (pipe #{0}) report is NULL or empty", viewModel.PipeNumber)); } var report = new PipeConstructionXtraReport(); report.DataSource = viewModel.PipeReportDataList; report.FootersVisibility = viewModel.IsFooterVisible; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); RefreshVisualStateEvent(); } catch (RepositoryException ex) { log.Warn(this.GetType().Name + " | " + ex.ToString()); notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message), Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header)); } }
private void btnXuatFile_Click(object sender, EventArgs e) { List <TongHoaDon_View> l = new List <TongHoaDon_View>(); TongHoaDon_View thd = new TongHoaDon_View(); thd.NgayBatDau = dateBatDau.Value.ToString("dd/MM/yyyy"); thd.NgayKetThuc = dateKetThuc.Value.ToString("dd/MM/yyyy"); thd.NhanVien = Context.getInstance().nv.TenNhanVien; thd.ThoiGian = DateTime.Now; thd.List_HoaDon = new List <HoaDon_View>(); foreach (var item in lstHD) { if (item.TrangThai == 1) { thd.TongTien += item.TongTien; thd.TongLoiNhuan += item.TongLoiNhuan; thd.List_HoaDon.Add(item); } } l.Add(thd); if (l.Count > 0) { RTongKetHoaDon r = new RTongKetHoaDon(l); var tool = new ReportPrintTool(r); tool.ShowPreview(); } else { MessageBox.Show("Không có dữ liệu!"); } }
public static void DoPrint(string pono,bool t) { var dm = new PoDataManager(); var rpt = new RptPO(); if (t) { rpt.Watermark.Text = "Internal Copy"; } else { rpt.Watermark.Text = "Supplier Copy"; dm.UpdatePrint(pono); } rpt.Watermark.TextDirection = DirectionMode.ForwardDiagonal; rpt.Watermark.Font = new Font(rpt.Watermark.Font.FontFamily, 50); rpt.Watermark.ForeColor = Color.Gray; rpt.Watermark.TextTransparency = 150; rpt.Watermark.ShowBehind = false; rpt.Company = Utils.Companyname; var ds = dm.DoPrint(pono); rpt.DataSource = ds; ReportPrintTool printTool = new ReportPrintTool(rpt); // printTool.ShowPreviewDialog(); printTool.ShowPreview(); // rpt.Print(); }
private void button1_Click(object sender, EventArgs e) { XtraReport1 report = new XtraReport1(); ReportPrintTool printTool = new ReportPrintTool(report); printTool.ShowPreview(); }
private void barButtonItemLocaleStatus_ItemClick(object sender, ItemClickEventArgs e) { DataTable dtLocaleReport = new DataTable(); XtraReportLocaleStatus localeStatusReport = new XtraReportLocaleStatus(); using (var adapt = new SqlDataAdapter("GET_LOCALE_REPORT", Utilities.con)) { adapt.SelectCommand.CommandType = CommandType.StoredProcedure; adapt.Fill(dtLocaleReport); localeStatusReport.DataSource = dtLocaleReport; } if (dtLocaleReport.Rows.Count == 0) { MessageBox.Show("No Status found"); } else { GroupField gfFlag = new GroupField(dtLocaleReport.Columns["flag"].ToString()); localeStatusReport.GroupHeader.GroupFields.Add(gfFlag); localeStatusReport.xrLabelGroup.DataBindings.Add("Text", dtLocaleReport, dtLocaleReport.Columns["flag"].ToString()); localeStatusReport.xrLabelMonth.Text = "As of " + DateTime.Now.ToString("MMMM").ToUpper(); localeStatusReport.xrLabelUser.Text = "Generated by: " + frmLogin.Username; localeStatusReport.xrTableCellStatus.DataBindings.Add("Text", dtLocaleReport, dtLocaleReport.Columns["Status"].ToString()); localeStatusReport.xrTableCellTotal.DataBindings.Add("Text", dtLocaleReport, dtLocaleReport.Columns["Total"].ToString()); localeStatusReport.CreateDocument(); ReportPrintTool printTool = new ReportPrintTool(localeStatusReport); printTool.ShowPreview(); } }
private void btnXacNhan_Click(object sender, EventArgs e) { string strMaLop = ((LopDTO)cbxLop.SelectedItem).MALOP; string strMaMonHoc = ((MonHocDTO)cbxMonHoc.SelectedItem).MaMH; string strNgayThi = dtpNgayThi.Value.GetDateTimeFormats(m_objFormat)[0]; string strLanThi = cbxLanThi.Text.Trim(); if (string.IsNullOrWhiteSpace(strLanThi) || strMaLop == null || strMaLop == null || strNgayThi == null) { MessageBox.Show("Dữ liệu không hợp lệ", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } int nLanThi; int.TryParse(strLanThi, out nLanThi); rptDanhSachThiHetMon objReport = new rptDanhSachThiHetMon(); objReport.lblTenLop.Text = DanhSachThiHetMonBUL.GetTenLop(strMaLop); objReport.lblTenMonHoc.Text = DanhSachThiHetMonBUL.GetTenMonHoc(strMaMonHoc); objReport.lblNgayThi.Text = strNgayThi.ToString(); objReport.DataSource = DanhSachThiHetMonBUL.LoadDanhSachThiHetMon(strMaLop, strMaMonHoc, nLanThi); ReportPrintTool objTool = new ReportPrintTool(objReport); objTool.ShowPreview(); }
private void btn_reporte_Click(object sender, System.EventArgs e) { if (cb_cliente.Text == "") { S_Utilidades.Mensaje_Informacion("Se debe Seleccionar el Cliente"); return; } string condicion = ""; if (cb_facturas.Text == "0") { condicion = @"([REFERENCIA] = '" + cb_cliente.SelectedValue + "')"; } else if (cb_facturas.Text != "0") { condicion = @"([REFERENCIA] = '" + cb_cliente.SelectedValue + "' AND [ID_FACTURA] = " + cb_facturas.Text + ")"; } Reportes.Rep_Pagos_Cliente report = new Reportes.Rep_Pagos_Cliente(); report.FilterString = condicion; ReportPrintTool tool = new ReportPrintTool(report); tool.ShowPreview(); }
public void Execute() { if (Prizm.Main.Common.DateExtension.CheckDiapason(viewModel.StartDate, viewModel.EndDate)) { try { data = repo.GetPipesFromInspection(viewModel.StartDate, viewModel.EndDate); IncomingReportsXtraReport report = new IncomingReportsXtraReport(); SetDataSortByColumn("number"); data.TranslateStatus<PartInspectionStatus>(SQLProvider.TableNameForInspectionReport, SQLProvider.ColumnNameForInspectionStatus, viewModel.localizedInspectionStatus); report.DataSource = data; report.FootersVisibility = viewModel.IsFooterVisible; report.CreateDocument(); var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } catch (RepositoryException ex) { log.Error(string.Concat(ex.InnerException.Message, ex.Message)); notify.ShowFailure(ex.InnerException.Message, ex.Message); } } else { notify.ShowInfo(Program.LanguageManager.GetString(StringResources.Message_FailureReportDate), Program.LanguageManager.GetString(StringResources.Message_FailureReportDateHeader)); log.Warn("Date limits not valid!" + "Diapason: start date= " + viewModel.StartDate.ToString() + " end date= " + viewModel.EndDate.ToString()); } }
private void barButtonCelebrantReport_ItemClick(object sender, ItemClickEventArgs e) { DataTable dtCelebrants = new DataTable(); XtraReportCelebrants celebrantsReport = new XtraReportCelebrants(); using (var adapt = new SqlDataAdapter("GET_CELEBRANTS", Utilities.con)) { adapt.SelectCommand.CommandType = CommandType.StoredProcedure; adapt.Fill(dtCelebrants); celebrantsReport.DataSource = dtCelebrants; } if (dtCelebrants.Rows.Count == 0) { MessageBox.Show("No celebrants found"); } else { celebrantsReport.xrLabelMonth.Text = DateTime.Now.ToString("MMMM").ToUpper() + " CELEBRANTS"; celebrantsReport.xrLabelUser.Text = "Generated by: " + frmLogin.Username; celebrantsReport.xrTableCellChurchID.DataBindings.Add("Text", dtCelebrants, dtCelebrants.Columns["Church_Id"].ToString()); celebrantsReport.xrTableCellName.DataBindings.Add("Text", dtCelebrants, dtCelebrants.Columns["BrethrenName"].ToString()); celebrantsReport.xrTableCellDateBaptism.DataBindings.Add("Text", dtCelebrants, dtCelebrants.Columns["Date_Baptism"].ToString()); celebrantsReport.xrTableCellAge.DataBindings.Add("Text", dtCelebrants, dtCelebrants.Columns["Age_Church"].ToString()); celebrantsReport.xrTableCellStatus.DataBindings.Add("Text", dtCelebrants, dtCelebrants.Columns["Status"].ToString()); celebrantsReport.CreateDocument(); ReportPrintTool printTool = new ReportPrintTool(celebrantsReport); printTool.ShowPreview(); } }
public frmPrintBarcode(frmPrintBarcode _barcode) { try { InitializeComponent(); splashScreenManager1.ShowWaitForm(); this.pBarocde = _barcode; sBundleTicket report = new sBundleTicket(); rptBarcodeList s = new rptBarcodeList(); OprationBarcodeList list = new OprationBarcodeList(); //report.SetDataSource(list.StickerBarcodeList(pBarocde.Options, pBarocde.CutNo, pBarocde.From, pBarocde.To)); //this.crystalReportViewer1.ReportSource = report; BarcodeLabel lbl = new BarcodeLabel(); lbl.DataSource = list.StickerBarcodeList(pBarocde.Options, pBarocde.CutNo, pBarocde.From, pBarocde.To); ReportPrintTool tool = new ReportPrintTool(lbl); tool.ShowPreview(); splashScreenManager1.CloseWaitForm(); }catch(Exception ex) { MessageBox.Show(ex.Message); Debug.WriteLine(ex.Message); } }
private void barButtonGenerate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (string.IsNullOrWhiteSpace(lueCommitteeReport.Text)) { Utilities.ErrorMessage("Please Select Committee"); } else { BindAttendanceToReport(); if (dtCommittee.Rows.Count == 0) { Utilities.ErrorMessage("No Record(s) found"); } else { SetHeaders(); committeeReport.xrTableCellChurchID.DataBindings.Add("Text", dtCommittee, dtCommittee.Columns["Church_Id"].ToString()); committeeReport.xrTableCellName.DataBindings.Add("Text", dtCommittee, dtCommittee.Columns["BrethrenName"].ToString()); committeeReport.xrTableCellStatus.DataBindings.Add("Text", dtCommittee, dtCommittee.Columns["Status"].ToString()); committeeReport.CreateDocument(); ReportPrintTool printTool = new ReportPrintTool(committeeReport); printTool.ShowPreview(); this.Close(); } } }
private void btn_XuatHD_Click(object sender, EventArgs e) { string result = checkSeri(); if (result.Equals("")) { List <HoaDonNhap_View> lst = new List <HoaDonNhap_View>(); hoadonnhap.ChiTietHoaDon = ls_cthd; hoadonnhap.GhiChu = txtGhiChu.Text.Trim(); hoadonnhap.NgayLap = dateNgayBan.Value; hoadonnhap.NhaCungCap = cbxTenNCC.Text.Trim(); //bien trang thai hoa don hoadonnhap.TrangThai = 1; lst.Add(hoadonnhap); //r = HoaDon_DAL.getAll_HoaDon(); RHoaDonNhap r = new RHoaDonNhap(lst); var tool = new ReportPrintTool(r); tool.ShowPreview(); } else { MessageBox.Show("Bạn chưa nhập đầy đủ số Seri của linh kiện " + result); } }
private void btnXacNhan_Click(object sender, EventArgs e) { string strMaLop = ((LopDTO)cbxLop.SelectedItem).MALOP; string strMaMonHoc = ((MonHocDTO)cbxMonHoc.SelectedItem).MaMH; string strLanThi = cbxLanThi.Text.Trim(); if (string.IsNullOrWhiteSpace(strLanThi) || strMaLop == null || strMaLop == null) { MessageBox.Show("Dữ liệu không hợp lệ", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } int nLanThi; int.TryParse(strLanThi, out nLanThi); rptBangDiemMonHoc objReport = new rptBangDiemMonHoc(); objReport.lblLop.Text = BangDiemMonHocBUL.GetTenLop(strMaLop); objReport.lblMonHoc.Text = BangDiemMonHocBUL.GetTenMonHoc(strMaMonHoc); objReport.lblLanThi.Text = strLanThi; objReport.DataSource = BangDiemMonHocBUL.LoadBangDiemMonHoc(strMaLop, strMaMonHoc, nLanThi); ReportPrintTool objTool = new ReportPrintTool(objReport); objTool.ShowPreview(); }
private void btnShowReport_Click(object sender, EventArgs e) { try { FinancialDailyRPT rpt = new FinancialDailyRPT(); DateTime from = cmbDate.DateTime; var summary = db.FinancialSummary(from); if (summary.Any()) { rpt.bindingSource1.DataSource = summary.ToList(); rpt.parameterFrom.Value = cmbDate.DateTime; try { ReportPrintTool tool = new ReportPrintTool(rpt); tool.ShowPreview(); } catch (Exception ex) { ModuleClass.ShowExceptionMessage(this, ex, "خطأ", null); } } } catch (Exception ex) { ModuleClass.ShowExceptionMessage(this, ex, "خطأ", null); } }
private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (gridView1.RowCount <= 0) { XtraMessageBox.Show("Chưa có hóa đơn nào"); return; } if (gridView2.RowCount <= 0) { XtraMessageBox.Show("Chưa mua hàng hóa nào"); return; } string ngaylap = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "NgayLap_Xuat").ToString(); DateTime ngaylaphoadon = DateTime.Parse(ngaylap); ChiTietHDXuat2 rpt = new ChiTietHDXuat2(ngaylaphoadon.Day.ToString(), ngaylaphoadon.Month.ToString(), ngaylaphoadon.Year.ToString()); rpt.DataSource = hdxuat.loadchitiethdxuat(txtMaHDXuat.Text); ReportPrintTool tool = new ReportPrintTool(rpt); tool.ShowPreview(); }
private void btnPrintByCustomer_Click(object sender, EventArgs e) { CustomersBO aCustomersBO = new CustomersBO(); Customers aCustomer = new Customers(); aCustomer = aCustomersBO.Select_ByID(int.Parse(loeListCustomer.EditValue.ToString())); this.aNewPaymentEN = this.aNewPaymentEN.SlipPaymentByCustomer(aCustomer); try { if (this.aNewPaymentEN.Status_BookingR == 8 || this.aNewPaymentEN.Status_BookingR == 7) { frmRpt_Payment_BookingRs afrmRpt_Payment_BookingRs = new frmRpt_Payment_BookingRs(this.aNewPaymentEN); ReportPrintTool tool = new ReportPrintTool(afrmRpt_Payment_BookingRs); tool.ShowPreview(); } else { frmRpt_Payment_BookingRsUnPay afrmRpt_Payment_BookingRs = new frmRpt_Payment_BookingRsUnPay(this.aNewPaymentEN); ReportPrintTool tool = new ReportPrintTool(afrmRpt_Payment_BookingRs); tool.ShowPreview(); } } catch (Exception ex) { MessageBox.Show("frmTsk_ChoosePrintType.btnPrint_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Execute() { viewModel.ReportCommand.Execute(); if (viewModel.ReportType == ReportType.TracingReport) { var report = new TracingReport(); report.DataSource = viewModel.ReportDataSource; report.PipelineJointCount = viewModel.PipelineJointCount; report.PipelinePipeCount = viewModel.PipelinePipeCount; report.PipelineSpoolCount = viewModel.PipelineSpoolCount; report.PipelineComponentCount = viewModel.PipelineComponentCount; report.PipelineLength = viewModel.PipelineLength; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } else if (viewModel.ReportType == ReportType.UsedProductReport) { var report = new UsedProductsXtraReport(); report.DataSource = viewModel.ReportDataSource; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } }
public void Execute() { if (Prizm.Main.Common.DateExtension.CheckDiapason(viewModel.StartDate, viewModel.EndDate)) { try { data = repo.GetPipesFromInspection(viewModel.StartDate, viewModel.EndDate); IncomingReportsXtraReport report = new IncomingReportsXtraReport(); SetDataSortByColumn("number"); data.TranslateStatus <PartInspectionStatus>(SQLProvider.TableNameForInspectionReport, SQLProvider.ColumnNameForInspectionStatus, viewModel.localizedInspectionStatus); report.DataSource = data; report.FootersVisibility = viewModel.IsFooterVisible; report.CreateDocument(); var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } catch (RepositoryException ex) { log.Error(string.Concat(ex.InnerException.Message, ex.Message)); notify.ShowFailure(ex.InnerException.Message, ex.Message); } } else { notify.ShowInfo(Program.LanguageManager.GetString(StringResources.Message_FailureReportDate), Program.LanguageManager.GetString(StringResources.Message_FailureReportDateHeader)); log.Warn("Date limits not valid!" + "Diapason: start date= " + viewModel.StartDate.ToString() + " end date= " + viewModel.EndDate.ToString()); } }
public void Execute() { try { if(Prizm.Main.Common.DateExtension.CheckDiapason(viewModel.WeldDateFrom, viewModel.WeldDateTo)) { viewModel.Data = repo.GetPipelineElements(viewModel.WeldDateFrom, viewModel.WeldDateTo); if(viewModel.Data == null || viewModel.Data.Rows.Count <= 0) log.Warn("Construction report: Data Table for Weld by Date report is NULL or empty"); var report = new WeldDateXtraReport(); report.DataSource = viewModel.WeldDateReportDataList; report.FootersVisibility = viewModel.IsFooterVisible; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); RefreshVisualStateEvent(); } else { notify.ShowInfo(Program.LanguageManager.GetString(StringResources.Message_FailureReportDate), Program.LanguageManager.GetString(StringResources.Message_FailureReportDateHeader)); log.Warn("Date limits not valid!" + "Diapason: start date= " + viewModel.WeldDateFrom.ToString() + " end date= " + viewModel.WeldDateTo.ToString()); } } catch(RepositoryException ex) { log.Warn(this.GetType().Name + " | " + ex.ToString()); notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message), Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header)); } }
public void Execute() { try { viewModel.Data = repo.GetPipelineElements( viewModel.PipeNumber, viewModel.CheckedPipeTypes.Select<PipeMillSizeType, string>(x => x.Type).ToArray<string>()); if(viewModel.Data == null || viewModel.Data.Rows.Count <= 0) log.Warn(string.Format("Data Table for Pipe Report (pipe #{0}) report is NULL or empty", viewModel.PipeNumber)); var report = new PipeConstructionXtraReport(); report.DataSource = viewModel.PipeReportDataList; report.FootersVisibility = viewModel.IsFooterVisible; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); RefreshVisualStateEvent(); } catch(RepositoryException ex) { log.Warn(this.GetType().Name + " | " + ex.ToString()); notify.ShowWarning(Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Message), Program.LanguageManager.GetString(StringResources.Notification_Error_Db_Header)); } }
private void btnXuatFile_Click(object sender, EventArgs e) { List <NhanVien_Report> l = new List <NhanVien_Report>(); NhanVien_Report thd = new NhanVien_Report(); thd.NhanVien = Context.getInstance().nv.TenNhanVien; thd.ThoiGian = DateTime.Now; thd.List_NhanVien = new List <NhanVien_View>(); foreach (var item in lstHD) { if (item.TrangThai == 1) { thd.TongTien += item.Tong; thd.List_NhanVien.Add(item); } } l.Add(thd); if (l.Count > 0) { RNhanVien r = new RNhanVien(l); var tool = new ReportPrintTool(r); tool.ShowPreview(); } else { MessageBox.Show("Không có dữ liệu!"); } }
private void printSelectedToolStripMenuItem_Click(object sender, EventArgs e) { if (rdoNone.Checked == true) { string dealno = ""; //print the deal not for the selected deal(s) for (int i = 0; i < vwDeals.RowCount; i++) { if (vwDeals.IsRowSelected(i)) { dealno = vwDeals.GetRowCellValue(i, "dealno").ToString(); if (dealno.Substring(0, 1) == "B") { //change connection string ViewReports.BNOTE bnote = new ViewReports.BNOTE(); bnote.Parameters["dealno"].Value = dealno; ((SqlDataSource)bnote.DataSource).ConfigureDataConnection += ViewDeals_ConfigureDataConnection; ReportPrintTool tool = new ReportPrintTool(bnote); tool.ShowPreview(); } else if (dealno.Substring(0, 1) == "S") { ViewReports.SNOTE snote = new ViewReports.SNOTE(); snote.Parameters["dealno"].Value = dealno; ((SqlDataSource)snote.DataSource).ConfigureDataConnection += ViewDeals_ConfigureDataConnection; ReportPrintTool tool = new ReportPrintTool(snote); tool.ShowPreview(); } } } } }
private void ImprimirFactura(int idFactura) { List <EPI_SP_LISTARFACTURAEDICIONResult> lstFactura = BLFacturacion.GetListaFacturaEdicion(idFactura); //if (lstFactura.Count < 1) return; string mensaje = ""; if (lstFactura[0].BIT_ANULADA == true) { mensaje = "El documento está anulado, no puede imprimir"; } if (lstFactura[0].BIT_IMPRESA == true) { mensaje = "El documento ya se encuentra impreso, no puede imprimir, solo visualizar B01 y B03"; } XR_FacturaVenta XR_Factura = new XR_FacturaVenta(); foreach (Parameter p in XR_Factura.Parameters) { p.Visible = false; } List <BEFacturaDetalle> lstDetalleFactura = (from df in lstFactura where df.EPI_NUM_IDFACTURADETALLE != null select new BEFacturaDetalle { EPI_NUM_IDFACTURADETALLE = Convert.ToInt32(df.EPI_NUM_IDFACTURADETALLE ?? 0), EPI_INT_ITEM = df.EPI_INT_ITEM ?? 0, EPI_INT_IDPRODUCTO = df.EPI_INT_IDPRODUCTO ?? 0, EPI_NUM_CANTIDAD = df.EPI_NUM_CANTIDAD ?? 0, EPI_VCH_DESCRIPCION = df.EPI_VCH_DESCRIPCION, EPI_INT_IDUNIDADMEDIDA = df.EPI_INT_IDUNIDADMEDIDA ?? 0, EPI_VCH_UNIDADMEDIDA = df.EPI_VCH_UNIDADMEDIDA, EPI_INT_IDIMPUESTO = df.EPI_INT_IDIMPUESTO ?? 0, EPI_NUM_VALORUNITARIO = Math.Round(Convert.ToDecimal(df.EPI_NUM_VALORUNITARIO), 2, MidpointRounding.AwayFromZero), EPI_NUM_SUBTOTAL = Math.Round(Convert.ToDecimal(df.EPI_NUM_SUBTOTAL), 2, MidpointRounding.AwayFromZero), EPI_NUM_IGVVENTA = Math.Round(Convert.ToDecimal(df.EPI_NUM_IGVVENTA), 2, MidpointRounding.AwayFromZero), EPI_NUM_IMPORTETOTAL = Math.Round(Convert.ToDecimal(df.EPI_NUM_IMPORTETOTAL), 2, MidpointRounding.AwayFromZero), EPI_BIT_ACTIVO = df.EPI_BIT_ACTIVO ?? false, EPI_VCH_CLIENTEENTIDAD = lstFactura[0].PERSONAFACTURARAZONSOCIAL, EPI_VCH_DIRECCIONENTIDAD = lstFactura[0].PERSONAFACTURADIRECCION, EPI_VCH_RUC = lstFactura[0].PERSONAFACTURANUMERODOCUMENTO, EPI_VCH_NUMEROENLETRAS = lstFactura[0].TOTALENLETRAS, EPI_DAT_FECHAEMISION = Convert.ToDateTime(lstFactura[0].FECHADESDE.ToString()), }).ToList(); XR_Factura.InitData(lstDetalleFactura); ReportPrintTool tool = new ReportPrintTool(XR_Factura); //tool.Print(); tool.ShowPreview(); BLFacturacion.MarcaImpresa(idFactura, true); }
public void Execute() { if (viewModel.StartDate > viewModel.EndDate) { notify.ShowNotify(Program.LanguageManager.GetString(StringResources.Message_FailureReportDate), Program.LanguageManager.GetString(StringResources.Message_FailureReportDateHeader)); } try { if (viewModel.SelectedReportType == MillReportType.ByProducing) { data = repo.GetPipes(viewModel.StartDate, viewModel.EndDate); AdditionToTheReport report = new AdditionToTheReport(); BindingList <double> counts = repo.CountPipe(viewModel.StartDate, viewModel.EndDate); report.PipesCount = counts[0]; report.PipesLength = counts[1]; report.PipesWeight = counts[2]; report.DataSource = data; report.CreateDocument(); var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } else if (viewModel.SelectedReportType == MillReportType.General) { data = repo.CountWeldInf(viewModel.StartDate, viewModel.EndDate); GeneralInformationXtraReport report = new GeneralInformationXtraReport(); report.DataSource = data; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } else if (viewModel.SelectedReportType == MillReportType.ByShipped) { LoadingXtraReport report = new LoadingXtraReport(); report.DataSource = repo.GetReleaseNotes(viewModel.StartDate, viewModel.EndDate); SubReportShippingRailCar report2 = new SubReportShippingRailCar(); report.RequestParameters = false; report.xrSubreport1.ReportSource = report2; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } else { data = repo.GetPipesByStatus(viewModel.StartDate, viewModel.EndDate, viewModel.SearchIds, viewModel.SelectedReportType, viewModel.SearchStatuses); MillReportsXtraReport report = new MillReportsXtraReport(); report.DataSource = data; report.CreateDocument(); var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } } catch (RepositoryException ex) { log.Error(string.Concat(ex.InnerException.Message, ex.Message)); notify.ShowFailure(ex.InnerException.Message, ex.Message); } }
private void GetData(DateTime _fromDate,DateTime _toDate){ try { var DataList = from items in _OperationRepository.GetAll().ToList() where items.Date >= _fromDate && items.Date >= _toDate orderby items.WorkstationNo select items; foreach (var pcs in DataList) { lstProduction.Add(new HourlyIndividualProduction { EmployeeID=pcs.EmployeeID, Name=GetEmployeeNameByID(pcs.EmployeeID), WorkstationNo=pcs.WorkstationNo,OperationNo=pcs.OperationNo,OperationName=pcs.OperationName,HourNo=pcs.HourNo,Efficiency=pcs.Efficiency,EarnSAH=pcs.SAH ,PCS=pcs.Pcs,Date=pcs.Date,StyleNo=pcs.StyleNo}); } HourlyProductionByOperation report = new HourlyProductionByOperation(); report.DataSource = lstProduction; ReportPrintTool tool = new ReportPrintTool(report); report.PrintingSystem.Document.AutoFitToPagesWidth = 1; tool.ShowPreview(); } catch(Exception ex){ } }
private void btnXacNhan_Click(object sender, EventArgs e) { string strMaSinhVien = txtMaSV.Text.Trim().ToUpper(); if (string.IsNullOrWhiteSpace(strMaSinhVien)) { MessageBox.Show("Dữ liệu không hợp lệ!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } for (int i = 0; i < m_lstSinhVien.Count; i++) { if (strMaSinhVien.Equals(m_lstSinhVien[i].MASV.ToUpper().Trim())) { rptBangDiemSinhVien objReport = new rptBangDiemSinhVien(); objReport.lblMaSV.Text = strMaSinhVien.ToUpper(); objReport.lblHoVaTen.Text = BangDiemSinhVienBUL.GetHoTen(strMaSinhVien).ToUpper(); objReport.lblLop.Text = BangDiemSinhVienBUL.GetMaLop(strMaSinhVien).ToUpper(); objReport.DataSource = BangDiemSinhVienBUL.LoadPhieuDiem(strMaSinhVien); ReportPrintTool tool = new ReportPrintTool(objReport); tool.ShowPreview(); return; } } MessageBox.Show("Mã sinh viên không tồn tại!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); }
private void btnShowReorderItems_Click(object sender, EventArgs e) { try { int ReorderPoint = Convert.ToInt32(txtReorderPoint.EditValue); //vwInventoryBindingSource.DataSource = null; var list = from s in db.vw_Inventory where s.CurrentQuanity < ReorderPoint && s.BranchID == BranchID select s; ReorderRPT rpt = new ReorderRPT(ReorderPoint.ToString()); rpt.DataSource = list.ToList(); try { //string InvoicePrinter = System.Configuration.ConfigurationManager.AppSettings["InvoicePrinter"]; ReportPrintTool tool = new ReportPrintTool(rpt); tool.ShowPreview(); //Print(InvoicePrinter);// } catch (Exception ex) { ModuleClass.ShowExceptionMessage(this, ex, "خطأ", null); } } catch (Exception ex) { ModuleClass.ShowExceptionMessage(this, ex, "خطأ", null); } }
private void barButtonNewlyBaptizedReport_ItemClick(object sender, ItemClickEventArgs e) { DataTable dtNewlyBaptized = new DataTable(); XtraReportNewlyBaptized newlyBaptizedReport = new XtraReportNewlyBaptized(); using (var adapt = new SqlDataAdapter("GET_NEWLY_BAPTIZED", Utilities.con)) { adapt.SelectCommand.CommandType = CommandType.StoredProcedure; adapt.Fill(dtNewlyBaptized); newlyBaptizedReport.DataSource = dtNewlyBaptized; } if (dtNewlyBaptized.Rows.Count == 0) { MessageBox.Show("No Newly Baptized Found"); } else { newlyBaptizedReport.xrLabelAsOfDate.Text = "As of " + DateTime.Now.ToString("MMMM dd, yyyy"); newlyBaptizedReport.xrLabelUser.Text = "Generated by: " + frmLogin.Username; newlyBaptizedReport.xrTableCellChurchID.DataBindings.Add("Text", dtNewlyBaptized, dtNewlyBaptized.Columns["Church_Id"].ToString()); newlyBaptizedReport.xrTableCellName.DataBindings.Add("Text", dtNewlyBaptized, dtNewlyBaptized.Columns["BrethrenName"].ToString()); newlyBaptizedReport.xrTableCellBaptismDate.DataBindings.Add("Text", dtNewlyBaptized, dtNewlyBaptized.Columns["Date_Baptism"].ToString()); newlyBaptizedReport.xrTableCellStatus.DataBindings.Add("Text", dtNewlyBaptized, dtNewlyBaptized.Columns["Status"].ToString()); newlyBaptizedReport.CreateDocument(); ReportPrintTool printTool = new ReportPrintTool(newlyBaptizedReport); printTool.ShowPreview(); } }
private void SimpleButton1_Click(object sender, EventArgs e) { Hoadonthutratien hoadonthutratien = laythongtinhoadonchi(); tratienBUS.themhoadonchi(hoadonthutratien); CThoadonchi(); if (checkin.Checked == true) { Inhoadonthuchi dsnguoidung = new Inhoadonthuchi(); dsnguoidung.DataSource = luoithutratiens; ReportPrintTool report = new ReportPrintTool(dsnguoidung); dsnguoidung.txtmahoadon.Text = txtmahoadonchi.Text; dsnguoidung.txtname.Text = cbbNcc.Text; dsnguoidung.txtngay.Text = txtngaylap.Text; dsnguoidung.txtsodienthoai.Text = txtsodienthoai.Text; dsnguoidung.txttienconno.Text = tongTienno().ToString(); dsnguoidung.txttongtientra.Text = tongTientra().ToString(); dsnguoidung.lbltieude.Text = "Hóa đơn trả tiền"; dsnguoidung.lblthutratien.Text = "Người thanh toán"; dsnguoidung.txttienctytra.Text = "Tiền công ty trả trước:"; dsnguoidung.txtctyconno.Text = "Tiền công ty trả còn nợ"; dsnguoidung.lblbt3.Text = "Nhà cung cấp"; dsnguoidung.lblname.Text = "Nhà cung cấp:"; report.ShowPreview(); } }
private void printAllToolStripMenuItem_Click(object sender, EventArgs e) { if (vwDeals.RowCount == 0) { MessageBox.Show("No deal notes to print!", "Falcon", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string dealno = ""; for (int i = 0; i < vwDeals.RowCount; i++) { dealno = vwDeals.GetRowCellValue(i, "dealno").ToString(); if (dealno.Substring(0, 1) == "B") { ViewReports.BNOTE bnote = new ViewReports.BNOTE(); bnote.Parameters["dealno"].Value = dealno; ((SqlDataSource)bnote.DataSource).ConfigureDataConnection += ViewDeals_ConfigureDataConnection; ReportPrintTool tool = new ReportPrintTool(bnote); tool.ShowPreview(); } else if (dealno.Substring(0, 1) == "S") { ViewReports.SNOTE snote = new ViewReports.SNOTE(); snote.Parameters["dealno"].Value = dealno; ((SqlDataSource)snote.DataSource).ConfigureDataConnection += ViewDeals_ConfigureDataConnection; ReportPrintTool tool = new ReportPrintTool(snote); tool.ShowPreview(); } } }
private void Imprimir() { try { XBAN_FJ_Rpt002_Rpt Reporte = new XBAN_FJ_Rpt002_Rpt(); Reporte.Parameters["Fecha_inicio"].Value = Convert.ToDateTime(ucBa_Menu.get_FchIni()); Reporte.Parameters["Fecha_fin"].Value = Convert.ToDateTime(ucBa_Menu.get_FchFin()); Reporte.Parameters["IdEmpresa"].Value = param.IdEmpresa; Reporte.RequestParameters = false; ReportPrintTool pt = new ReportPrintTool(Reporte); pt.ShowPreview(); XBAN_FJ_Rpt003_Rpt Reporte_Graf = new XBAN_FJ_Rpt003_Rpt(); Reporte_Graf.Parameters["FechaInicio"].Value = Convert.ToDateTime(ucBa_Menu.get_FchIni()); Reporte_Graf.Parameters["FechaFin"].Value = Convert.ToDateTime(ucBa_Menu.get_FchFin()); Reporte_Graf.Parameters["IdEmpresa"].Value = param.IdEmpresa; Reporte_Graf.RequestParameters = false; ReportPrintTool ptG = new ReportPrintTool(Reporte_Graf); ptG.ShowPreview(); } catch (Exception) { } }
private void button1_Click(object sender, EventArgs e) { // Create a report. XtraReport1 report = new XtraReport1(); // Create a label with a title. XrTitledLabel label = new XrTitledLabel(); label.Height = 100; label.Width = 150; label.Borders = DevExpress.XtraPrinting.BorderSide.All; label.BackColor = Color.Pink; label.ForeColor = Color.White; // Set its text properties. label.Text = "Some very-very-very-very-very large text"; // Set its title properties. label.DisplayTitle = true; label.TitleText = "Title"; label.TitleColor = Color.Blue; // Add a label to a report. report.Detail.Controls.Add(label); // Show the Print Preview form. ReportPrintTool printTool = new ReportPrintTool(report); printTool.ShowPreview(); }
private void ReportClick(object sender, EventArgs e) { ArrayList v_arr_list = new ArrayList(); v_arr_list.Add(new iParameter("iP_tieu_de_bao_cao", "BAO CAO DANH MUC MON HOC")); v_arr_list.Add(new iParameter("iP_trung_tam", "TO HOP GIAO DUC TOPICA")); v_arr_list.Add(new iParameter("iP_date_time", "Hà Nội, ngày 23 tháng 7 năm 2015")); BKI_QLTTQuocAnh.BaoCao.RPT_XtraReport v_xr = new BKI_QLTTQuocAnh.BaoCao.RPT_XtraReport(m_ds, m_grv, v_arr_list, System.Drawing.Printing.PaperKind.A4, true); ReportPrintTool v_xrpt = new ReportPrintTool(v_xr); v_xrpt.ShowPreview(); }
private void btnPrint_Click(object sender, EventArgs e) { // List<sp_BookingExt_GetAllBooking_Result> aListAllBookingEN = new List<sp_BookingExt_GetAllBooking_Result>(); frmRpt_Revenues aReport = new frmRpt_Revenues(aListAllBookingEN, From,To, SumServiceHalls1_NotTax, SumServiceHalls2_NotTax, SumServiceHalls3_NotTax, SumServiceRooms1_NotTax, SumServiceRooms2_NotTax, SumServiceRooms3_NotTax); ReportPrintTool tool = new ReportPrintTool(aReport); tool.ShowPreview(); }
private void btnPrintPerformance_Click(object sender, EventArgs e) { try { frmRpt_Performance_Rooms afrmRpt_Performance_Rooms = new frmRpt_Performance_Rooms(dtpFrom.DateTime, dtpTo.DateTime, 1);// 1 = IDLang ReportPrintTool tool = new ReportPrintTool(afrmRpt_Performance_Rooms); tool.ShowPreview(); }catch(Exception ex) { MessageBox.Show("frmTsk_CalculationEfficiency.btnPrintPerformance_Click\n" + ex.ToString()); } }
private void btnPrint_Click(object sender, EventArgs e) { if (LUEItems.EditValue == null) { return; } DataSources.dsTinyData.ProductsRow row = (DataSources.dsTinyData.ProductsRow)((DataRowView)LUEItems.GetSelectedDataRow()).Row; XrepBarcode rep = new XrepBarcode(row.ProductNumber, row.SellPrice.ToString()); // Create a Print Tool and show the Print Preview form. ReportPrintTool printTool = new ReportPrintTool(rep); printTool.ShowPreview(); }
private void button1_Click(object sender, EventArgs e) { var Buf = new List<string>(); foreach (string item in listBox1.Items) { Buf.Add(item); } var r = new XtraReport1(); r.AddLabel(Buf, new Rectangle(0,0,630,23)); var printTool = new ReportPrintTool(r); printTool.ShowPreview(); }
public static void DoPrint(string tranid) { var dm = new ItemMoveDataManager(); var rpt = new Reports.RptItemMove { Company = Utils.Companyname , Header = "Item Transfer"}; var ds = dm.RptItemMove(tranid, Utils.Company); rpt.DataSource = ds; ReportPrintTool printTool = new ReportPrintTool(rpt); printTool.ShowPreview(); }
private void button3_Click(object sender, EventArgs e) { var rpt = new ReportPrintTool(new zayvkaReport1() { DataSource = new BindingSource() { DataSource = GetZakaz() } }); rpt.Report.CreateDocument(false); rpt.ShowPreview(); }
public void buttonPrint_Click(object sender, EventArgs e) { var rpt = new ReportPrintTool(new RegistrationReport() { DataSource = new BindingSource() { DataSource = GetSportsmens() } }); rpt.Report.CreateDocument(false); rpt.ShowPreview(); }
private void btnPreview_Click(object sender, EventArgs e) { Properties.Settings.Default.PrintFontName = (string)this.fontEdit1.EditValue; Properties.Settings.Default.PrintFontSize = this.spinFontSize.Value; Properties.Settings.Default.PrintSortByName = this.rbSortByNumber.Checked; Properties.Settings.Default.Save(); using (var font = new Font(this.fontEdit1.Text, (float)this.spinFontSize.Value)) using (var report = new ChannelListReport(this.channelList, this.subListIndex, this.rbSortByName.Checked, font)) using (ReportPrintTool printTool = new ReportPrintTool(report)) { printTool.ShowPreviewDialog(); printTool.ShowPreview(UserLookAndFeel.Default); } }
private void btnPrint_Click(object sender, EventArgs e) { try { frmRpt_DetailMenus afrmRpt_DetailMenus = new frmRpt_DetailMenus(this.IDMenu,0); ReportPrintTool tool = new ReportPrintTool(afrmRpt_DetailMenus); tool.ShowPreview(); this.Close(); } catch (Exception ex) { MessageBox.Show("frmLst_DetailMenus.btnPrint_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void simpleButton1_Click(object sender, EventArgs e) { // Create a report instance, assigned to a Print Tool. ReportPrintTool pt = new ReportPrintTool(new XtraReport1()); // Get the Print Tool's printing system. PrintingSystemBase ps = pt.PrintingSystem; // Show a report's Print Preview. pt.ShowPreview(); // Zoom the print preview, so that it fits the entire page. ps.ExecCommand(PrintingSystemCommand.ViewWholePage); // Invoke the Hand tool. ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { true }); // Hide the Hand tool. ps.ExecCommand(PrintingSystemCommand.HandTool, new object[] { false }); }
void GenarateReport(string _styleNo,int _from,int _to) { try { GenaricRepository<OprationBarcodes> _ItemRepo = new GenaricRepository<OprationBarcodes>(new ItrackContext()); var items = from item in _ItemRepo.GetAll().ToList() where item.StyleNo == _styleNo && item.BundleDetails.BundleNo >= _from && item.BundleDetails.BundleNo < _to && item.isOparationComplete==true select item; BundleWiseProduction lbl = new BundleWiseProduction(); lbl.DataSource = items; ReportPrintTool tool = new ReportPrintTool(lbl); tool.ShowPreview(); } catch(Exception ex){ } }
private void GenarateReport() { try { rptDailiyProByHour report = new rptDailiyProByHour(); report.DataSource = GetReportData(Convert.ToDateTime(txtFromDate.Text), Convert.ToDateTime(txttoDate.Text)); report.Landscape = true; report.PrintingSystem.Document.AutoFitToPagesWidth = 1; ReportPrintTool tool = new ReportPrintTool(report); tool.ShowPreview(); } catch (Exception ex) { } }
public void Execute() { viewModel.ReportCommand.Execute(); if (viewModel.canCreateReport) { if (viewModel.ReportType == ReportType.TracingReport) { var report = new TracingReport(); report.DataSource = viewModel.ReportDataSource; report.FootersVisibility = viewModel.IsFooterVisible; report.PipelineJointCount = viewModel.PipelineJointCount; report.PipelinePipeCount = viewModel.PipelinePipeCount; report.PipelineSpoolCount = viewModel.PipelineSpoolCount; report.PipelineComponentCount = viewModel.PipelineComponentCount; report.PipelineLength = viewModel.PipelineLength; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } else if (viewModel.ReportType == ReportType.UsedProductReport) { var report = new UsedProductsXtraReport(viewModel.localizedPartType); report.DataSource = viewModel.ReportDataSource; report.FootersVisibility = viewModel.IsFooterVisible; var tool = new ReportPrintTool(report); tool.AutoShowParametersPanel = false; tool.ShowPreview(); } } }
private void button1_Click(object sender, EventArgs e) { var mcd = new MatCenData(); mcd.NazvOrg = NazvOrg.Text; mcd.GiveDate = GiveDate.Value; mcd.LongDate = LongDate.Value; mcd.NaimAdress = NaimAdress.Text; mcd.CountNumber = CountNumber.Text; mcd.Bank = Bank.Text; mcd.Job = Job.Text; mcd.SurName = SurName.Text; mcd.Name1 = Name1.Text; mcd.PatronimicName = PatronimicName.Text; mcd.PassSer = PassSer.Text; mcd.PassNumber = PassNumber.Text; mcd.PassGive = PassGive.Text; mcd.PassGiveDate = PassGiveDate.Value; mcd.DillerName = DillerName.Text; mcd.NaimNumberDocum = NaimNumberDocum.Text; mcd.DateDocum = DateDocum.Value; foreach (MatData ed in listBox.Items) { mcd.Mat.Add(ed); } var rpt = new ReportPrintTool(new MatCenXtraReport() { DataSource = new BindingSource() { DataSource = mcd } }); rpt.Report.CreateDocument(false); rpt.ShowPreview(); }
private void tsbPrint_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (gridView1.FocusedRowHandle < 0) return; long id = long.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, col_id).ToString()); Account a = Account.CreateByID(id); if (!a.CanPrint()) { MessageBox.Show("该单据尚未支付,无法打印!"); return; } // Create a report. //rptAccountPrint report = new rptAccountPrint(id); rptAccount report = new rptAccount(id); // Show the report's preview. ReportPrintTool tool = new ReportPrintTool(report); tool.ShowPreview(); }
//hiennv private void btnPrint_Click(object sender, EventArgs e) { try { List<Foods> aListFoods = new List<Foods>(); int count = viewFoods.RowCount; for (int i = 0; i < count; i++) { Foods aFoods = (Foods)viewFoods.GetRow(i); if (aFoods.Image1 != null) { if (aFoods.Image1.Length <= 0) { Image image = SaleManager.Properties.Resources.logo_nkcp_small; image = image.GetThumbnailImage(70,70, null, IntPtr.Zero); Byte[] aImageByte = this.ConvertImageToByteArray(image); aFoods.Image1 = aImageByte; } } else { Image image = SaleManager.Properties.Resources.logo_nkcp_small; image = image.GetThumbnailImage(70,70, null, IntPtr.Zero); Byte[] aImageByte = this.ConvertImageToByteArray(image); aFoods.Image1 = aImageByte; } aListFoods.Add(aFoods); } frmRpt_ListFoods afrmRpt_ListFoods = new frmRpt_ListFoods(aListFoods); ReportPrintTool tool = new ReportPrintTool(afrmRpt_ListFoods); tool.ShowPreview(); this.Close(); } catch (Exception ex) { MessageBox.Show("frmTsk_SearchFood.btnPrint_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void PrintButton_Click(object sender, EventArgs e) { var prnt = new ReportPrintTool(new Report() { DataSource = new BindingSource() { DataSource = GetData() } }); prnt.Report.CreateDocument(false); prnt.ShowPreview(); }
private void simpleButton1_Click(object sender, EventArgs e) { clsProductionSummary p = new clsProductionSummary(); rptDayend _report = new rptDayend(); Debug.WriteLine(p.GetDayendHeader(DateTime.Now).Count() + " Data Row Count"); _report.DataSource = p.GetDayendHeader(DateTime.Now); ReportPrintTool tool = new ReportPrintTool(_report); tool.ShowPreview(); // p.AddIndividualProductionSummary(DateTime.Now); // p.AddCuttingSummary(DateTime.Now); }
private void simpleButton2_Click(object sender, EventArgs e) { HourlyProduction _report = new HourlyProduction(); ReportPrintTool tool = new ReportPrintTool(_report); tool.ShowPreview(); }
public static void DoPrint(string retinvid) { var rpt = new PurchaseRpt {Company = Utils.Companyname, Header = "Purchase Return Invoice",DueDays = false,Docno = retinvid}; var ds = ClsGetData.RptPurchaseInv(retinvid); rpt.DataSource = ds; var printTool = new ReportPrintTool(rpt); printTool.ShowPreview(); }
private void button4_Click_1(object sender, EventArgs e) { var rpt = new ReportPrintTool(new RegistrationReport() { DataSource = new BindingSource() { DataSource = GetDay() } }); rpt.Report.CreateDocument(false); rpt.ShowPreview(); }
private void PrintDividingPlan(int ID) { try { rptDividingPlan report = new rptDividingPlan(); report.DataSource = GetDividingPlanByID(ID); ReportPrintTool tool = new ReportPrintTool(report); tool.ShowPreview(); } catch(Exception ex){ Debug.WriteLine(ex.Message); } }