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); }
/// <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); }
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; }
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; }
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); } } }
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); }
public ExpressionRunner(Collection <ExportPage> pages, IReportSettings reportSettings, CollectionDataSource dataSource) { this.pages = pages; this.dataSource = dataSource; Visitor = new ExpressionVisitor(reportSettings); }
IEnumerable IReport.GenerateReport(IReportSettings settings) { return(GenerateReport((GenericReportSettings <TRecord>)settings)); }
public static int PrintableWidth(this IReportSettings reportSettings) { return(reportSettings.PageSize.Width - reportSettings.LeftMargin - reportSettings.RightMargin); }
public void ExportReport(Stream exportTo, IReport report, IReportSettings reportSettings, IExporter exporter) { var data = report.GenerateReport(reportSettings); exporter.WriteData(exportTo, data, reportSettings.Columns); }
public ExpressionRunner(Collection<ExportPage> pages,IReportSettings reportSettings,CollectionDataSource dataSource) { this.pages = pages; this.dataSource = dataSource; Visitor = new ExpressionVisitor(reportSettings); }
public ExpressionVisitor(IReportSettings reportSettings) { grammar = new ReportingLanguageGrammer(); evaluator = new ReportingExpressionEvaluator(grammar); evaluator.AddReportSettings(reportSettings); }
public static void AddReportSettings(this ReportingExpressionEvaluator app,IReportSettings reportSettings) { if (reportSettings == null) throw new ArgumentNullException("reportSettings"); app.Globals.Add("ReportSettings",reportSettings); }
public ExpressionVisitor(IReportSettings reportSettings) { grammar = new ReportingLanguageGrammer(); evaluator = new ReportingExpressionEvaluator(grammar); evaluator.AddReportSettings(reportSettings); }