예제 #1
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;
        }
예제 #2
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);
        }
예제 #3
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);
            }
        }