Skip to content

Commit 63c453b

Browse files
committed
Fixed migration of reports with dot in name
1 parent 03e4eb1 commit 63c453b

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

samples/features/reporting-services/ssrs-migration-rss/ssrs_migration.rss

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,21 +948,27 @@ End Function
948948

949949
'Helper function to construct correctly formatted filename
950950
Function GetSnkFilename(srcFilename As String, type As String) As String
951-
Dim hasFE As Boolean = HasFileExtension(srcFilename)
952-
If SnkIsNative And hasFE And Not GetExtension(type) = "" Then 'Cut off file extension, if present
951+
Dim currentFE As String = GetFileNameExtension(srcFilename)
952+
953+
If SnkIsNative And (GetExtension(type) = currentFE) and currentFE <> "" Then 'Cut off file extension, if present
953954
srcFilename = RemoveFileExtension(srcFilename)
954955

955-
ElseIf Not SnkIsNative And Not hasFE Then 'Add file extension, if not present
956+
ElseIf Not SnkIsNative And currentFE = "" Then 'Add file extension, if not present
956957
srcFilename = srcFilename + GetExtension(type)
957958
End If
958959

959960
Return srcFilename
960961
End Function
961962

962963
'Helper
963-
Function HasFileExtension(filename As String) As Boolean
964-
Dim index As Integer = filename.LastIndexOf(".")
965-
Return index >= 0 And filename.Length - index <= 5
964+
Function GetFileNameExtension(filename As String) As String
965+
Dim index as Integer = -1
966+
index = filename.LastIndexOf(".")
967+
If index > 0
968+
Return filename.Substring(index)
969+
Else
970+
Return ""
971+
End If
966972
End Function
967973

968974
'Helper

0 commit comments

Comments
 (0)