/// <summary> /// Fills the page with a standard MainPageGrid to store content and returns a reference to it /// </summary> /// <param name="page">The page</param> /// <returns>A reference to the MainPageGrid</returns> internal MainPageGrid AddMainGrid(FixedPage page) { MainPageGrid mainGrid = new MainPageGrid() { Height = page.Height, Width = page.Width }; page.Children.Add(mainGrid); return(mainGrid); }
/// <summary> /// Renders a document detailing a list of batch items and shows it in a preview window for printing. /// </summary> /// <param name="batchesToPrint">The list of Batches to print</param> public void PrintBatchReport(IEnumerable <Batch> batchesToPrint) { FixedDocument batchReport = new FixedDocument(); batchReport.DocumentPaginator.PageSize = PageSizes.A4Landscape; IEnumerable <IEnumerable <object> > paginatedBatches = _docRenderer.PaginateEntityList(batchesToPrint); foreach (IEnumerable <object> batchListPage in paginatedBatches) { FixedPage currentPage = _docRenderer.AddPageToFixedDocument(batchReport); MainPageGrid currentMainGrid = _docRenderer.AddMainGrid(currentPage); _docRenderer.AddStandardHeader(currentMainGrid.HeaderGrid); _docRenderer.AddBatchList(currentMainGrid.BodyGrid, batchListPage); } ; ShowPreview(batchReport); }
/// <summary> /// Renders a document detailing a list of Task items and shows it in a preview window for printing. /// </summary> /// <param name="batchesToPrint">The list of Tasks to print</param> public void PrintTaskList(IEnumerable <Task> taskList) { FixedDocument taskReport = new FixedDocument(); taskReport.DocumentPaginator.PageSize = PageSizes.A4Landscape; IEnumerable <IEnumerable <object> > paginatedTasks = _docRenderer.PaginateEntityList(taskList); foreach (IEnumerable <object> taskListPage in paginatedTasks) { FixedPage currentPage = _docRenderer.AddPageToFixedDocument(taskReport); MainPageGrid currentMainGrid = _docRenderer.AddMainGrid(currentPage); _docRenderer.AddStandardHeader(currentMainGrid.HeaderGrid, "Lista Lavori"); _docRenderer.AddTaskList(currentMainGrid.BodyGrid, taskListPage); } ; ShowPreview(taskReport); }