All - B2016-247, B2016-251 Complete RO Report Issues:
Underscore in Iamge File Name was being converted to Underline command Double Underscore was being remove from group headings This was corrected to change double underscore to a space. Empty fields were causing the code to crash and print only a small portion of the report
This commit is contained in:
		| @@ -235,26 +235,29 @@ namespace Volian.Print.Library | |||||||
| 			{ | 			{ | ||||||
| 				int uidx = 0; | 				int uidx = 0; | ||||||
| 				string strChk = (instr.Substring(idx)); | 				string strChk = (instr.Substring(idx)); | ||||||
| 				MatchCollection mc1 = Regex.Matches(strChk, "[_](.*?)"); // look for underline on/off | 				if (!_LastWasName) //B2016-251 Don't change underscore to underline to Name value | ||||||
| 				foreach (Match m1 in mc1) |  | ||||||
| 				{ | 				{ | ||||||
| 					if (uidx < m1.Index) | 					MatchCollection mc1 = Regex.Matches(strChk, "[_](.*?)"); // look for underline on/off | ||||||
|  | 					foreach (Match m1 in mc1) | ||||||
| 					{ | 					{ | ||||||
| 						string tstr = (strChk.Substring(uidx, m1.Index - uidx)); | 						if (uidx < m1.Index) | ||||||
| 						if (tstr.EndsWith(" ")) | 						{ | ||||||
| 							tstr = tstr.Substring(0, tstr.Length - 1) + "\xA0"; | 							string tstr = (strChk.Substring(uidx, m1.Index - uidx)); | ||||||
| 						chk = new Chunk(tstr, fnt); | 							if (tstr.EndsWith(" ")) | ||||||
| 						if (underlineChunk) | 								tstr = tstr.Substring(0, tstr.Length - 1) + "\xA0"; | ||||||
| 							chk.SetUnderline(Color.BLACK, 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); | 							chk = new Chunk(tstr, fnt); | ||||||
| 						chk.SetTextRise(0); | 							if (underlineChunk) | ||||||
| 						p.Add(chk); | 								chk.SetUnderline(Color.BLACK, 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); | ||||||
| 						uidx += (tstr.Length+1); | 							chk.SetTextRise(0); | ||||||
| 						underlineChunk = !underlineChunk; | 							p.Add(chk); | ||||||
| 					} | 							uidx += (tstr.Length + 1); | ||||||
| 					else if (uidx == m1.Index) | 							underlineChunk = !underlineChunk; | ||||||
| 					{ | 						} | ||||||
| 						uidx++; | 						else if (uidx == m1.Index) | ||||||
| 						underlineChunk = !underlineChunk; | 						{ | ||||||
|  | 							uidx++; | ||||||
|  | 							underlineChunk = !underlineChunk; | ||||||
|  | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 				if (uidx <= strChk.Length - 1) | 				if (uidx <= strChk.Length - 1) | ||||||
| @@ -403,9 +406,9 @@ namespace Volian.Print.Library | |||||||
| 					showStatBar.BarMax = (int)RO_df.GetFileLength(); | 					showStatBar.BarMax = (int)RO_df.GetFileLength(); | ||||||
| 					showStatBar.StatMsg = "Creating Report"; | 					showStatBar.StatMsg = "Creating Report"; | ||||||
| 					// Loop until either printing is aborted or end of file. | 					// Loop until either printing is aborted or end of file. | ||||||
| 					while (!StopPrinting && (iRecType = RO_df.ReadInteger16()) != -1) | 					while (!StopPrinting &&  (iRecType = RO_df.ReadInteger16()) != -1) | ||||||
| 					{ | 					{ | ||||||
| 						//Console.WriteLine("Record Type: {0}", iRecType); | 						//Console.WriteLine("Record Type: {0}.{0:X}", iRecType); | ||||||
| 						switch (iRecType) | 						switch (iRecType) | ||||||
| 						{ | 						{ | ||||||
| 							case 1:         // Set Header | 							case 1:         // Set Header | ||||||
| @@ -658,7 +661,8 @@ namespace Volian.Print.Library | |||||||
| 				else | 				else | ||||||
| 					Hdrs.repeatCount[iLoop] =hdrRptCnt; | 					Hdrs.repeatCount[iLoop] =hdrRptCnt; | ||||||
| 				pTmp = RO_df.ReadText(); | 				pTmp = RO_df.ReadText(); | ||||||
| 				if (Hdrs.strHdrs.Count-1 < iLoop) | 				//Console.WriteLine("SH[{0}]", pTmp); | ||||||
|  | 				if (Hdrs.strHdrs.Count - 1 < iLoop) | ||||||
| 					Hdrs.strHdrs.Add(pTmp); | 					Hdrs.strHdrs.Add(pTmp); | ||||||
| 				else | 				else | ||||||
| 					Hdrs.strHdrs[iLoop] = pTmp; | 					Hdrs.strHdrs[iLoop] = pTmp; | ||||||
| @@ -669,13 +673,16 @@ namespace Volian.Print.Library | |||||||
| 			// Set the new header count | 			// Set the new header count | ||||||
| 			Hdrs.HdrCnt = iNewCnt; | 			Hdrs.HdrCnt = iNewCnt; | ||||||
| 		} | 		} | ||||||
|  | 		bool _LastWasName = false;//B2016-251 Don't change underscore to underline to Name value | ||||||
| 		public void PushHeader() | 		public void PushHeader() | ||||||
| 		{ | 		{ | ||||||
| 			//if (m_pPrinterOut->Row() > 55) | 			//if (m_pPrinterOut->Row() > 55) | ||||||
| 			////    m_pPrinterOut->newpage(); | 			////    m_pPrinterOut->newpage(); | ||||||
| 			//pdfReportDoc.NewPage(); | 			//pdfReportDoc.NewPage(); | ||||||
| 			string pTmp = RO_df.ReadText(); | 			string pTmp = RO_df.ReadText(); | ||||||
|  | 			//Console.WriteLine("PH[{0}]", pTmp); | ||||||
| 			curheaderlen = pTmp.Length; | 			curheaderlen = pTmp.Length; | ||||||
|  | 			_LastWasName = (pTmp == "Name");//B2016-251 Don't change underscore to underline to Name value | ||||||
| 			//Hdrs.strHdrs[Hdrs.HdrCnt] = pTmp; | 			//Hdrs.strHdrs[Hdrs.HdrCnt] = pTmp; | ||||||
| 			Hdrs.strHdrs.Add(pTmp); | 			Hdrs.strHdrs.Add(pTmp); | ||||||
| 			//Hdrs.repeatCount[Hdrs.HdrCnt] = 2; | 			//Hdrs.repeatCount[Hdrs.HdrCnt] = 2; | ||||||
| @@ -731,7 +738,8 @@ namespace Volian.Print.Library | |||||||
| 					//pdfDest = new PdfDestination(PdfDestination.FITH, _MyPDFWriter.DirectContent.PdfDocument.PageSize.Height); | 					//pdfDest = new PdfDestination(PdfDestination.FITH, _MyPDFWriter.DirectContent.PdfDocument.PageSize.Height); | ||||||
| 					AddOutlineLevel(parentOutline, iLoop, Hdrs.strHdrs[iLoop], MyPdfDestPage); | 					AddOutlineLevel(parentOutline, iLoop, Hdrs.strHdrs[iLoop], MyPdfDestPage); | ||||||
| 				} | 				} | ||||||
| 					AddText(Hdrs.strHdrs[iLoop], F12Bold); // should be bold and first header is centered | 				// Change double underscore to spaces in header text | ||||||
|  | 					AddText(Hdrs.strHdrs[iLoop].Replace("__"," "), F12Bold); // should be bold and first header is centered | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		static float _Top = 792; | 		static float _Top = 792; | ||||||
| @@ -837,7 +845,11 @@ namespace Volian.Print.Library | |||||||
| 		{ | 		{ | ||||||
| 			// Get the lenght of the text string and read it in | 			// Get the lenght of the text string and read it in | ||||||
| 			Int16 iValue = RO_df.ReadInteger16(); | 			Int16 iValue = RO_df.ReadInteger16(); | ||||||
| 			string szStr = RO_df.ReadText(iValue); | 			string szStr = ""; | ||||||
|  | 			// B2016-247 If size is zero it is an empty string. | ||||||
|  | 			if (iValue > 0) | ||||||
|  | 				szStr = RO_df.ReadText(iValue); | ||||||
|  | 			//Console.WriteLine("[{0}.{0:X}]='{1}'",iValue,szStr); | ||||||
| 			string temp = szStr; | 			string temp = szStr; | ||||||
| 			Chunk chk = LastHeader(); | 			Chunk chk = LastHeader(); | ||||||
| 			Phrase p = new Phrase(); | 			Phrase p = new Phrase(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Rich
					Rich