From b223a1937e1a1e46a22e3d9dce311e3725f0db66 Mon Sep 17 00:00:00 2001 From: Rich Date: Thu, 19 Apr 2012 18:24:18 +0000 Subject: [PATCH] Fix report to support multiple procedure sets --- PROMS/Volian.Print.Library/PDFReport.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Print.Library/PDFReport.cs b/PROMS/Volian.Print.Library/PDFReport.cs index 6eedd0b1..4ecb91c0 100644 --- a/PROMS/Volian.Print.Library/PDFReport.cs +++ b/PROMS/Volian.Print.Library/PDFReport.cs @@ -260,9 +260,9 @@ namespace Volian.Print.Library } lastPath = p; if (ProcSetList.Count == 1) - level = NewPath.Length + 1; + level = NewPath.Length-1; } - if (level > 0) level--; + //if (level > 0) level--; return level; } public void AddMainPathGroup(PdfPTable datatable, string dvPath, int splitLevel, Font f2, Color bgColor, int colSpan) @@ -416,7 +416,6 @@ namespace Volian.Print.Library float[] headerwidths = { 20, 80 }; PdfPTable datatable = new PdfPTable(1); PdfPTable colHeader = new PdfPTable(headerwidths); - datatable.HeaderRows = 4; //datatable.FooterRows = 1; datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin; datatable.LockedWidth = true; @@ -440,8 +439,9 @@ namespace Volian.Print.Library datatable.AddCell(cell); BuildSearchResultsProcSetList(); + datatable.HeaderRows = 3 + (ProcSetList.Count ==1 ? 1 : 0); int splitAt = FindSpitLevel(); // find the split level of the common path - for all procedure sets that use these library documents - AddMainPathGroup(datatable, ProcSetList[0].ToString(), splitAt, f2, Color.LIGHT_GRAY, 0); + //AddMainPathGroup(datatable, ProcSetList[0].ToString(), splitAt, f2, Color.LIGHT_GRAY, 0); Color subHeaderColor = new Color(0xD0, 0xF0, 0xD0); datatable.DefaultCell.Padding = 4; @@ -450,7 +450,7 @@ namespace Volian.Print.Library //AddCell(datatable, "Text", f2, subHeaderColor); AddCell(colHeader, "Step", f2, subHeaderColor); AddCell(colHeader, "Text", f2, subHeaderColor); - datatable.AddCell(colHeader); + //datatable.AddCell(colHeader); // This puts "Step" and "Text" column headers at the bottom of the page //AddCell(datatable, "Step", f2, subHeaderColor); //AddCell(datatable, "Text", f2, subHeaderColor); @@ -462,8 +462,18 @@ namespace Volian.Print.Library Color SectColor = new Color(0xE0, 0xFF, 0xE0);//new Color(0xC0, 0xFF, 0xC0);//Color.LIGHT_GRAY; PdfPTable subTable = new PdfPTable(headerwidths); string lastProcNum = ""; + string lastDVPath = ""; foreach (ItemInfo item in _ResultList) { + if (lastDVPath != item.SearchDVPath) + { + datatable.AddCell(subTable); + subTable = new PdfPTable(headerwidths); + AddMainPathGroup(datatable, item.SearchDVPath, splitAt, f2, Color.LIGHT_GRAY, 0); + datatable.AddCell(colHeader); + lastProcNum = ""; + } + lastDVPath = item.SearchDVPath; string curProcNum = GetCurProcNum(item.SearchPath); if (lastProcNum != "" && curProcNum != lastProcNum) {