B2021-076: Proms search results are not presented in order when printed to PDF

This commit is contained in:
Jake
2022-08-18 11:34:46 +00:00
parent 3a633071ec
commit d35222e6bc
6 changed files with 104 additions and 10 deletions

View File

@@ -1612,7 +1612,8 @@ namespace Volian.Controls.Library
else lbSrchResultsIncTrans.DisplayMember = _DisplayMember;
if (_SearchResults != null)
{
if (cbSorted.Checked)
// B2021-076: Proms search results are not presented in order when printed to PDF
if (cbSorted.Checked && _DisplayMember != "SearchPath" && _DisplayMember == "ShortSearchPath")
{
Csla.SortedBindingList<ItemInfo> sortedResults = new Csla.SortedBindingList<ItemInfo>(_SearchResults);
sortedResults.ApplySort(_DisplayMember, ListSortDirection.Ascending);
@@ -1621,10 +1622,13 @@ namespace Volian.Controls.Library
}
else
{
//PopulatelbSrcResults(_SearchResults);
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = _SearchResults;
else lbSrchResultsIncTrans.DataSource = _SearchResults;
// B2021-076: Proms search results are not presented in order when printed to PDF
var sortedResults = _SearchResults.OrderBy(x => x.SearchDefaultSort).ToList();
if (tabSearchTypes.SelectedTab != tabSearchTypes.Tabs[4]) lbSrchResults.DataSource = sortedResults;
else lbSrchResultsIncTrans.DataSource = sortedResults;
}
grpPanSearchResults.Text = string.Format("Search Results Found: {0}", _SearchResults.Count);
grpPanSearchResults.Style.BackColor = Color.LightGreen;// Color.YellowGreen; Color.DarkSeaGreen;
}
@@ -1633,6 +1637,7 @@ namespace Volian.Controls.Library
grpPanSearchResults.Text = "Search Results";
grpPanSearchResults.Style.BackColor = saveGrpPanSearchResults;
}
// Turn Print and Results display style on/off based on whether there are search results
if (_SearchResults != null && _SearchResults.Count > 0)
{
@@ -1650,6 +1655,17 @@ namespace Volian.Controls.Library
btnSaveSearchResults.Enabled = false;
cmbResultsStyle.Enabled = false;
}
// B2021-076: Proms search results are not presented in order when printed to PDF
if (_DisplayMember == "SearchPath" || _DisplayMember == "ShortSearchPath")
{
cbSorted.Checked = false;
cbSorted.Enabled = false;
}
else
{
cbSorted.Enabled = true;
}
lbSrchResults.SelectedIndex = -1;
lbSrchResultsIncTrans.SelectedIndex = -1;
@@ -1832,25 +1848,26 @@ namespace Volian.Controls.Library
private string GetROsToSearch(ROFSTLookup.rochild[] chld)
{
string rtnstr = string.Empty;
// B2022-026 RO Memory Reduction code - check chilren length
// B2022-026 RO Memory Reduction code - check children length
if (chld == null || chld.Length <= 0) // get a single ROID
{
ROFSTLookup.rochild ro = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag;
rtnstr += string.Format("{0}", ro.roid);
if (rtnstr.Length == 12) rtnstr += "0000"; // last four digits are used for multiple return values
rtnstr += ROFSTLookup.FormatRoidKey(ro.roid, true);
}
else
{ // spin through the child list and get the ROIDs.
// if the child has children, then call this function recursivly
// if the child has children, then call this function recursively
foreach (ROFSTLookup.rochild roc in chld)
{
// B2022-026 RO Memory Reduction code - check children length
if (roc.children != null && roc.children.Length > 0)
rtnstr += GetROsToSearch(roc.children);
else
rtnstr += string.Format("{0},", roc.roid);
rtnstr += ROFSTLookup.FormatRoidKey(roc.roid, false);
}
}
return rtnstr;
}