Exemplo n.º 1
0
        protected void BuildReport(string file = null, Type reportType = null, bool checkEmptyData = false)
        {
            if (reportType != null && report == null)
            {
                report = (BaseReport)Activator.CreateInstance(reportType, Conn, properties);
            }
            report.ReportCaption = report.ReportCaption ?? "test report";

            if (file == null)
            {
                file = "test.xls";
            }
            _fileName = file;
            if (File.Exists(file))
            {
                File.Delete(file);
            }
            ProfileHelper.Start();
            report.CheckEmptyData = checkEmptyData;
            ArHelper.WithSession(s => {
                report.Session = s;
                report.Write(Path.GetFullPath(file));
            });
            ProfileHelper.Stop();
        }
Exemplo n.º 2
0
        public static void ProcessReport(BaseReport report, ReportsTypes type)
        {
            report.ReportCaption = report.ReportCaption ?? "Automate Created Report";
            ProfileHelper.Start();
            using (new SessionScope()) {
                ArHelper.WithSession(s => {
                    report.Session        = s;
                    report.CheckEmptyData = false;
                    report.Write(EnsureDeletion(type));
                });
            }

            ProfileHelper.Stop();
        }
Exemplo n.º 3
0
        protected void BuildReport(string file = null, Type reportType = null, bool checkEmptyData = false)
        {
            CreateReport(reportType);

            report.Session        = session;
            report.CheckEmptyData = checkEmptyData;
            file = file ?? _fileName ?? "test.xls";
            if (File.Exists(file))
            {
                File.Delete(file);
            }
            ProfileHelper.Start();
            report.Write(Path.GetFullPath(file));
            ProfileHelper.Stop();
        }