Exemple #1
0
        public void Execute()
        {
            string strUrl = String.Empty;
            string strPath = GetOutputPath(this.Format.ExportFormat);

            strUrl = GetOutputUrl(this.Format.ExportFormat);

            this.FilePath = strPath;

            IReportExport exporter = null;
            if (this.Format.ExportFormat == ReportFormat.ExportType.Excel)
            {
                exporter = new ExcelReportExporter(this, ExportMode.Export, false);
                exporter.FileName = this.FilePath;
            }
            else
            {
                exporter = new PdfReportExporter(this, ExportMode.Export, false);
            }

            exporter.Export();

            AspNetScriptsProvider.DownLoadFile(this);
        }
Exemple #2
0
        private void btExport_Click(object sender, EventArgs e)
        {
            IReportExport reportExport = null;
            ExecutionResult execResult = new ExecutionResult();

            this.SaveReportConfig();

            if (this.TempReport.Format.ExportFormat == ReportFormat.ExportType.Excel)
            {
                reportExport = new ExcelReportExporter(this.TempReport, ExportMode.Export, false);
            }
            else
            {
                reportExport = new PdfReportExporter(this.TempReport, ExportMode.Export, false);
            }

            execResult = reportExport.CheckValidate();

            if (execResult.Status)
            {
                fmProgress fp = new fmProgress("Easily Report (" + this.TempReport.Format.ExportFormat.ToString() + " Format)", reportExport, this.TempReport);
                fp.Visible = false;
                fp.ShowDialog();
            }
            else
            {
                MessageBox.Show(execResult.Message, TitleMsgInfo.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #3
0
        private void btPreview_Click(object sender, EventArgs e)
        {
            IReportExport excelReport = null;
            ExecutionResult execResult;
            execResult = new ExecutionResult();

            this.Cursor = Cursors.WaitCursor;

            this.SaveReportConfig();

            if (this.TempReport.Format.ExportFormat == ReportFormat.ExportType.Excel)
            {
                excelReport = new ExcelReportExporter(this.TempReport, ExportMode.Preview, false);
            }
            else
            {
                excelReport = new PdfReportExporter(this.TempReport, ExportMode.Preview, false);
            }

            execResult = excelReport.CheckValidate();

            if (execResult.Status)
            {
                excelReport.View();
            }
            else
            {
                MessageBox.Show(execResult.Message, "Preview Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            this.Cursor = Cursors.Default;
        }
Exemple #4
0
        void buttonExport_Click(object sender, EventArgs e)
        {
            Save();
            //ActiveView(OutputView.ProgressView);

            string strUrl = String.Empty;
            string strPath = this.report.GetOutputPath(this.report.Format.ExportFormat);

            strUrl = report.GetOutputUrl(this.report.Format.ExportFormat);

            this.report.FilePath = strPath;

            IReportExport exporter = null;
            if (this.report.Format.ExportFormat == ReportFormat.ExportType.Excel)
            {
                exporter = new ExcelReportExporter(this.report, ExportMode.Export, false);
                exporter.FileName = this.report.FilePath;
            }
            else
            {
                exporter = new PdfReportExporter(this.report, ExportMode.Export, false);
            }

            exporter.Export();

            Control container = this.report.MultiView;
            CheckBox cbxSendMail = (CheckBox)container.FindControl(CHECKBOX_SEND_MAIL);
            if (cbxSendMail.Checked)
            {
                ShowModelPopup(ModelPopupView.DownloadView);
                ActiveView(OutputView.SendMailView);
                InitialSendMailView(this.report);

                MemoryStream ms = new MemoryStream(File.ReadAllBytes(this.report.FilePath));
                this.report.MailSetting.Attachments.Add(new Attachment(ms, Path.GetFileName(this.report.FilePath)));
            }
            else
            {
                AspNetScriptsProvider.DownLoadFile(this.report);
            }
        }