diff --git a/PROMS/Volian.Print.Library/PDFChronologyReport.cs b/PROMS/Volian.Print.Library/PDFChronologyReport.cs index eb177292..8ab81a52 100644 --- a/PROMS/Volian.Print.Library/PDFChronologyReport.cs +++ b/PROMS/Volian.Print.Library/PDFChronologyReport.cs @@ -125,11 +125,20 @@ namespace Volian.Print.Library bool result = false; string suffix = ""; int i = 0; + // just for safety, the while loop expects to find a file extension + // so make sure it has one before going into the loop + if (!_FileName.ToUpper().EndsWith(".PDF")) + _FileName += ".pdf"; // Try to open a file for creating the PDF. while (result == false) { string fileName = _FileName; - int loc = fileName.IndexOf("."); + // Bug fix: B2013-086 + // the folder path part of _FileName contained a folder name with a period + // resulting is an invalid file location/file name. + // Changed the IndexOf call to the LastIndexOf + //int loc = fileName.IndexOf("."); + int loc = fileName.LastIndexOf("."); if (loc > -1) { string fname = fileName.Substring(0, loc);