mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Fixed migration of reports with dot in name
This commit is contained in:
@@ -948,11 +948,12 @@ End Function
|
||||
|
||||
'Helper function to construct correctly formatted filename
|
||||
Function GetSnkFilename(srcFilename As String, type As String) As String
|
||||
Dim hasFE As Boolean = HasFileExtension(srcFilename)
|
||||
If SnkIsNative And hasFE And Not GetExtension(type) = "" Then 'Cut off file extension, if present
|
||||
Dim currentFE As String = GetFileNameExtension(srcFilename)
|
||||
|
||||
If SnkIsNative And (GetExtension(type) = currentFE) and currentFE <> "" Then 'Cut off file extension, if present
|
||||
srcFilename = RemoveFileExtension(srcFilename)
|
||||
|
||||
ElseIf Not SnkIsNative And Not hasFE Then 'Add file extension, if not present
|
||||
ElseIf Not SnkIsNative And currentFE = "" Then 'Add file extension, if not present
|
||||
srcFilename = srcFilename + GetExtension(type)
|
||||
End If
|
||||
|
||||
@@ -960,9 +961,14 @@ Function GetSnkFilename(srcFilename As String, type As String) As String
|
||||
End Function
|
||||
|
||||
'Helper
|
||||
Function HasFileExtension(filename As String) As Boolean
|
||||
Dim index As Integer = filename.LastIndexOf(".")
|
||||
Return index >= 0 And filename.Length - index <= 5
|
||||
Function GetFileNameExtension(filename As String) As String
|
||||
Dim index as Integer = -1
|
||||
index = filename.LastIndexOf(".")
|
||||
If index > 0
|
||||
Return filename.Substring(index)
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Function
|
||||
|
||||
'Helper
|
||||
|
||||
Reference in New Issue
Block a user