C2020-002 Logic to use either the Letter or A4 paper size

This commit is contained in:
2020-02-14 17:16:28 +00:00
parent 2234bde5e1
commit b41320ed24
15 changed files with 111 additions and 47 deletions

View File

@@ -303,7 +303,9 @@ namespace Volian.Controls.Library
private void btnPrint_Click(object sender, EventArgs e)
{
OnPrintRequest(new DisplayLibDocEventArgs("Library Document Usage", LibDocList));
string paperSize = "Letter";
paperSize = LibDocList[listBoxLibDocs.SelectedIndex].LibraryDocumentUsageList[0].ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
OnPrintRequest(new DisplayLibDocEventArgs("Library Document Usage", LibDocList, paperSize));
}
}
public class DisplayLibDocEventArgs
@@ -321,6 +323,14 @@ namespace Volian.Controls.Library
get { return _libDocList; }
set { _libDocList = value; }
}
private string _PaperSize; // C2020-002 paper size is now set in the format files
public string PaperSize
{
get { return _PaperSize; }
set { _PaperSize = value; }
}
//private string _SearchString = null;
//public string SearchString
//{
@@ -339,10 +349,11 @@ namespace Volian.Controls.Library
// get { return _MyItemInfoList; }
// set { _MyItemInfoList = value; }
//}
public DisplayLibDocEventArgs(string reportTitle, DocumentInfoList libDocList)
public DisplayLibDocEventArgs(string reportTitle, DocumentInfoList libDocList, string paperSize)
{
_ReportTitle = reportTitle;
_libDocList = libDocList;
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
}
}
public delegate void DisplayLibDocEvent(object sender, DisplayLibDocEventArgs args);

View File

@@ -954,6 +954,9 @@ namespace Volian.Controls.Library
}
private void btnPrintReport_Click(object sender, EventArgs e)
{
string paperSize = "Letter";
if (Mydocversion != null && Mydocversion.ActiveFormat != null)
paperSize = Mydocversion.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
//B2019-144 Set the document text color to Red (overlay) or Black (normal)
Color lastColor = MSWordToPDF.OverrideColor;// B2019-144 Remember override color
if (MSWordToPDF.OverrideColor != Color.Black)
@@ -966,7 +969,7 @@ namespace Volian.Controls.Library
GenerateAccIDSortedROList();
else
GenerateROList();
OnPrintRequest(new DisplayReportsEventArgs("RO Summary Report", "RO Summary Report", MyROFSTLookup, ROList));
OnPrintRequest(new DisplayReportsEventArgs("RO Summary Report", "RO Summary Report", MyROFSTLookup, ROList, paperSize));
}
else if (cbxComplete.Checked) // Complete RO Report
{
@@ -976,7 +979,8 @@ namespace Volian.Controls.Library
GenerateROList();
string ROList = GetListOfROs(false);//don't include the RODbID in the RO list
string roDataFile = BuildRODataFile(ROList);
OnPrintRequest(new DisplayReportsEventArgs("Complete RO Report", "Complete RO Report", roDataFile, MyROFSTLookup, cbxComplete.Checked, this.Mydocversion.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, cbxIncldMissingROs.Checked));
if (Mydocversion != null)
OnPrintRequest(new DisplayReportsEventArgs("Complete RO Report", "Complete RO Report", roDataFile, MyROFSTLookup, cbxComplete.Checked, Mydocversion.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, cbxIncldMissingROs.Checked, paperSize));
}
else if (cbxROUsage.Checked)
{
@@ -988,10 +992,10 @@ namespace Volian.Controls.Library
{
Csla.SortedBindingList<ItemInfo> sortedResults = new Csla.SortedBindingList<ItemInfo>(SearchResults);
sortedResults.ApplySort("FoundROID", ListSortDirection.Ascending);
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By RO", "RO Usage", sortedResults, usageSortedByProcedure, cbxIncldMissingROs.Checked));
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By RO", "RO Usage", sortedResults, usageSortedByProcedure, cbxIncldMissingROs.Checked, paperSize));
}
else
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By Procedure", "RO Usage", SearchResults, usageSortedByProcedure, cbxIncldMissingROs.Checked));
OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By Procedure", "RO Usage", SearchResults, usageSortedByProcedure, cbxIncldMissingROs.Checked, paperSize));
}
else if (cbxTransFromProcs.Checked)
{
@@ -1079,7 +1083,13 @@ namespace Volian.Controls.Library
get { return _IncludeEmptyROFields; }
set { _IncludeEmptyROFields = value; }
}
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ICollection<ItemInfo> myItemInfoList, bool sortByProcedure, bool includeMissingROs)
private string _PaperSize = "Letter";
public string PaperSize // C2020-002 paper size is now set in the format files
{
get { return _PaperSize; }
set { _PaperSize = value; }
}
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ICollection<ItemInfo> myItemInfoList, bool sortByProcedure, bool includeMissingROs, string paperSize)
{
// RO Usage Report
_ReportTitle = reportTitle;
@@ -1087,9 +1097,10 @@ namespace Volian.Controls.Library
_MyItemInfoList = myItemInfoList;
_SortUsageByProcedure = sortByProcedure;
_IncludeMissingROs = includeMissingROs;
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
}
public DisplayReportsEventArgs(string reportTitle, string typesSelected, string roDataFile, ROFSTLookup rofstLookUp, bool completeROReport, bool convertCaretToDelta, bool includeEmptyROFields)
public DisplayReportsEventArgs(string reportTitle, string typesSelected, string roDataFile, ROFSTLookup rofstLookUp, bool completeROReport, bool convertCaretToDelta, bool includeEmptyROFields, string paperSize)
{
_ReportTitle = reportTitle;
_TypesSelected = typesSelected;
@@ -1098,14 +1109,16 @@ namespace Volian.Controls.Library
_ConvertCaretToDelta = convertCaretToDelta;
_rofstLookup = rofstLookUp;
_IncludeEmptyROFields = includeEmptyROFields;
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
}
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ROFSTLookup rofstLookUp, List<string> roListForReport)
public DisplayReportsEventArgs(string reportTitle, string typesSelected, ROFSTLookup rofstLookUp, List<string> roListForReport, string paperSize)
{
// RO Summary Report
_ReportTitle = reportTitle;
_TypesSelected = typesSelected;
_rofstLookup = rofstLookUp;
_ROListForReport = roListForReport;
_PaperSize = paperSize; // C2020-002 paper size is now set in the format files
}
}
public delegate void DisplayReportsEvent(object sender, DisplayReportsEventArgs args);

View File

@@ -2413,6 +2413,13 @@ namespace Volian.Controls.Library
get { return _HowLong; }
set { _HowLong = value; }
}
private string _PaperSize;
public string PaperSize // C2020-002 paper size is now set in the format files
{
get { return _PaperSize; }
set { _PaperSize = value; }
}
public DisplaySearchEventArgs(TimeSpan howLong)
{
HowLong = howLong;
@@ -2423,6 +2430,12 @@ namespace Volian.Controls.Library
_TypesSelected = typesSelected;
_MyItemInfoList = myItemInfoList;
_SearchString = searchString;
foreach (ItemInfo tmpII in myItemInfoList)
if (tmpII != null && tmpII.ActiveFormat != null)
{
_PaperSize = tmpII.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize; // C2020-002 paper size is now set in the format files
break;
}
}
}
public delegate void DisplaySearchEvent(object sender, DisplaySearchEventArgs args);