/// <summary> /// Create report with showing SaveFileDialog /// </summary> /// <param name="format">type of creating report</param> public void CreateReport(DefaultDialogs.TargetFileType format) { try { DefaultDialogs dialogs = new DefaultDialogs(); if (dialogs.SaveFileDialog(format) == true) { IReportCreator creator = GetIReportCreatorFromReportFormat(format); creator.CreateReport(dialogs.FilePath, properties.ToList()); } } catch (NullReferenceException e) { DefaultDialogs.ShowMessage("Не удалось создать отчет, возможно не достаточно свободной памяти\n" + "Системное описание ошибки" + e.Message, "Ошибка"); } catch (IOException e) { DefaultDialogs.ShowMessage(e.Message, "Ошибка"); } catch (Exception e) { DefaultDialogs.ShowMessage("Не опознанная ошибка!\n" + "Системное описание ошибки" + e.Message, "Ошибка"); } }
public ProductPresenter(IProductView view, ApplicationController appController, IProductRepository repository, IReportCreator reportCreator) { this.view = view; this.appController = appController; this.repository = repository; this.reportCreator = reportCreator; }
/// <summary> /// Create report with battery information /// </summary> /// <param name="creator">object, which can create report (implement required interface)</param> private void CreateNewReport(IReportCreator creator) { try { if (CommandParams.Length > 1) { MainWindowViewModel vm = new MainWindowViewModel(); creator.CreateReport(CommandParams[1], vm.properties.ToList()); TryPrintErrorToParrentConsole(null, "\t *** Отчет успешно создан! *** \n", false); } else { throw new ArgumentException("Ошибка! Путь для файла не передан"); } } catch (ArgumentException e) { TryPrintErrorToParrentConsole(e, e.Message, false); } catch (IOException e) { TryPrintErrorToParrentConsole(e, e.Message, false); } catch (Exception e) { TryPrintErrorToParrentConsole(e, "Ошибка, не удалось создать отчет", true); } }
public void LoadFromStream() { var asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.RepWithTwoItems); var reportingFactory = new ReportingFactory(); reportCreator = reportingFactory.ReportCreator(stream); }
/// <summary> /// Initializes a new instance of the <see cref="ReportsController"/> class. /// </summary> /// <param name="repository">The repository.</param> /// <param name="paramsParser"></param> /// <param name="durationParser"></param> /// <param name="creator"></param> public ReportsController(IReportsRepository repository, IFilterParamsParser paramsParser, IDurationParser durationParser, IReportCreator creator) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _paramsParser = paramsParser ?? throw new ArgumentNullException(nameof(paramsParser)); _durationParser = durationParser ?? throw new ArgumentNullException(nameof(durationParser)); _creator = creator ?? throw new ArgumentNullException(nameof(creator)); }
void BuildExportList(IReportCreator reportCreator) { Pages.Clear(); reportCreator.PageCreated += OnPageCreated; reportCreator.BuildExportList(); reportCreator.PageCreated -= OnPageCreated; }
public ReportingTask(IReportCreator reportCreator, IOSPSuiteTeXReporterRepository reporterRepository, IBuildTrackerFactory buildTrackerFactory, IApplicationConfiguration applicationConfiguration) { _reportCreator = reportCreator; _reporterRepository = reporterRepository; _buildTrackerFactory = buildTrackerFactory; _applicationConfiguration = applicationConfiguration; }
private void RunFormSheet(ReportModel reportModel) { IReportCreator reportCreator = FormPageBuilder.CreateInstance(reportModel); // reportCreator.SectionRendering += new EventHandler<SectionRenderEventArgs>(PushPrinting); BuildExportList(reportCreator); }
public void LoadFromStream() { Assembly asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.RepWithTwoItems); var reportingFactory = new ReportingFactory(); reportCreator = reportingFactory.ReportCreator(stream); }
public void LoadFromStream() { System.Reflection.Assembly asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.RepWithTwoItems); var reportingFactory = new ReportingFactory(); // reportCreator = reportingFactory.ReportCreator(stream); var model = reportingFactory.LoadReportModel (stream); reportCreator = new DataPageBuilder(model,new System.Collections.Generic.List<string>()); }
public void LoadModelFromStream() { Assembly asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.TestForGlobals); var rf = new ReportingFactory(); var reportingFactory = new ReportingFactory(); reportCreator = reportingFactory.ReportCreator(stream); }
private void RunFormSheet(ReportModel reportModel) { IReportCreator reportCreator = FormPageBuilder.CreateInstance(reportModel); reportCreator.SectionRendering += new EventHandler <SectionRenderEventArgs>(PushPrinting); reportCreator.PageCreated += OnPageCreated; reportCreator.BuildExportList(); ShowCompleted(); }
public ApplicationController(Bootstrapper bootstrapper) { this.supplierRepository = bootstrapper.SupplierRepository; this.productRepository = bootstrapper.ProductRepository; this.productEntryRepository = bootstrapper.ProductEntryRepository; this.productIssueRepository = bootstrapper.ProductIssueRepository; this.variationTypeRepository = bootstrapper.VariationTypeRepository; this.fileService = bootstrapper.FileService; this.reportCreator = bootstrapper.ReportCreator; }
private void RunDataReport(ReportModel reportModel, IDataManager data) { ILayouter layouter = new Layouter(); IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, data, layouter); reportCreator.SectionRendering += new EventHandler <SectionRenderEventArgs>(PushPrinting); reportCreator.PageCreated += OnPageCreated; reportCreator.BuildExportList(); ShowCompleted(); }
/// <summary> /// For internal use only /// </summary> /// <param name="reportModel"></param> /// <returns></returns> public static IReportCreator CreatePageBuilder(IReportModel reportModel) { if (reportModel == null) { throw new ArgumentNullException("reportModel"); } IDataManager dataMan = DataManagerFactory.CreateDataManager(reportModel, (ReportParameters)null); IReportCreator builder = DataPageBuilder.CreateInstance(reportModel, dataMan); return(builder); }
public static PdfRenderer CreateInstance (IReportCreator basePager,string fileName,bool showOutput) { if ( basePager == null) { throw new ArgumentNullException("basePager"); } if (String.IsNullOrEmpty(fileName)) { throw new ArgumentNullException("fileName"); } BasePager bp = basePager as BasePager; return PdfRenderer.CreateInstance(bp.ReportModel.ReportSettings,bp.Pages,fileName,showOutput); }
public void HandleEmptyList() { var asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.ReportFromList); var reportingFactory = new ReportingFactory(); var model = reportingFactory.LoadReportModel(stream); reportCreator = new DataPageBuilder(model, new List <string>()); reportCreator.BuildExportList(); Assert.That(reportCreator.Pages[0].ExportedItems.Count, Is.EqualTo(4)); }
public void LoadFromStream() { var contributorList = new ContributorsList(); var list = contributorList.ContributorCollection; var asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.GroupedList); var reportingFactory = new ReportingFactory(); var model = reportingFactory.LoadReportModel (stream); reportCreator = new DataPageBuilder(model,list); }
private void RunDataReport(ReportModel reportModel, IDataManager data) { IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, data); reportCreator.SectionRendering += new EventHandler <SectionRenderEventArgs>(PushPrinting); reportCreator.GroupHeaderRendering += new EventHandler <GroupHeaderEventArgs>(GroupHeaderRendering); reportCreator.GroupFooterRendering += GroupFooterRendering; reportCreator.RowRendering += new EventHandler <RowRenderEventArgs>(RowRendering); reportCreator.PageCreated += OnPageCreated; reportCreator.BuildExportList(); ShowCompleted(); }
public void LoadFromStream() { var contributorList = new ContributorsList(); var list = contributorList.ContributorCollection; var asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.GroupedList); var reportingFactory = new ReportingFactory(); var model = reportingFactory.LoadReportModel(stream); reportCreator = new DataPageBuilder(model, list); }
public static PdfRenderer CreateInstance(IReportCreator basePager, string fileName, bool showOutput) { if (basePager == null) { throw new ArgumentNullException("basePager"); } if (String.IsNullOrEmpty(fileName)) { throw new ArgumentNullException("fileName"); } BasePager bp = basePager as BasePager; return(PdfRenderer.CreateInstance(bp.ReportModel.ReportSettings, bp.Pages, fileName, showOutput)); }
public IReportCreator Run(ReadOnlyCollection <AssemblyNode> list) { System.Reflection.Assembly asm = Assembly.GetExecutingAssembly(); System.IO.Stream stream = asm.GetManifestResourceStream("ICSharpCode.CodeQuality.Reporting.DependencyReport.srd"); var model = ReportEngine.LoadReportModel(stream); ReportSettings = model.ReportSettings; var newList = MakeList(list); IReportCreator creator = ReportEngine.CreatePageBuilder(model, newList, null); creator.BuildExportList(); return(creator); }
public void RunReport(ReportModel reportModel, IDataManager dataManager) { if (reportModel == null) { throw new ArgumentNullException("reportModel"); } if (dataManager == null) { throw new ArgumentNullException("dataManager"); } // ReportEngine.CheckForParameters(reportModel, parameters); IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, dataManager); BuildExportList(reportCreator); }
public Presenter(IRawDataProcessor rawProcessor, IReportCreator reportCreator, IDocumentCreator documentCreator, IMainForm mainform) { this._rawProcessor = rawProcessor; this._mainform = mainform; this._reportCreator = reportCreator; this._documentCreator = documentCreator; this._inputObject = new UserInput(); this._report = new Report(); _report.reportCreated = false; // флаг пустого объекта _mainform.fileImportClick += new EventHandler(mainform_fileImportClick); _mainform.createReportClick += new EventHandler(mainform_createReportClick); _mainform.createDocumentClick += new EventHandler(mainform_createDocumentClick); }
private void RunEventLogger_Pdf(string fileName) { Cursor.Current = Cursors.WaitCursor; EventLogger eventLogger = new EventLogger(fileName); Cursor.Current = Cursors.Default; this.imageList = eventLogger.Images; ReportModel model = ReportEngine.LoadReportModel(fileName); IReportCreator creator = ReportEngine.CreatePageBuilder(model, eventLogger.EventLog, null); creator.SectionRendering += PushPrinting; creator.BuildExportList(); using (PdfRenderer pdfRenderer = PdfRenderer.CreateInstance(creator, SelectFilename(), true)) { pdfRenderer.Start(); pdfRenderer.RenderOutput(); pdfRenderer.End(); } }
public void RunReport(ReportModel reportModel, DataTable dataTable, ReportParameters parameters) { if (reportModel == null) { throw new ArgumentNullException("reportModel"); } if (dataTable == null) { throw new ArgumentNullException("dataTable"); } ReportEngine.CheckForParameters(reportModel, parameters); IDataManager dataManager = DataManagerFactory.CreateDataManager(reportModel, dataTable); IReportCreator reportCreator = DataPageBuilder.CreateInstance(reportModel, dataManager); // reportCreator.SectionRendering += new EventHandler<SectionRenderEventArgs>(PushPrinting); // reportCreator.GroupHeaderRendering += new EventHandler<GroupHeaderEventArgs>(GroupHeaderRendering); // reportCreator.GroupFooterRendering += GroupFooterRendering; // // reportCreator.RowRendering += new EventHandler<RowRenderEventArgs>(RowRendering); reportCreator.BuildExportList(); }
public void CreateReport() { if (_graph == null) { MessageBox.Show("Nie wygenerowano grafu.", "Błąd", MessageBoxButton.OK, MessageBoxImage.Error); return; } var dialog = new SaveFileDialog { Filter = "Plik tekstowy|*.txt|Plik PDF|*.pdf" }; if (dialog.ShowDialog() != true) { return; } IReportCreator reportCreator = null; switch (Path.GetExtension(dialog.FileName).ToLower()) { case ".pdf": reportCreator = new PdfReportCreator(_graph, new DfsAlgorithm(), _graphImageProvider, new GreedyVertexColoringAlgorithm()); break; default: reportCreator = new TextReportCreator(_graph, new DfsAlgorithm(), new GreedyVertexColoringAlgorithm()); break; } using (var outputStream = new FileStream(dialog.FileName, FileMode.OpenOrCreate)) { outputStream.Position = 0; outputStream.SetLength(0); reportCreator.Create(outputStream); } }
private void RunContributorsWithParameters(string fileName) { var model = ReportEngine.LoadReportModel(fileName); ReportParameters parameters = ReportEngine.LoadParameters(fileName); BasicParameter p1 = parameters.Parameters[0]; p1.ParameterValue = "Value of Parameter"; List <Contributor> list = ContributorsReportData.CreateContributorsList(); IReportCreator creator = ReportEngine.CreatePageBuilder(model, list, parameters); creator.SectionRendering += PushPrinting; creator.BuildExportList(); using (PdfRenderer pdfRenderer = PdfRenderer.CreateInstance(creator, SelectFilename(), true)) { pdfRenderer.Start(); pdfRenderer.RenderOutput(); pdfRenderer.End(); } }
public IReportCreator Run(ReadOnlyCollection <AssemblyNode> list) { System.Reflection.Assembly asm = Assembly.GetExecutingAssembly(); System.IO.Stream stream = asm.GetManifestResourceStream("ICSharpCode.CodeQuality.Reporting.Overviewreport.srd"); var model = ReportEngine.LoadReportModel(stream); ReportSettings = model.ReportSettings; var r = from c in list select new OverviewViewModel { Node = c }; var p = new ReportParameters(); p.Parameters.Add(new BasicParameter("param1", base.FileNames[0])); p.Parameters.Add(new BasicParameter("param2", list.Count.ToString())); IReportCreator creator = ReportEngine.CreatePageBuilder(model, r.ToList(), p); creator.BuildExportList(); return(creator); }
/// <summary> /// Use this method for pullData and FormSheet /// </summary> /// <param name="fileName"></param> /// <param name="reportParameters">null if no parameters are used</param> /// <returns><see cref="BasePager"</returns> public static IReportCreator CreatePageBuilder(string fileName, ReportParameters reportParameters) { if (String.IsNullOrEmpty(fileName)) { throw new ArgumentNullException("fileName"); } IReportModel reportModel = LoadReportModel(fileName); IReportCreator builder = null; if (reportModel.DataModel == GlobalEnums.PushPullModel.FormSheet) { builder = FormPageBuilder.CreateInstance(reportModel); } else { CheckForParameters(reportModel, reportParameters); IDataManager dataMan = DataManagerFactory.CreateDataManager(reportModel, reportParameters); builder = DataPageBuilder.CreateInstance(reportModel, dataMan); } return(builder); }
public static IReportCreator ExporterFactory(IReportModel reportModel) { IReportCreator reportCreator = null; switch (reportModel.ReportSettings.DataModel) { case GlobalEnums.PushPullModel.FormSheet: { reportCreator = new FormPageBuilder(reportModel); break; } case GlobalEnums.PushPullModel.PullData: { break; } case GlobalEnums.PushPullModel.PushData: { break; } } return(reportCreator); }
public ReportDecoratorWithIndex(IReportCreator report) : base(report) { }
public void LoadModelFromStream() { Assembly asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.TestForGlobals); var rf = new ReportingFactory(); var reportingFactory = new ReportingFactory(); reportCreator = reportingFactory.ReportCreator(stream); }
private Task <ObservableCollection <ReportIndicators> > GetReportCollectionAsync(IReportCreator reportCreator, List <Playerstatistic> playerstatistics, bool forceRefresh, CancellationToken reportCancellationToken) { return(Task.Run(() => { return reportCreator.Create(playerstatistics, reportCancellationToken, forceRefresh); })); }
public ReportsController(IReportSettingsViewModelFactory reportSettingsViewModelFactory, IReportCreator reportCreator, IReportWriter reportWriter) { this.reportSettingsViewModelFactory = reportSettingsViewModelFactory; this.reportCreator = reportCreator; this.reportWriter = reportWriter; }
void BuildExportList(IReportCreator reportCreator) { Pages.Clear(); reportCreator.PageCreated += OnPageCreated; reportCreator.BuildExportList(); reportCreator.PageCreated -= OnPageCreated; }
public void HandleEmptyList() { var asm = Assembly.GetExecutingAssembly(); var stream = asm.GetManifestResourceStream(TestHelper.ReportFromList); var reportingFactory = new ReportingFactory(); var model = reportingFactory.LoadReportModel (stream); reportCreator = new DataPageBuilder(model,new List<string>()); reportCreator.BuildExportList(); Assert.That(reportCreator.Pages[0].ExportedItems.Count,Is.EqualTo(4)); }