Exemplo n.º 1
0
        public Report Export(Workspace workspace, string resultPath, UserRequestData userRequestData, ExportCounterSettings counterSettings = null)
        {
            _exportImageCounter = 0;
            _currentWorkspace = workspace;
            _counterSettings = counterSettings;
            _userRequestData = userRequestData;
            _resultPath = resultPath;

            string result = string.Empty;

            result += CreateHeader();

            if (Template.IncludeToc)
            {
                result += CreateTocHeader();
                result += CreateToc();
                result += CreateTocFooter();
            }

            result += CreateContent();

            result += CreateFooter();

            result = ExportTemplateImages(result);

            var report = CreateReport(result, resultPath);

            return report;
        }
Exemplo n.º 2
0
 public static bool IsEqual(Article first, Article second, ExportCounterSettings settings)
 {
     return true;
 }
Exemplo n.º 3
0
        public static IList<Tuple<string, int, int, bool>> GetCountArticleTable(IList<Article> articles, ExportCounterSettings settings)
        {
            var grouped = articles.GroupBy(x => new {
                Author = (settings.Author ? x.Author : SpecialKeyValue),
                Category = (settings.Category ? x.Category : SpecialKeyValue),
                SubjectCategory = (settings.SubjectCategory ? x.SubjectCategory : SpecialKeyValue),
                PublicDate = (settings.PublicationDate ? x.PublicDate : SpecialKeyValue),
                Source = (settings.Source ? x.Source : SpecialKeyValue),
                Title = (settings.Title ? x.Title : SpecialKeyValue)
            });

            var result = new List<Tuple<string, int, int, bool>>();

            foreach (var item in grouped)
            {
                if (item.Key.Author != SpecialKeyValue)
                {
                    ProcessGroupItem(result, item.Key.Author, item, item.Count(),
                        item.Key.Category == SpecialKeyValue &&
                        item.Key.SubjectCategory == SpecialKeyValue &&
                        item.Key.PublicDate == SpecialKeyValue &&
                        item.Key.Source == SpecialKeyValue &&
                        item.Key.Title == SpecialKeyValue
                        );
                }
                if (item.Key.Category != SpecialKeyValue)
                {
                    ProcessGroupItem(result, item.Key.Category, item, item.Count(),
                        item.Key.SubjectCategory == SpecialKeyValue &&
                        item.Key.PublicDate == SpecialKeyValue &&
                        item.Key.Source == SpecialKeyValue &&
                        item.Key.Title == SpecialKeyValue);
                }
                if (item.Key.SubjectCategory != SpecialKeyValue)
                {
                    ProcessGroupItem(result, item.Key.SubjectCategory, item, item.Count(),
                        item.Key.PublicDate == SpecialKeyValue &&
                        item.Key.Source == SpecialKeyValue &&
                        item.Key.Title == SpecialKeyValue
                        );
                }
                if (item.Key.PublicDate != SpecialKeyValue)
                {
                    ProcessGroupItem(result, item.Key.PublicDate, item, item.Count(),
                        item.Key.Source == SpecialKeyValue &&
                        item.Key.Title == SpecialKeyValue
                        );
                }
                if (item.Key.Source != SpecialKeyValue)
                {
                    ProcessGroupItem(result, item.Key.Source, item, item.Count(), item.Key.Title == SpecialKeyValue);
                }
                if (item.Key.Title != SpecialKeyValue)
                {
                    ProcessGroupItem(result, item.Key.Title, item, item.Count(), true);
                }

            }

            return result;
        }