From e25ba6d26e7934e69be437d33518921cb9526440 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 26 Apr 2013 12:24:08 +0000 Subject: [PATCH] Bug fix B2013-086, The folder path part of _FileName contained a folder name with a perio resulting is an invalid file location/file name. Changed the IndexOf call to the LastIndexOf --- PROMS/Volian.Print.Library/PDFChronologyReport.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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);