Пример #1
0
        public string ExportToFile(Report report)
        {
            ExportBase export   = null;
            string     fileName = Path.GetTempPath() + @"\_rpt" + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + Loginer.CurrentUser.Account;

            if (ExportType.IMG == _exportType)
            {
                fileName = fileName + ".png";
                export   = new ImageExport();
                (export as ImageExport).ImageFormat = ImageExportFormat.Png;
            }
            else if (ExportType.PDF == _exportType)
            {
                fileName = fileName + ".pdf";
                export   = new PDFExport();
            }
            else if (ExportType.XLS == _exportType)
            {
                fileName = fileName + ".xls";
                export   = new XMLExport();
            }
            else if (ExportType.HTML == _exportType)
            {
                fileName = fileName + ".html";
                export   = new HTMLExport();
            }

            export.AllowOpenAfter = false;
            report.Export(export, fileName);

            return(fileName);
        }
Пример #2
0
        protected override void export( )
        {
            base.export( );

            strPrintWhere = "1=1";
            file          = "";
            file          = Application.StartupPath + "\\R_050.frx";
            report.Load(file);
            if (tabControl1.SelectedTab.Name == "tabPageOne")
            {
                strPrintWhere = "1=1";
            }
            else if (tabControl1.SelectedTab.Name == "tabPageTwo")
            {
                strPrintWhere = strPrintWhere + " AND XZ014='行政' AND XZ028='1'";
            }
            else if (tabControl1.SelectedTab.Name == "tabPageTre")
            {
                strPrintWhere = strPrintWhere + " AND XZ014='生产部' AND XZ028='1'";
            }
            else if (tabControl1.SelectedTab.Name == "tabPageSix")
            {
                strPrintWhere = strPrintWhere + " AND XZ028='2'";
            }
            CreatePrint(strPrintWhere);
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);
        }
Пример #3
0
        protected override void Done()
        {
            base.Done();
            XMLExport xmlExport = Export as XMLExport;

            xmlExport.Wysiwyg    = cbWysiwyg.Checked;
            xmlExport.PageBreaks = cbPageBreaks.Checked;
            xmlExport.DataOnly   = cbDataOnly.Checked;
        }
Пример #4
0
        public override void Init(ExportBase export)
        {
            base.Init(export);
            XMLExport xmlExport = Export as XMLExport;

            cbWysiwyg.Checked    = xmlExport.Wysiwyg;
            cbPageBreaks.Checked = xmlExport.PageBreaks;
            cbDataOnly.Checked   = xmlExport.DataOnly;
        }
Пример #5
0
        protected override void export( )
        {
            report.Load(Application.StartupPath + "\\R_436.frx");

            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);

            base.export( );
        }
Пример #6
0
        public void Run()
        {
            Dot       d1 = new Dot(0, 0);
            Dot       d2 = new Dot(1, 2);
            Rectangle r  = new Rectangle(1, 5);

            XMLExport xe = new XMLExport();

            d1.Accept(xe);
            d2.Accept(xe);
            r.Accept(xe);
        }
Пример #7
0
        //Export
        private void button7_Click(object sender, EventArgs e)
        {
            file = "";
            file = Application.StartupPath + "";
            report.Load(file + "\\jiugong.frx");
            CreatePrint( );
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);
        }
Пример #8
0
        protected override void export( )
        {
            base.export( );

            file = "";
            file = Environment.CurrentDirectory;
            report.Load(file + "\\R_365.frx");
            CreatePrint( );
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);
        }
Пример #9
0
        protected override void export( )
        {
            base.export( );

            createDataSet( );
            file = "";
            file = System.Windows.Forms.Application.StartupPath;
            report.Load(file + "\\R_344.frx");
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);
        }
Пример #10
0
        protected override void export( )
        {
            base.export( );

            files = Application.StartupPath + "\\R_351.frx";
            createPrint( );
            report.Load(files);
            report.RegisterData(RData);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);

            //ViewExport . ExportToExcel ( this . Text ,gridControl1 );
        }
Пример #11
0
        /// <summary>
        /// 导出
        /// </summary>
        /// <param name="oddNum"></param>
        /// <param name="table"></param>
        protected void Export(DataTable[] table, string nameOfPrint)
        {
            FastReport.Report report = new FastReport.Report();
            DataSet           ds     = new DataSet();

            foreach (DataTable dt in table)
            {
                ds.Tables.Add(dt.Copy());
            }
            report.Load(Application.StartupPath + nameOfPrint);
            report.RegisterData(ds.Copy());
            report.Prepare();
            XMLExport exprots = new XMLExport();

            exprots.Export(report);
        }
Пример #12
0
        //Export
        protected override void export( )
        {
            base.export( );
            CreateDataset( );
            file = "";
            file = System.Windows.Forms.Application.StartupPath;
            report.Load(file + "\\XSDD.frx");
            report.SetParameterValue("Day", MulaolaoBll.Drity.GetDt( ).ToString("yyyy年MM月dd日"));

            report.RegisterData(XDataSet);
            report.Prepare( );
            XMLExport exports = new XMLExport( );

            exports.Export(report);
            //report.Dispose( );
        }
Пример #13
0
        //Auto fills file name if not entered, creates & exports XML using XML Export class in the Data Access layer
        private void exportXMLBtn_Click(object sender, EventArgs e)
        {
            if (textBoxFileName.Text == "")
            {
                textBoxFileName.Text = "Student.xml";
            }
            XMLExport exportXML = new XMLExport();

            exportXML.StudentXML(textBoxFileName.Text.Trim(), textBoxStudentId.Text.Trim(),
                                 textBoxFName.Text.Trim(), textBoxSName.Text.Trim(),
                                 textBoxAddressL1.Text.Trim(), textBoxAddressL2.Text.Trim(),
                                 textBoxCity.Text.Trim(), textBoxCounty.Text.Trim(), textBoxPhone.Text.Trim(),
                                 textBoxEmail.Text.Trim(), textBoxLevel.Text.Trim(), textBoxCourse.Text.Trim());

            MessageBox.Show("Exported Successfully!");
        }
Пример #14
0
        //Export
        private void button2_Click(object sender, EventArgs e)
        {
            if (tableQuery == null)
            {
                return;
            }
            CreatePrint( );
            file = "";
            file = System.Windows.Forms.Application.StartupPath;
            report.Load(file + "\\月成品率报表.frx");
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);
        }
Пример #15
0
        private void AddTimetableListener(IPluginInterface pluginInterface)
        {
            lastTimetableNode = new XMLEntity("dummy");

            // Log Timetable changes
            pluginInterface.FileStateChanged += (s, e) =>
            {
                try
                {
                    if (pluginInterface.Timetable == null || lastTimetableNode.XDiff(pluginInterface.Timetable.XMLEntity))
                    {
                        return;
                    }

                    var clone = pluginInterface.Timetable.Clone();

                    var x = new XMLEntity("dump-info");
                    x.SetAttribute("session", session);
                    x.SetAttribute("date", DateTime.Now.ToShortDateString());
                    x.SetAttribute("time", DateTime.Now.ToShortTimeString());
                    x.SetAttribute("pf", Environment.OSVersion.Platform.ToString());

                    clone.Children.Add(x);

                    using (var ms = new MemoryStream())
                    {
                        var exp = new XMLExport();
                        exp.Export(clone, ms, pluginInterface, new[] { XMLExport.FLAG_INDENT_XML });
                        ms.Seek(0, SeekOrigin.Begin);
                        using (var tr = new StreamReader(ms))
                        {
                            var text = tr.ReadToEnd();
                            writer.WriteEvent(DumpEventType.TimetableChange, text);
                        }
                    }

                    var clone2 = pluginInterface.Timetable.Clone();
                    lastTimetableNode = clone2.XMLEntity;
                }
                catch (Exception ex)
                {
                    pluginInterface.Logger.LogException(ex);
                }
            };
        }
Пример #16
0
        protected override void export( )
        {
            getPrintTable( );

            Report  report   = new Report( );
            DataSet RDataSet = new DataSet( );

            RDataSet.Tables.Add(printOne);
            RDataSet.Tables.Add(printTwo);
            report.Load(Application.StartupPath + "\\R_044.frx");
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);

            base.export( );
        }
Пример #17
0
        protected override void export( )
        {
            printOne           = _bll.printOne(model.DK001);
            printOne.TableName = "R_PQDK";

            Report  report   = new Report( );
            DataSet RDataSet = new DataSet( );

            RDataSet.Tables.Add(printOne);
            report.Load(Application.StartupPath + "\\R_293.frx");
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);

            base.export( );
        }
Пример #18
0
        private void btEditXML_Click(object sender, EventArgs e)
        {
            short level = 2;

            if (rbEditPostGrad.Checked)
            {
                level = 1;
            }
            else if (rbEditUnderGrad.Checked)
            {
                level = 0;
            }
            XMLExport xe = new XMLExport(tbEditStuID.Text, tbEditFName.Text, tbEditLName.Text, tbEditEmail.Text,
                                         tbEditPhone.Text, tbEditA1.Text, tbEditA2.Text, tbEditCity.Text,
                                         cbEditCounty.Text, level, cbEditCourse.Text);

            MessageBox.Show("Data Exported");
        }
Пример #19
0
        protected override void export( )
        {
            printOne           = _bll.getPrintOne(_cr.CR001);
            printOne.TableName = "R_PQCR";
            printTwo           = _bll.getPrintTwo(_cr.CR001);
            printTwo.TableName = "R_PQCS";

            Report  report   = new Report( );
            DataSet RDataSet = new DataSet( );

            RDataSet.Tables.Add(printOne);
            RDataSet.Tables.Add(printTwo);
            report.Load(Application.StartupPath + "\\R_418.frx");
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);

            base.export( );
        }
Пример #20
0
        protected override void export( )
        {
            base.export( );

            if (string.IsNullOrEmpty(textBox4.Text))
            {
                MessageBox.Show("请选择结算月份");
                return;
            }
            strWhere = "1=1";
            strWhere = strWhere + " AND GZ44='" + dateTimePicker1.Value.ToString("yyyy") + "' AND GZ28='" + dateTimePicker1.Value.ToString("MM") + "'";

            printTable( );
            file = "";
            file = System.Windows.Forms.Application.StartupPath;
            report.Load(file + "\\R_225.frx");
            report.RegisterData(RDataSet);
            report.Prepare( );
            XMLExport exprots = new XMLExport( );

            exprots.Export(report);
        }
Пример #21
0
        /// <summary>
        /// 导出Execl
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="printFile"></param>
        protected void Export(DataTable [] dt, string printFile)
        {
            DataSet ds = new DataSet( );

            if (dt.Length > 0)
            {
                for (int i = 0; i < dt.Length; i++)
                {
                    ds.Tables.Add(dt [i]);
                }
            }

            if (ds != null && ds.Tables.Count > 0)
            {
                string file   = Application.StartupPath + "\\" + printFile + "";
                Report report = new Report( );
                report.Load(file);
                report.RegisterData(ds);
                report.Prepare( );
                XMLExport exprots = new XMLExport( );
                exprots.Export(report);
            }
        }
Пример #22
0
 private void SendDataToGyvrEngine()
 {
     m_xmlExporter = GetComponent <XMLExport>();
     m_xmlExporter.SceneToXML();
 }
Пример #23
0
        public void Init(IInfo info)
        {
            XMLEntity last = new XMLEntity("dummy");

            this.info = info;

            session  = Guid.NewGuid().ToString();
            basePath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "ttDumps", session);
            dir      = new DirectoryInfo(basePath);

            if (!dir.Exists)
            {
                dir.Create();
            }

            // Log UI interaction
            FFormHandler.Init += (se, a) =>
            {
                var w = (Window)se;
                var n = w.GetType().FullName;
                w.Shown  += (s, e) => info.Logger.Debug("Form shown: " + n);
                w.Closed += (s, e) => info.Logger.Debug("Form closed: " + n);
            };

            var     logPath = Path.Combine(basePath, "session.log");
            dynamic l       = info.Logger;

            l.Loggers.Add(new FileLogger(logPath));

            // Log Timetable changes
            info.FileStateChanged += (s, e) =>
            {
                try
                {
                    if (info.Timetable == null || XDiff(last, info.Timetable.XMLEntity))
                    {
                        return;
                    }

                    var clone = info.Timetable.Clone();
                    var exp   = new XMLExport();

                    var fn = Path.Combine(basePath, $"fpldump-{sessionCounter++}.fpl");

                    var x = new XMLEntity("dump-info");
                    x.SetAttribute("session", session);
                    x.SetAttribute("date", DateTime.Now.ToShortDateString());
                    x.SetAttribute("time", DateTime.Now.ToShortTimeString());
                    x.SetAttribute("pf", Environment.OSVersion.Platform.ToString());

                    clone.Children.Add(x);
                    exp.Export(clone, fn, info);
                    info.Logger.Debug("Dump erstellt: " + fn);

                    var clone2 = info.Timetable.Clone();
                    last = clone2.XMLEntity;
                }
                catch { }
            };

            info.ExtensionsLoaded += (s, e) =>
            {
                info.Logger.Info("DebugDump aktiviert. Session: " + session);
                info.Logger.Debug("Enabled extensions: " + info.Settings.Get("extmgr.enabled", ""));
            };

            var tmpDir  = info.GetTemp("");
            var watcher = new FileSystemWatcher(tmpDir, "*.*")
            {
                NotifyFilter = NotifyFilters.LastWrite
            };

            watcher.Changed            += WatcherEvent;
            watcher.Created            += WatcherEvent;
            watcher.EnableRaisingEvents = true;
        }