private void btnRun_Click(object sender, System.EventArgs e) { foreach (System.IO.FileInfo f in clbSrc.CheckedItems) { //------------------------------------------------------------------// System.IO.Stream stream = null; try { ReportBuilder builder = new ReportBuilder(); Report activeReport; builder.Build(f.FullName); activeReport = builder.Report; activeReport.Location = new Point((this.Width - activeReport.Width) / 2, 0); //***// stream = new System.IO.FileStream(fbd.SelectedPath + "\\" + f.Name + ".xml", System.IO.FileMode.Create); //ReportBuilder rb = new ReportBuilder(r); XmlSerializer xml = new XmlSerializer(/*rb*/ builder.GetType()); xml.Serialize(stream, /*rb*/ builder); stream.Close(); //------------------------------------------------------------------// clbDst.SetItemChecked(clbDst.FindStringExact(f.Name), true); } catch (Exception err) { if (stream != null) { if (stream.CanWrite) { stream.Close(); } } } } }
public virtual Report Load(string Rep, object Arg) { ReportBuilder b = new ReportBuilder(); b.Build(".\\Reports\\" + Rep + ".rep"); return(b.Report); }
private void prntPrintMenu_Click(object sender, System.EventArgs e) { pagenum = 0; if (activeReport != null) { if (printDialog1.ShowDialog(this) == DialogResult.OK) { printRep = ReportBuilder.ReloadRep(activeReport, true); printDocument1.Print(); } } }
public virtual void Save(Report r, object Arg) { System.IO.Stream stream = new System.IO.FileStream(".\\Reports\\" + Arg.ToString() + ".xml", //.rep System.IO.FileMode.Create); /*BinaryFormatter binary = new BinaryFormatter(); * binary.Serialize(stream, r);*/ ReportBuilder rb = new ReportBuilder(r); XmlSerializer xml = new XmlSerializer(rb.GetType()); xml.Serialize(stream, rb); stream.Close(); }
private void prntPrevMenu_Click(object sender, System.EventArgs e) { pagenum = 0; if (activeReport != null) { printRep = ReportBuilder.ReloadRep(activeReport, true); /** * this.Controls.Remove(activeReport); * activeReport = printRep; * this.Controls.Add(activeReport); **/ printPreviewDialog1.ShowDialog(this); } }
private void prntPrntMenu_Click(object sender, System.EventArgs e) { pagenum = 0; if (activeReport != null) { printRep = ReportBuilder.ReloadRep(activeReport, true); try { printDocument1.Print(); } catch { MessageBox.Show(this, "Printing error", e.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public Form1Test() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // newRepMenu.MenuItems.AddRange(MenuBuilder.LoadMenu(".//menu.ini")); foreach (MenuItem t in newRepMenu.MenuItems) { t.Click += new EventHandler(createReport_Click); } builder = new ReportBuilder(); activeReport = null; /*/ * activeReport = new Report(); * this.Controls.Add(activeReport); * new TextManager().Save(activeReport,activeReport.Tag); * /*/ }