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:
Rich 2016-11-10 16:50:24 +00:00
parent 600bbc52ea
commit ac126563df

View File

@ -235,6 +235,8 @@ namespace Volian.Print.Library
{
int uidx = 0;
string strChk = (instr.Substring(idx));
if (!_LastWasName) //B2016-251 Don't change underscore to underline to Name value
{
MatchCollection mc1 = Regex.Matches(strChk, "[_](.*?)"); // look for underline on/off
foreach (Match m1 in mc1)
{
@ -257,6 +259,7 @@ namespace Volian.Print.Library
underlineChunk = !underlineChunk;
}
}
}
if (uidx <= strChk.Length - 1)
{
string tstr = strChk.Substring(uidx);
@ -405,7 +408,7 @@ namespace Volian.Print.Library
// Loop until either printing is aborted or end of file.
while (!StopPrinting && (iRecType = RO_df.ReadInteger16()) != -1)
{
//Console.WriteLine("Record Type: {0}", iRecType);
//Console.WriteLine("Record Type: {0}.{0:X}", iRecType);
switch (iRecType)
{
case 1: // Set Header
@ -658,6 +661,7 @@ namespace Volian.Print.Library
else
Hdrs.repeatCount[iLoop] =hdrRptCnt;
pTmp = RO_df.ReadText();
//Console.WriteLine("SH[{0}]", pTmp);
if (Hdrs.strHdrs.Count - 1 < iLoop)
Hdrs.strHdrs.Add(pTmp);
else
@ -669,13 +673,16 @@ namespace Volian.Print.Library
// Set the new header count
Hdrs.HdrCnt = iNewCnt;
}
bool _LastWasName = false;//B2016-251 Don't change underscore to underline to Name value
public void PushHeader()
{
//if (m_pPrinterOut->Row() > 55)
//// m_pPrinterOut->newpage();
//pdfReportDoc.NewPage();
string pTmp = RO_df.ReadText();
//Console.WriteLine("PH[{0}]", pTmp);
curheaderlen = pTmp.Length;
_LastWasName = (pTmp == "Name");//B2016-251 Don't change underscore to underline to Name value
//Hdrs.strHdrs[Hdrs.HdrCnt] = pTmp;
Hdrs.strHdrs.Add(pTmp);
//Hdrs.repeatCount[Hdrs.HdrCnt] = 2;
@ -731,7 +738,8 @@ namespace Volian.Print.Library
//pdfDest = new PdfDestination(PdfDestination.FITH, _MyPDFWriter.DirectContent.PdfDocument.PageSize.Height);
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;
@ -837,7 +845,11 @@ namespace Volian.Print.Library
{
// Get the lenght of the text string and read it in
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;
Chunk chk = LastHeader();
Phrase p = new Phrase();