예제 #1
0
 static FixedDocument CreateFixedDocument(IReportSettings reportSettings)
 {
     var document = new FixedDocument();
     document.DocumentPaginator.PageSize = new System.Windows.Size(reportSettings.PageSize.Width,
                                                                   reportSettings.PageSize.Height);
     return document;
 }
 public static void  AddReportSettings(this ReportingExpressionEvaluator app, IReportSettings reportSettings)
 {
     if (reportSettings == null)
     {
         throw new ArgumentNullException("reportSettings");
     }
     app.Globals.Add("ReportSettings", reportSettings);
 }
예제 #3
0
        /// <summary>
        /// Searches through the known reports to find one with a matching name
        /// </summary>
        /// <param name="exportTo"></param>
        /// <param name="reportName"></param>
        /// <param name="reportSettings"></param>
        /// <param name="exporter"></param>
        public void ExportReport(Stream exportTo, string reportName, IReportSettings reportSettings, IExporter exporter)
        {
            var report = Reports[reportName];

            var data = report.GenerateReport(reportSettings);

            exporter.WriteData(exportTo, data, reportSettings.Columns);
        }
        static FixedDocument CreateFixedDocument(IReportSettings reportSettings)
        {
            var document = new FixedDocument();

            document.DocumentPaginator.PageSize = new System.Windows.Size(reportSettings.PageSize.Width,
                                                                          reportSettings.PageSize.Height);
            return(document);
        }
예제 #5
0
 private static void CheckSettings(IReportSettings settings)
 {
     if (settings.IsValid())
     {
         return;
     }
     Console.Error.WriteLine(settings.ValidationFailures);
     Environment.Exit(1);
 }
        public CollectionDataSource(IEnumerable list, IReportSettings reportSettings)
        {
            if (list == null)
                throw new ArgumentNullException("list");
            if (reportSettings == null)
                throw new ArgumentNullException("reportSettings");
            baseList = CreateBaseList(list);
            CurrentList = baseList;

            this.reportSettings = reportSettings;
            this.listProperties = this.baseList.GetItemProperties(null);
            OrderGroup = OrderGroup.AsIs;
        }
예제 #7
0
        public PreviewViewModel(IReportSettings reportSettings, Collection<ExportPage> pages)
        {
            if (pages == null)
                throw new ArgumentNullException("pages");
            if (reportSettings == null)
                throw new ArgumentNullException("reportSettings");

            Document = CreateFixedDocument(reportSettings);

            var wpfExporter = new WpfExporter(pages);
            wpfExporter.Run();
            this.Document = wpfExporter.Document;
        }
예제 #8
0
        public static void Save(this IReportSettings reportSettings, string reportOutputPath)
        {
            var folder     = Path.Combine(reportOutputPath, Paths.Folders.Src);
            var serializer = new JsonSerializer();

            Paths.Create(folder);
            var fullPath = Path.Combine(folder, Paths.Files.ReportSettings);

            if (!File.Exists(fullPath))
            {
                using (var file = File.CreateText(fullPath))
                {
                    serializer.Serialize(file, reportSettings);
                }
            }
        }
예제 #9
0
        public CollectionDataSource(IEnumerable list, IReportSettings reportSettings)
        {
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }
            if (reportSettings == null)
            {
                throw new ArgumentNullException("reportSettings");
            }
            baseList    = CreateBaseList(list);
            CurrentList = baseList;

            this.reportSettings = reportSettings;
            this.listProperties = this.baseList.GetItemProperties(null);
            OrderGroup          = OrderGroup.AsIs;
        }
        public PreviewViewModel(IReportSettings reportSettings, Collection <ExportPage> pages)
        {
            if (pages == null)
            {
                throw new ArgumentNullException("pages");
            }
            if (reportSettings == null)
            {
                throw new ArgumentNullException("reportSettings");
            }

            Document = CreateFixedDocument(reportSettings);

            var wpfExporter = new WpfExporter(pages);

            wpfExporter.Run();
            this.Document = wpfExporter.Document;
        }
 protected void SetupExpressionRunner(IReportSettings reportsettings, CollectionDataSource dataSource)
 {
     ExpressionRunner = new ExpressionRunner(Pages, reportsettings, dataSource);
 }
예제 #12
0
 public ExpressionRunner(Collection <ExportPage> pages, IReportSettings reportSettings, CollectionDataSource dataSource)
 {
     this.pages      = pages;
     this.dataSource = dataSource;
     Visitor         = new ExpressionVisitor(reportSettings);
 }
예제 #13
0
 IEnumerable IReport.GenerateReport(IReportSettings settings)
 {
     return(GenerateReport((GenericReportSettings <TRecord>)settings));
 }
예제 #14
0
 public static int PrintableWidth(this IReportSettings reportSettings)
 {
     return(reportSettings.PageSize.Width - reportSettings.LeftMargin - reportSettings.RightMargin);
 }
예제 #15
0
        public void ExportReport(Stream exportTo, IReport report, IReportSettings reportSettings, IExporter exporter)
        {
            var data = report.GenerateReport(reportSettings);

            exporter.WriteData(exportTo, data, reportSettings.Columns);
        }
예제 #16
0
 public ExpressionRunner(Collection<ExportPage> pages,IReportSettings reportSettings,CollectionDataSource dataSource)
 {
     this.pages = pages;
     this.dataSource = dataSource;
     Visitor = new ExpressionVisitor(reportSettings);
 }
예제 #17
0
 public ExpressionVisitor(IReportSettings reportSettings)
 {
     grammar   = new ReportingLanguageGrammer();
     evaluator = new ReportingExpressionEvaluator(grammar);
     evaluator.AddReportSettings(reportSettings);
 }
예제 #18
0
 public static void AddReportSettings(this ReportingExpressionEvaluator app,IReportSettings reportSettings)
 {
     if (reportSettings == null)
         throw new ArgumentNullException("reportSettings");
     app.Globals.Add("ReportSettings",reportSettings);
 }
예제 #19
0
 public ExpressionVisitor(IReportSettings reportSettings)
 {
     grammar = new ReportingLanguageGrammer();
     evaluator = new ReportingExpressionEvaluator(grammar);
     evaluator.AddReportSettings(reportSettings);
 }