Added a smarter status message based on the number of items being processed

This commit is contained in:
2015-05-04 19:06:14 +00:00
parent d48819b9d8
commit 3fe7f68166
2 changed files with 32 additions and 15 deletions

View File

@@ -148,14 +148,29 @@ namespace CmpRpt
success = myrodb.RODB_GetRootGroups(rootXml);
if (success == false) return;
VlnStatusBar showStatBar = new VlnStatusBar("Complete Referenced Object Report");
showStatBar.BarMax = roIDList.Length;
showStatBar.StatMsg = "Retrieving RO Information";
int inc = 1;
VlnStatusMessage showStat = null;
VlnStatusBar showStatBar = null;
int inc = 0;
int bmax = roIDList.Length;
if (roIDList.Length > 50)
{
showStatBar = new VlnStatusBar("Retrieving RO Information");
showStatBar.BarMax = bmax;
showStatBar.StatMsg = "Retrieving RO Information";
}
else
{
showStat = new VlnStatusMessage("Retrieving RO Information");
showStat.StatusMessage = "Reading RO Information";
}
Application.DoEvents();
foreach (string roid in roIDList)
{
showStatBar.BarValue = inc++;
Application.DoEvents();
if (showStatBar != null)
{
showStatBar.StatMsg = string.Format("Retrieving RO {0} of {1}", inc++, bmax);
showStatBar.BarValue = inc;
}
tbl = roid.Substring(0, 4);
recid = (roid.Length > 4) ? roid.Substring(4, 8) : null;
@@ -226,11 +241,15 @@ namespace CmpRpt
for (int i = cnt - 1; i >= 0; i--)
headers.Add(reversehdrs[i]);
}
rptele.Show(myrodb,headers);
rptele.Show(myrodb, headers, showStat);
Application.DoEvents();
headers.Clear();
reversehdrs.Clear();
}// end foreach roid
showStatBar.Dispose();
if (showStat != null)
showStat.Dispose();
if (showStatBar != null)
showStatBar.Dispose();
}
private static string BuildROList(string[] args)