Esempio n. 1
0
        /// <summary>
        /// Criar/Alterar relatorio carregado para o cache
        /// </summary>
        /// <param name="reportImageAnt"></param>
        public RbbFrmReportEditorNew(ReportImage reportImageAnt)
            : this()
        {
            this.reportImageAnt = reportImageAnt;

            try
            {
                if (reportImageAnt.IdReport == 0)
                {
                    reportDesigner1.CreateNewReport();
                    reportDesigner1.ActiveDesignPanel.Report.DisplayName = reportImageAnt.ReportDescription;
                }
                else
                {
                    //abri o relatório selecionado
                    var path = new ReportDaoManager().LoadToCache(this.reportImageAnt);
                    reportDesigner1.OpenReport(path);
                    reportDesigner1.ActiveDesignPanel.Name        = this.reportImageAnt.ReportName;
                    reportDesigner1.ActiveDesignPanel.Report.Name = this.reportImageAnt.ReportName;
                }
                this.sqlDataSource = new SqlDataSource(ReportUtil.GetParamDataSource());
                reportDesigner1.ActiveDesignPanel.Report.DataSource = sqlDataSource;
            }
            catch (Exception ex)
            {
                LoggerUtilIts.GenerateLogs(ex);
            }
        }