Пример #1
0
 private void createReport_Click(object sender, System.EventArgs e)
 {
     builder.Build((string)((MenuItemTagged)sender).Tag);
     if (activeReport != null)
     {
         this.Controls.Remove(activeReport);
     }
     activeReport          = builder.Report;
     activeReport.Location = new Point((this.Width - activeReport.Width) / 2, 0);
     this.Controls.Add(activeReport);
 }
Пример #2
0
 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();
                 }
             }
         }
     }
 }
Пример #3
0
        public virtual Report Load(string Rep, object Arg)
        {
            ReportBuilder b = new ReportBuilder();

            b.Build(".\\Reports\\" + Rep + ".rep");
            return(b.Report);
        }