public void GenerateReport(int id)
        {
            EntityDTO dto = entityData.GetOneEntity(id);

            dto.ExtractProperties();

            FileDTO file = filesData.GetFile(dto.DGXFileName);

            byte[] diagram = file.Data;
            //Save the raw .wmf file
            int poolCount = entityData.GetPoolCount(dto.ID);


            this.imageManager = new WmfImageManager(dto, diagram, dto.DGXFileName, dto.Type, poolCount, true);

            string resizedDiagram = imageManager.SaveAndResizeImage(diagram, dto.DGXFileName, dto.Type,
                                                                    poolCount, true);

            string[] images = new string[] { PathResolver.MapPath(resizedDiagram) };

            if (poolCount > 1 && dto.Type == 142)
            {
                //slice the wmf
                SubProcessSlicer slicer = new SubProcessSlicer(resizedDiagram);
                images = slicer.Slice();
            }

            List <PdfContentParameter> contents = ReportBuilder.BuildReport(dto);

            byte[] pdfBytes = PDFBuilder.CreatePDF(contents, images, dto.Type);
            this.view.RenderReport(pdfBytes);
        }
        protected override string BuildDiagramImage(EntityDTO dto)
        {
            StringBuilder html  = new StringBuilder();
            EntityData    data  = new EntityData();
            FileData      files = new FileData();


            FileDTO file = files.GetFile(dto.DGXFileName);

            byte[] imageBytes = file.Data;

            string path = string.Format("{0}_{1}", file.Date.ToFileTime().ToString(), dto.DGXFileName);

            int             poolCount    = data.GetPoolCount(dto.ID);
            WmfImageManager imageManager = new WmfImageManager(dto, imageBytes,
                                                               path, dto.Type, poolCount, false);

            path = imageManager.ProcessImage();

            html.Append("<div id=\"diagram-line\" class=\"clearfix\">");
            html.Append("<div id=\"diagram-line-left\" class=\"infoBox\">To navigate to the related process and sub-process of this diagram, use the menu on the right.<br/>To navigate related informations, select the tabs above.</div>");
            if (dto.Type == 111)
            {
                html.Append(BuildQuickLinks(dto));
            }
            html.Append("<div style=\"clear: both;\"></div>");
            html.Append("</div>");
            html.AppendFormat(GlobalStringResource.Presenter_BuildDiagramImage_Tag, path.Replace(@"\", @"/"));
            html.Append(GlobalStringResource.BreakTag);
            return(html.ToString());
        }
        public string BuildDiagramContent(EntityDTO dto)
        {
            EntityData data  = new EntityData();
            FileData   files = new FileData();
            FileDTO    file  = files.GetFile(dto.DGXFileName);

            byte[]          imageBytes   = file.Data;
            string          path         = string.Format("{0}_{1}", file.Date.ToFileTime().ToString(), dto.DGXFileName);
            int             poolCount    = data.GetPoolCount(dto.ID);
            WmfImageManager imageManager = new WmfImageManager(dto, imageBytes,
                                                               path, dto.Type, poolCount, false);

            path = imageManager.ProcessImage();
            return(path.Replace(@"\", @"/"));
        }
        protected string BuildDiagramImageReturningPath(EntityDTO dto)
        {
            StringBuilder html  = new StringBuilder();
            EntityData    data  = new EntityData();
            FileData      files = new FileData();


            FileDTO file = files.GetFile(dto.DGXFileName);

            byte[] imageBytes = file.Data;

            string path = string.Format("{0}_{1}", file.Date.ToFileTime().ToString(), dto.DGXFileName);

            int             poolCount    = data.GetPoolCount(dto.ID);
            WmfImageManager imageManager = new WmfImageManager(dto, imageBytes,
                                                               path, dto.Type, poolCount, false);

            path = imageManager.ProcessImage();


            return(path);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        protected virtual string BuildDiagramImage(EntityDTO dto)
        {
            StringBuilder html  = new StringBuilder();
            EntityData    data  = new EntityData();
            FileData      files = new FileData();


            FileDTO file = files.GetFile(dto.DGXFileName);

            byte[] imageBytes = file.Data;

            string path = string.Format("{0}_{1}", file.Date.ToFileTime().ToString(), dto.DGXFileName);

            int             poolCount    = data.GetPoolCount(dto.ID);
            WmfImageManager imageManager = new WmfImageManager(dto, imageBytes,
                                                               path, dto.Type, poolCount, false);

            path = imageManager.ProcessImage();


            html.AppendFormat(GlobalStringResource.Presenter_BuildDiagramImage_Tag, path.Replace(@"\", @"/"));
            html.Append(GlobalStringResource.BreakTag);
            return(html.ToString());
        }