Added Error Log if Word File Could not be created
Select section node after it is created Don't allow an empty procedure to be printed
This commit is contained in:
		| @@ -340,6 +340,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			} | ||||
| 			catch (Exception ex) | ||||
| 			{ | ||||
| 				_MyLog.Error("***** Could not create " + _MyFile.FullName, ex); | ||||
| 				Console.WriteLine(ex.Message); | ||||
| 			} | ||||
| 		} | ||||
| @@ -526,9 +527,7 @@ namespace VEPROMS.CSLA.Library | ||||
| 			//ItemInfo sect = doc.DocumentEntries[0].MyContent.ContentItems[0]; | ||||
| 			return ToPDFReplaceROs(sect, false, roids); | ||||
| 		} | ||||
|  | ||||
| 		private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||||
|  | ||||
| 		public static string ToPDFReplaceROs(ItemInfo sect, bool openPdf, List<string> roids) //, System.Drawing.Color overrideColor, System.Windows.Forms.Form myForm) | ||||
| 		{ | ||||
| 			string fileName = GetFileName(sect); | ||||
|   | ||||
| @@ -1175,6 +1175,7 @@ namespace Volian.Controls.Library | ||||
| 							{ | ||||
| 								tn = new VETreeNode(_LastSectionInfo); | ||||
| 								SelectedNode.Nodes.Add(tn);		// add tree node to end of list. | ||||
| 								OnNodeSelect(this, new vlnTreeEventArgs(tn)); | ||||
| 							} | ||||
| 							else | ||||
| 							{ | ||||
|   | ||||
| @@ -321,6 +321,11 @@ namespace Volian.Print.Library | ||||
| 			OnStatusChanged("Before NewPage", PromsPrinterStatusType.Before); | ||||
| 			cb.PdfDocument.NewPage();	// Start of print | ||||
| 			OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage); | ||||
| 			if (myProcedure.Sections == null) | ||||
| 			{ | ||||
| 				MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); | ||||
| 				return null; | ||||
| 			} | ||||
| 			OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count); | ||||
| 			int progress = 0; | ||||
| 			int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Rich
					Rich