Better formatting of text for RO Summary report. Also handle degree and delta characters

This commit is contained in:
John Jenko 2015-04-23 17:06:26 +00:00
parent 18a99f8d02
commit f73d9b1af5

View File

@ -473,7 +473,7 @@ namespace VEPROMS.CSLA.Library
// Return the RO Title in a list of strings // Return the RO Title in a list of strings
// The last item in the list is the actual RO title, the items preceding it are the // The last item in the list is the actual RO title, the items preceding it are the
// titles of the groups and sub-groups containing the RO // titles of the groups and sub-groups containing the RO
public List<string> GetROTitleAndGroupPath(string ROID, bool reportMissingROs) public List<string> GetROTitleAndGroupPath(string ROID, bool reportMissingROs, bool convertCaretToDelta)
{ {
List<string> titlePath = new List<string>(); List<string> titlePath = new List<string>();
rochild roc = GetRoChild12(ROID); rochild roc = GetRoChild12(ROID);
@ -482,10 +482,17 @@ namespace VEPROMS.CSLA.Library
string tmp = roc.title; string tmp = roc.title;
if (roc.appid != "") if (roc.appid != "")
if (roc.title.Contains(roc.appid)) if (roc.title.Contains(roc.appid))
tmp = roc.title.Replace(roc.appid, string.Format("<{0}>", roc.appid)).Trim(); //tmp = roc.title.Replace(roc.appid, string.Format("<{0}>", roc.appid)).Trim();
else // remove the setpoint ID (appid) from the title string and always put the sepoint ID
tmp = string.Format("[{0}] {1}", roc.appid, roc.title); // at the beginning of the report line item.
titlePath.Add(tmp); tmp = roc.title.Replace(roc.appid, "").Trim();
//else
tmp = string.Format("[{0}] {1}", roc.appid, tmp);
tmp = tmp.Replace("`", "\u00B0"); //degree
tmp = tmp.Replace("\xF8", "\u00B0"); //degree
if (convertCaretToDelta)
tmp = tmp.Replace("^", "\u0394"); // delta
titlePath.Add(tmp);
do do
{ {
string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID);
@ -500,22 +507,22 @@ namespace VEPROMS.CSLA.Library
return titlePath; return titlePath;
} }
public List<string> GetROTitleAndGroupPathForSummary(string ROID) //public List<string> GetROTitleAndGroupPathForSummary(string ROID)
{ //{
List<string> titlePath = new List<string>(); // List<string> titlePath = new List<string>();
rochild roc = GetRoChild(ROID); // rochild roc = GetRoChild(ROID);
string tmp = roc.title.Replace(roc.appid, string.Format("<{0}>",roc.appid)).Trim(); // string tmp = roc.title.Replace(roc.appid, string.Format("<{0}>",roc.appid)).Trim();
titlePath.Add(tmp); // titlePath.Add(tmp);
do // do
{ // {
string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); // string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID);
roc = GetRoChild(parent); // roc = GetRoChild(parent);
if (roc.ID > 0) // if (roc.ID > 0)
titlePath.Add(roc.title); // titlePath.Add(roc.title);
} while (roc.ID > 0); // } while (roc.ID > 0);
titlePath.Reverse(); // titlePath.Reverse();
return titlePath; // return titlePath;
} //}
public DateTime GetRoFSTdts() public DateTime GetRoFSTdts()
{ {
return MyDocVersionInfo.DocVersionAssociations[0].MyROFst.DTS; return MyDocVersionInfo.DocVersionAssociations[0].MyROFst.DTS;