public void Yazdirr(string DosyaAdi, Nasil NasilAcsin) { try { Rapor = new XtraReport(); Rapor.LoadLayout(DosyaAdi); Rapor.DataSource = ds; switch (NasilAcsin) { case Nasil.dizayn: XRDesignFormEx XrDesigner = new XRDesignFormEx() { FileName = DosyaAdi }; XrDesigner.OpenReport(Rapor); XrDesigner.Show(); break; case Nasil.Goster: Rapor.ShowPreview(); break; case Nasil.Yazdir: Rapor.Print(); break; } } catch (Exception hata) { frmHataBildir frmHataBildir = new frmHataBildir(hata.Message, hata.StackTrace); frmHataBildir.ShowDialog(); } }
private void button1_Click(object sender, System.EventArgs e) { designForm = new XRDesignFormEx(); designForm.DesignPanel.DesignerHostLoaded += new DesignerLoadedEventHandler(OnDesignerLoaded); designForm.DesignPanel.ExecCommand(ReportCommand.NewReport); designForm.Show(); }
private void editPrint() { string path; DevExpress.XtraReports.UI.XtraReport rptTmp = null; if (Config.GetValue("DuongDanBaoCao") != null) { path = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("Package").ToString() + "\\" + "billPOS.repx"; } else { path = Application.StartupPath + "\\Reports\\" + Config.GetValue("Package").ToString() + "\\" + "billPOS.repx"; } if (System.IO.File.Exists(path)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(path, true); } else { rptTmp = new DevExpress.XtraReports.UI.XtraReport(); } if (rptTmp != null) { rptTmp.DataSource = _cban.tb; XRDesignFormEx designForm = new XRDesignFormEx(); designForm.OpenReport(rptTmp); if (System.IO.File.Exists(path)) { designForm.FileName = path; } designForm.KeyPreview = true; designForm.Show(); } }
private void mbtnDizayn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { XRDesignFormEx XrDesigner = new XRDesignFormEx(); XrDesigner.FileName = Application.StartupPath + "\\ReportDesigners\\Fatura\\rptFatura.repx"; XrDesigner.OpenReport(RaporStokGiris()); XrDesigner.Show(); }
private void EditReport(DataTable tb) { if (tb == null) { return; } DataTable dataPrint = tb; DevExpress.XtraReports.UI.XtraReport rptTmp = null; string path; if (Config.GetValue("DuongDanBaoCao") != null) { path = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("Package").ToString() + "\\" + fileReport + ".repx"; } else { path = Application.StartupPath + "\\Reports\\" + Config.GetValue("Package").ToString() + "\\" + fileReport + ".repx"; } string pathTmp; if (Config.GetValue("DuongDanBaoCao") != null) { pathTmp = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("Package").ToString() + "\\" + fileReport + ".repx"; } else { pathTmp = Application.StartupPath + "\\" + Config.GetValue("Package").ToString() + "\\Reports\\template.repx"; } if (System.IO.File.Exists(path)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(path, true); } else if (System.IO.File.Exists(pathTmp)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(pathTmp, true); } else { rptTmp = new DevExpress.XtraReports.UI.XtraReport(); } if (rptTmp != null) { rptTmp.DataSource = dataPrint; XRDesignFormEx designForm = new XRDesignFormEx(); designForm.OpenReport(rptTmp); if (System.IO.File.Exists(path)) { designForm.FileName = path; } designForm.KeyPreview = true; designForm.KeyDown += new KeyEventHandler(designForm_KeyDown); designForm.Show(); } }
private void simpleButton2_Click(object sender, EventArgs e) { XRDesignFormEx XrDesigner = new XRDesignFormEx(); XrDesigner.FileName = "50ye30 ruhuna fatiha.repx"; //XrDesigner.OpenReport(@"C:\AresRapor\StokEtiket\50ye30 ruhuna fatiha.repx"); XrDesigner.OpenReport(rpt); XrDesigner.Show(); }
private void simpleButtonSuaMau_Click(object sender, EventArgs e) { DataTable dtReport = _data.GetDataForPrint(_arrIndex[0]); if (dtReport == null) { return; } DevExpress.XtraReports.UI.XtraReport rptTmp = null; string path; if (Config.GetValue("DuongDanBaoCao") != null) { path = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("Package").ToString() + "\\" + _reportFile + ".repx"; } else { path = Application.StartupPath + "\\Reports\\" + Config.GetValue("Package").ToString() + "\\" + _reportFile + ".repx"; } string pathTmp; if (Config.GetValue("DuongDanBaoCao") != null) { pathTmp = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("Package").ToString() + "\\" + _reportFile + ".repx"; } else { pathTmp = Application.StartupPath + "\\" + Config.GetValue("Package").ToString() + "\\Reports\\template.repx"; } if (System.IO.File.Exists(path)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(path, true); } else if (System.IO.File.Exists(pathTmp)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(pathTmp, true); } else { rptTmp = new DevExpress.XtraReports.UI.XtraReport(); } if (rptTmp != null) { rptTmp.DataSource = dtReport; XRDesignFormEx designForm = new XRDesignFormEx(); designForm.OpenReport(rptTmp); if (System.IO.File.Exists(path)) { designForm.FileName = path; } designForm.KeyPreview = true; designForm.KeyDown += new KeyEventHandler(designForm_KeyDown); designForm.Show(); } }
private void button1_Click(object sender, System.EventArgs e) { // Create a new End-User Designer. XRDesignFormEx designForm = new XRDesignFormEx(); // Handle the event when the report is loaded into the End-User Designer. designForm.DesignPanel.DesignerHostLoaded += new DesignerLoadedEventHandler(OnDesignerLoaded); // Load the report into the designer. designForm.OpenReport(new XtraReport1()); // Show the End-User Designer window. designForm.Show(); }
private void button1_Click(object sender, EventArgs e) { // Create an End-User Designer form instance. XRDesignFormEx designForm = new XRDesignFormEx(); // Create a new blank report. designForm.DesignPanel.ExecCommand(ReportCommand.NewReport); // Hide the "New with Wizard..." item on the File menu and the "Design in Report Wizard..." // item in a report's smart tag. designForm.DesignPanel.SetCommandVisibility(ReportCommand.NewReportWizard, CommandVisibility.None); designForm.DesignPanel.SetCommandVisibility(ReportCommand.VerbReportWizard, CommandVisibility.None); // Show the End-User Designer. designForm.Show(); }
public void EditForm() { if (rptTmp != null) { rptTmp.DataSource = db; XRDesignFormEx designForm = new XRDesignFormEx(); designForm.OpenReport(rptTmp); if (System.IO.File.Exists(path)) { designForm.FileName = path; } designForm.KeyPreview = true; designForm.KeyDown += new KeyEventHandler(designForm_KeyDown); designForm.Show(); } }
private void simpleButton3_Click(object sender, EventArgs e) { DevExpress.XtraReports.UI.XtraReport rptTmp = null; string reportFile, title; reportFile = DuongDanInvoice + "\\HoaDonMau.repx"; if (System.IO.File.Exists(reportFile) && Data != null) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(reportFile, true); rptTmp.DataSource = Data.Tables[1].Clone(); XRDesignFormEx designForm = new XRDesignFormEx(); designForm.OpenReport(rptTmp); designForm.KeyPreview = true; //designForm.KeyDown += new KeyEventHandler(designForm_KeyDown); designForm.Show(); } }
private void ProcessReport(ReportAction action) { switch (action) { case ReportAction.Print: RaporStokGiris().PrintDialog(); break; case ReportAction.Preview: RaporStokGiris().ShowPreview(); break; case ReportAction.Dizayn: XRDesignFormEx XrDesigner = new XRDesignFormEx(); XrDesigner.FileName = Application.StartupPath + "\\ReportDesigners\\Irsaliye\\rptIrsaliye.repx"; XrDesigner.OpenReport(RaporStokGiris()); XrDesigner.Show(); break; } }
/// <summary> /// Bunda Dizeyn Yok,, Ara belleğe alınan Dosyayı Ywzdırır sürekli ayrnı formdan yazdırma işlemi yapılacaksa hızx açısından bu daha hızlı olur bunu kullan hamısına /// </summary> /// <param name="DosyaAdi"></param> /// <param name="NasilAcsin"></param> /// <param name="YaziciAdi"></param> public void Yazdirr(Nasil NasilAcsin, string YaziciAdi, int CopyaSayisi) { try { ArabellektekiRapor.CreateDocument(true); //NumberOfCopy = CopyaSayisi; // bunun hiç bir manası yok düzenlenmesi gerekiyor. //ArabellektekiRapor.DataSource = ds; using (pt = new ReportPrintTool(ArabellektekiRapor)) { //Rapor.PrintingSystem.ShowMarginsWarning = false; //pt.PrintingSystem.ShowMarginsWarning = false; //pt.PrintingSystem.StartPrint += PrintingSystem_StartPrint; pt.PrinterSettings.Copies = (Int16)CopyaSayisi; if (!string.IsNullOrEmpty(YaziciAdi)) { pt.PrinterSettings.PrinterName = YaziciAdi; try { pt.PrinterSettings.DefaultPageSettings.PaperSource = pt.PrinterSettings.PaperSources[KagitKaynagiIndex]; } catch (Exception) { } } switch (NasilAcsin) { case Nasil.dizayn: XRDesignFormEx XrDesigner = new XRDesignFormEx(); //XrDesigner.FileName = DosyaAdiE; XrDesigner.OpenReport(ArabellektekiRapor); XrDesigner.Show(); break; case Nasil.Goster: pt.ShowPreviewDialog(); break; case Nasil.Yazdir: if (YaziciAdi != string.Empty) { pt.PrinterSettings.PrinterName = YaziciAdi; } pt.Print(); break; case Nasil.YazdirmaDiyalogu: pt.PrintDialog(); break; } } } catch (Exception hata) { //frmHataBildir frmHataBildir = new frmHataBildir(hata.Message, hata.StackTrace); //frmHataBildir.ShowDialog(); } finally { } }
/// <summary> /// /// </summary> /// <param name="DosyaAdi"></param> /// <param name="NasilAcsin"></param> /// <param name="YaziciAdi">boş verilirse varsayılan yazıcıdan yazdırır</param> public void Yazdirr(string DosyaAdi, Nasil NasilAcsin, string YaziciAdi) { try { using (Rapor = new XtraReport()) { Rapor.LoadLayout(DosyaAdi); Rapor.DataSource = ds; using (ReportPrintTool pt = new ReportPrintTool(Rapor)) { //Rapor.PrintingSystem.ShowMarginsWarning = false; //pt.PrintingSystem.ShowMarginsWarning = false; //pt.PrintingSystem.StartPrint += PrintingSystem_StartPrint; pt.PrinterSettings.Copies = (Int16)NumberOfCopy; if (!string.IsNullOrEmpty(YaziciAdi)) { pt.PrinterSettings.PrinterName = YaziciAdi; try { pt.PrinterSettings.DefaultPageSettings.PaperSource = pt.PrinterSettings.PaperSources[KagitKaynagiIndex]; } catch (Exception) { } } switch (NasilAcsin) { case Nasil.dizayn: XRDesignFormEx XrDesigner = new XRDesignFormEx(); XrDesigner.FileName = DosyaAdi; XrDesigner.OpenReport(Rapor); XrDesigner.Show(); break; case Nasil.Goster: pt.ShowPreviewDialog(); break; case Nasil.Yazdir: if (YaziciAdi != string.Empty) { pt.PrinterSettings.PrinterName = YaziciAdi; } pt.Print(); break; case Nasil.YazdirmaDiyalogu: pt.PrintDialog(); break; } } } } catch (Exception hata) { //frmHataBildir frmHataBildir = new frmHataBildir(hata.Message, hata.StackTrace); //frmHataBildir.ShowDialog(); } }
private void simpleButtonSuaMau_Click(object sender, EventArgs e) { if (!bool.Parse(Config.GetValue("Admin").ToString())) { return; } int index = _arrIndex[0]; DataTable dtReport = new DataTable(); try { if (_Script == string.Empty) { dtReport = _data.GetDataForPrint(index); } else { dtReport = _data.GetDataForPrint(index, _Script); } } catch { } if (dtReport == null) { return; } dtReport = AddRecordToData(dtReport); DevExpress.XtraReports.UI.XtraReport rptTmp = null; string path = ""; if (Config.GetValue("DuongDanBaoCao") != null) { path = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("DbName").ToString() + "\\" + _reportFile + ".repx"; } else { path = Application.StartupPath + "\\Reports\\" + Config.GetValue("DbName").ToString() + "\\" + _reportFile + ".repx"; } if (drMau == null || (drMau != null && drMau["FileName"] == DBNull.Value)) { string pathTmp; if (Config.GetValue("DuongDanBaoCao") != null) { pathTmp = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("DbName").ToString() + "\\" + _reportFile + ".repx"; } else { pathTmp = Application.StartupPath + "\\" + Config.GetValue("DbName").ToString() + "\\Reports\\template.repx"; } if (System.IO.File.Exists(path)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(path, true); } else if (System.IO.File.Exists(pathTmp)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(pathTmp, true); } else { rptTmp = new DevExpress.XtraReports.UI.XtraReport(); } } else { System.IO.MemoryStream ms = new System.IO.MemoryStream(drMau["FileName"] as byte[]); rptTmp = XtraReport.FromStream(ms, true); } if (rptTmp != null) { rptTmp.DataSource = dtReport; if (drMau != null) { rptTmp.Tag = drMau; } XRDesignFormEx designForm = new XRDesignFormEx(); designForm.OpenReport(rptTmp); designForm.Tag = drMau; if (System.IO.File.Exists(path)) { designForm.FileName = path; } designForm.KeyPreview = true; designForm.KeyDown += new KeyEventHandler(designForm_KeyDown); designForm.FormClosed += designForm_FormClosed; designForm.Show(); } }
private void simpleButtonDesignReport_Click(object sender, EventArgs e) { DevExpress.XtraReports.UI.XtraReport rptTmp = null; string reportFile; if (lcisysFormReport.Visibility == DevExpress.XtraLayout.Utils.LayoutVisibility.Always) { DataTable dtFormReport = lookUpEditsysFormReport.Properties.DataSource as DataTable; DataRow dr = dtFormReport.Rows[lookUpEditsysFormReport.ItemIndex]; reportFile = checkEditNgoaiTe.Checked ? dr["ReportFile2"].ToString() : dr["ReportFile"].ToString(); } else { reportFile = checkEditNgoaiTe.Checked ? _data.DrTable["ReportFile2"].ToString() : _data.DrTable["ReportFile"].ToString(); } string path = ""; if (Config.GetValue("DuongDanBaoCao") != null) { path = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("Package").ToString() + "\\" + reportFile + ".repx"; } else { path = Application.StartupPath + "\\Reports\\" + Config.GetValue("Package").ToString() + "\\" + reportFile + ".repx"; } string pathTmp = ""; if (Config.GetValue("DuongDanBaoCao") != null) { pathTmp = Config.GetValue("DuongDanBaoCao").ToString() + "\\" + Config.GetValue("Package").ToString() + "\\" + reportFile + ".repx"; } else { pathTmp = Application.StartupPath + "\\Reports\\" + Config.GetValue("Package").ToString() + "\\" + reportFile + "\\template.repx"; } //string pathTmp = Application.StartupPath + "\\Reports\\" + Config.GetValue("Package").ToString() + "\\template.repx"; if (System.IO.File.Exists(path)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(path, true); } else if (System.IO.File.Exists(pathTmp)) { rptTmp = DevExpress.XtraReports.UI.XtraReport.FromFile(pathTmp, true); } else { rptTmp = new DevExpress.XtraReports.UI.XtraReport(); } if (rptTmp != null) { rptTmp.DataSource = gridViewReport.DataSource; if (Config.GetValue("Language").ToString() == "1") { Translate(rptTmp); } XRDesignFormEx designForm = new XRDesignFormEx(); designForm.OpenReport(rptTmp); if (System.IO.File.Exists(path)) { designForm.FileName = path; } designForm.KeyPreview = true; designForm.KeyDown += new KeyEventHandler(designForm_KeyDown); designForm.Show(); } }