Logic to call the function to create the RO Summary Report

Added functions to for use in generating the RO Summary Report
Enabled the RO Summary Report and added logic to support the gathering of information for the report
Added logic to generate the RO Summary Report
This commit is contained in:
2014-12-19 19:46:27 +00:00
parent eec2b3cbae
commit 174bac97f7
4 changed files with 319 additions and 51 deletions

View File

@@ -26,7 +26,6 @@ namespace Volian.Controls.Library
}
#endregion
private List<DocVersionInfo> lstCheckedDocVersions = new List<DocVersionInfo>();
//private List<ROFSTLookup> lstCheckedROs = new List<ROFSTLookup>();
private List<object> lstCheckedROs = new List<object>();
private List<ItemInfoList> lstReportResults = new List<ItemInfoList>();
private List<string> ROList = new List<string>();
@@ -95,9 +94,6 @@ namespace Volian.Controls.Library
set
{
_ReportResult = value;
//if (value != null) // Don't select an item from the list when it is updated
// _ReportResult.ListChanged += new ListChangedEventHandler(_SearchResults_ListChanged);
//DisplayResults();
}
}
@@ -111,14 +107,12 @@ namespace Volian.Controls.Library
foreach (object rolkup in lstCheckedROs)
{
if (rolkup is ROFSTLookup.rodbi)
{
rtnStr = _MyRODbID.ToString() + ":" + string.Format("{0}", ((ROFSTLookup.rodbi)rolkup).dbiID.ToString("D4"));
}
rtnStr = _MyRODbID.ToString() + ":" + string.Format("{0}", ((ROFSTLookup.rodbi)rolkup).dbiID.ToString("X4"));
else if (rolkup is ROFSTLookup.rochild)
{
ch = (ROFSTLookup.rochild)rolkup;
chld = ch.children;
rtnStr = _MyRODbID.ToString() + ":" + GetROChildren(rolkup);
rtnStr = _MyRODbID.ToString() + ":" + GetROChildren(rolkup).TrimEnd(',');
}
//else if (rolkup is ROFSTLookup.rogrp)
// Console.WriteLine("RO Group");
@@ -135,16 +129,20 @@ namespace Volian.Controls.Library
string rtnstr = "";
if (chld.children == null) // get a single ROID
{
//ROFSTLookup.rochild ro = (ROFSTLookup.rochild)roObj;
rtnstr += string.Format("{0}", chld.roid);
if (rtnstr.Length == 12) rtnstr += "0000"; // last four digits are used for multiple return values
}
else if (!cbxROUsage.Checked && chld.children[0].ParentID == 0)
{
rtnstr += string.Format("{0},", chld.roid); // doing a RO Summary or RO Complete report - don't want children that are multiple return values
}
else
{ // spin through the child list and get the ROIDs.
// if the child has children, then call this function recursivly
foreach (ROFSTLookup.rochild roc in chld.children)
{
if (roc.children != null)
// Don't get the children if we are doing a RO Summary or RO Complete report & children are the multiple return values
if (roc.children != null && (cbxROUsage.Checked || roc.children[0].ParentID != 0))
rtnstr += GetROChildren(roc);
else
rtnstr += string.Format("{0},", roc.roid);
@@ -152,7 +150,7 @@ namespace Volian.Controls.Library
}
return rtnstr;
}
private string GetListOfROs(bool keepREDbID)
private string GetListOfROs(bool keepRODbID)
{
string rtnStr = "";
string strRODbID = "";
@@ -163,7 +161,7 @@ namespace Volian.Controls.Library
if (ndxOf > 0)
{
string tstr = rostr.Substring(0, ndxOf + 1);
if (tstr != strRODbID && keepREDbID)
if (tstr != strRODbID && keepRODbID)
{
strRODbID = tstr;
rtnStr += rostr;
@@ -186,7 +184,7 @@ namespace Volian.Controls.Library
cmbxROUsageSort.SelectedIndex = 0;
tabTransitionReports.Visible = false;
cbxComplete.Enabled = false;
cbxSummary.Enabled = false;
cbxSummary.Enabled = true;
}
public void SelectReferencedObjectTab()
@@ -234,6 +232,9 @@ namespace Volian.Controls.Library
xpSetToReport.Enabled = cbxROUsage.Checked;
xpSetToReport.Expanded = cbxROUsage.Checked;
cmbxROUsageSort.Enabled = cbxROUsage.Checked;
// reset the RO tree and clear anything that was selected
advTreeROFillIn(true);
lstCheckedROs.Clear();
EnableOrDisablePrintButton();
}
#region Procedure List
@@ -602,7 +603,7 @@ namespace Volian.Controls.Library
// TODO: KBR how to handle this?
//Console.WriteLine("ro junk");
continue;
else if (chld[i].value == null)
else if (chld[i].value == null && (cbxROUsage.Checked || chld[i].children[0].ParentID != 0))
{
tmp = new DevComponents.AdvTree.Node();
tmp.Text = chld[i].title;
@@ -785,16 +786,15 @@ namespace Volian.Controls.Library
Cursor = Cursors.WaitCursor;
if (cbxSummary.Checked) // RO Summary Report
{
//GenerateROList();
//ROFSTLookup rofstLookup = Mydocversion.DocVersionAssociations[0].MyROFst.ROFSTLookup;
//OnPrintRequest(new DisplayReportsEventArgs("RO Summary Report", "RO Report", rofstLookup, ROList));
GenerateROList();
OnPrintRequest(new DisplayReportsEventArgs("RO Summary Report", "RO Summary Report", MyROFSTLookup, ROList));
}
else if (cbxComplete.Checked) // Complete RO Report
{
GenerateROList();
string ROList = GetListOfROs(false);//don't include the RODbID in the RO list
string roDataFile = BuildRODataFile(ROList);
OnPrintRequest(new DisplayReportsEventArgs("RO Complete Report", "RO Report", roDataFile, cbxComplete.Checked));
OnPrintRequest(new DisplayReportsEventArgs("Complete RO Report", "Complete RO Report", roDataFile, cbxComplete.Checked));
}
else if (cbxROUsage.Checked)
{
@@ -866,13 +866,19 @@ namespace Volian.Controls.Library
get { return _rofstLookup; }
set { _rofstLookup = value; }
}
private List<string> _ROListForReport;
public List<string> ROListForReport
{
get { return _ROListForReport; }
set { _ROListForReport = value; }
}
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ICollection<ItemInfo> myItemInfoList,/*ROFSTLookup rolkup,*/ bool sortByProcedure)
{
_ReportTitle = reportTitle;
_TypesSelected = typesSelected;
_MyItemInfoList = myItemInfoList;
_SortUsageByProcedure = sortByProcedure;
//_rofstLookup = rolkup;
}
public DisplayReportsEventArgs(string reportTitle, string typesSelected, string roDataFile, bool completeROReport)
{
@@ -881,6 +887,13 @@ namespace Volian.Controls.Library
_RODataFile = roDataFile;
_CompleteROReport = completeROReport;
}
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ROFSTLookup rofstLookUp, List<string> roListForReport)
{
_ReportTitle = reportTitle;
_TypesSelected = typesSelected;
_rofstLookup = rofstLookUp;
_ROListForReport = roListForReport;
}
}
public delegate void DisplayReportsEvent(object sender, DisplayReportsEventArgs args);
}