Changed an Error Message to provide the location where the error occured.
Changed StepLevel property for Cautions and Notes to reduce the probability that notes or cautions will be split over a page break. Added IsNumbered Property to aid in pagination.
This commit is contained in:
parent
06990b5c13
commit
944868a0b4
@ -505,8 +505,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
get { return MSWordToPDF._FormForPlotGraphics; }
|
get { return MSWordToPDF._FormForPlotGraphics; }
|
||||||
set { MSWordToPDF._FormForPlotGraphics = value; }
|
set { MSWordToPDF._FormForPlotGraphics = value; }
|
||||||
}
|
}
|
||||||
|
private static SectionInfo _MySection;
|
||||||
public static string GetDocPdf(SectionInfo sect, Color overrideColor)
|
public static string GetDocPdf(SectionInfo sect, Color overrideColor)
|
||||||
{
|
{
|
||||||
|
_MySection = sect;
|
||||||
DocumentInfo mydoc = sect.MyContent.MyEntry.MyDocument;
|
DocumentInfo mydoc = sect.MyContent.MyEntry.MyDocument;
|
||||||
UpdateDocPdf(mydoc, overrideColor,sect);
|
UpdateDocPdf(mydoc, overrideColor,sect);
|
||||||
string fileName = GetFileName(sect);
|
string fileName = GetFileName(sect);
|
||||||
@ -884,7 +886,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_MyLog.Error("Could not set margins", ex);
|
if (_MySection != null)
|
||||||
|
{
|
||||||
|
_MyLog.ErrorFormat("<<< ERROR >>> MSWord could not set margins\r\n==>'MSWord could not set margins',{0},'{1}','{2}'"
|
||||||
|
, _MySection.ItemID, _MySection.MyDocVersion.MyFolder.Name, _MySection.ShortPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_MyLog.Error("Could not set margins", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -677,14 +677,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else if (item.IsCautionPart)
|
else if (item.IsCautionPart)
|
||||||
{
|
{
|
||||||
if (item.MyPrevious == null) level-=(1 + firstInc);
|
if (item.MyPrevious == null) level-=(1 + firstInc);
|
||||||
else level++;
|
else level+=3;
|
||||||
}
|
}
|
||||||
// Paginate before first note, if the step does not have a caution.
|
// Paginate before first note, if the step does not have a caution.
|
||||||
// Otherwise, try to keep the notes together.
|
// Otherwise, try to keep the notes together.
|
||||||
else if (item.IsNotePart)
|
else if (item.IsNotePart)
|
||||||
{
|
{
|
||||||
if (parent.Cautions == null && item.MyPrevious == null) level-=(1 + firstInc);
|
if (parent.Cautions == null && item.MyPrevious == null) level-=(1 + firstInc);
|
||||||
else level++;
|
else level+=3;
|
||||||
}
|
}
|
||||||
// Try not to paginate on a table.
|
// Try not to paginate on a table.
|
||||||
else if (item.IsTablePart)
|
else if (item.IsTablePart)
|
||||||
@ -1103,6 +1103,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool IsNumbered
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if ((MyContent.Type / 10000) != 2) return true;
|
||||||
|
string tabstr = FormatStepData.TabData.IdentPrint;
|
||||||
|
if (tabstr.Contains("{seq}")) return true;
|
||||||
|
if (tabstr.Contains("{ALPHA}")) return true;
|
||||||
|
if (tabstr.Contains("{ROMAN}")) return true;
|
||||||
|
if (tabstr.Contains("{numeric}")) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
public bool IsTablePart
|
public bool IsTablePart
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -2395,7 +2408,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_MyTab.Text = "";
|
_MyTab.Text = "";
|
||||||
_MyTab.CleanText = "";
|
_MyTab.CleanText = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int stepType = (int)(MyContent.Type % 10000);
|
int stepType = (int)(MyContent.Type % 10000);
|
||||||
string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint;
|
string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint;
|
||||||
if (ActiveFormat.Name.ToUpper() == "WCNCKL" || ActiveFormat.Name.ToUpper() == "WSTCKL")
|
if (ActiveFormat.Name.ToUpper() == "WCNCKL" || ActiveFormat.Name.ToUpper() == "WSTCKL")
|
||||||
@ -2718,9 +2731,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
SectionConfig sc = new SectionConfig(si);
|
SectionConfig sc = new SectionConfig(si);
|
||||||
//SectionConfig sc = ii.MyConfig as SectionConfig;
|
//SectionConfig sc = ii.MyConfig as SectionConfig;
|
||||||
if (sc != null && sc.SubSection_AutoIndent == "Y")
|
if (sc != null && sc.SubSection_AutoIndent == "Y")
|
||||||
countlev++;
|
countlev++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ii = ii.MyParent;
|
ii = ii.MyParent;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user