Beispiel #1
0
        private XlsFile Export(DataSet data)
        {
            using (FlexCelReport Report = new FlexCelReport(true))
            {
                Report.AddTable(data);
                Report.SetUserFunction("Images", new ImagesImp());
                XlsFile Xls = new XlsFile(true);
                Xls.Open(Path.Combine(DataPath, "Features Page.template.xls"));

                Report.Run(Xls);
                return(Xls);
            }
        }
Beispiel #2
0
        public void AutoRun()
        {
            using (FlexCelReport ordersReport = SharedData.CreateReport())
            {
                ordersReport.SetValue("Date", DateTime.Now);
                ordersReport.SetUserFunction("Orders", new OrdersImp(SharedData.GetOrders()));

                string DataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ".."), "..") + Path.DirectorySeparatorChar;

                if (saveFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    ordersReport.Run(DataPath + "User Defined Functions.template.xls", saveFileDialog1.FileName);

                    if (MessageBox.Show("Do you want to open the generated file?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        Process.Start(saveFileDialog1.FileName);
                    }
                }
            }
        }