Example #1
0
        public void AssignFrom(ReportManifest manifest)
        {
            //Filters = new List<Filter>();
            Columns            = Columns ?? new List <ReportColumn>();
            WebsitePages       = WebsitePages ?? new List <ReportWebsitePage>();
            ComparisonKeyIcons = ComparisonKeyIcons ?? new List <ComparisonKeyIconSet>();
            _rptfilters        = _rptfilters ?? new List <RptFilter>();
            Audiences          = Audiences ?? new List <Audience>();

            Columns.Clear();
            WebsitePages.Clear();
            ComparisonKeyIcons.Clear();
            _rptfilters.Clear();
            Audiences.Clear();

            ComparisonKeyIcons.AddRange(manifest.ToComparisonKeyIconSet(manifest.IconSets, this).ToList());
            Audiences.AddRange(manifest.Audiences.Select(a => a.AudienceType).ToList());
            Category   = manifest.Category;
            IsTrending = manifest.IsTrending;
            Datasets   = manifest.Datasets.Select(d => d.Name).ToList();
            manifest.Columns.ForEach(col => new ReportColumn(this, col.Name)
            {
                IsMeasure = col.IsMeasure, MeasureCode = col.MeasureCode, IsIncluded = true
            });
            manifest.WebsitePages.ForEach(wp => new ReportWebsitePage(this, wp));

            Name                      = manifest.Name;
            ReportAttributes          = manifest.ReportAttributes;
            SourceTemplate            = manifest;
            Description               = !string.IsNullOrWhiteSpace(manifest.Description) ? manifest.Description.TrimStart().TrimEnd() : null;
            Filter                    = CandidateFilters.ToReportFilter();
            RequiresCmsProviderId     = manifest.RequiresCmsProviderId;
            RequiresCostToChargeRatio = manifest.RequiresCostToChargeRatio;
            ReportType                = manifest.Name;
            ShowInterpretationText    = manifest.ShowInterpretationText;
            InterpretationText        = !string.IsNullOrWhiteSpace(manifest.InterpretationText) ? manifest.InterpretationText.TrimStart().TrimEnd() : null;
            Footnote                  = !string.IsNullOrWhiteSpace(manifest.Footer) ? manifest.Footer.TrimStart().TrimEnd() : null;
            ReportOutputSql           = !string.IsNullOrWhiteSpace(manifest.ReportOutputSql) ? manifest.ReportOutputSql.TrimStart().TrimEnd() : null;
            OutputFileName            = !string.IsNullOrWhiteSpace(manifest.OutputFileName) ? manifest.OutputFileName.TrimStart().TrimEnd() : null;
            OutputJsNamespace         = !string.IsNullOrWhiteSpace(manifest.OutputJsNamespace) ? manifest.OutputJsNamespace.TrimStart().TrimEnd() : null;

            _rptfilters.AddRange(RptFilter.FromFilterList(manifest.Filters, this).ToList());

            LastReportManifestUpdate = manifest.FileLastModifiedDate;
        }