Fixed migration of reports with dot in name#1026
Conversation
| 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 |
There was a problem hiding this comment.
can you elaborate what is the problem and what is the proposed fix
for example when I try the old code in the IsNative code path with the example "One.Two.rdl" the srcFileName is One.Two which is what is expected regarding the comments.
Is the problem the logic of the removal of the characters after the final dot or is that GetExtension is case sensitive?
#Resolved
There was a problem hiding this comment.
The problem is that existing behavior removes part of report name when no extension provided and a dot presented in the name, i.e. RDL report named Winter.Sales will be truncated to Winter. If such report had linked reports - they all will be broken during migration.
Existing logic removes up to 5 characters after last dot in name, considering them as extension. I added a check, which removes extension only in case it is actually an extension. Important note here is that by default ReportServer uploads reports without extensions, i.e. file Report.rdl would be uploaded as Report. Same for Winter.Sales.rdl -> Winter.Sales.
Here is comparison on "before" and "after" the change:
| File name | Before | After |
|---|---|---|
| Report.rdl | Report | Report |
| Report | Report | Report |
| Winter.sales | Winter | Winter.sales |
| Text_file.txt | Text_file | Text_file.txt |
| 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) |
There was a problem hiding this comment.
Please avoid abbreviations FE should be FileExtension #Resolved
|
#sign-off |
|
Remove me |
If user uses script to migrate from ssrs12 to ssrs17 and the items which will be migrated have symbol "." in their name, then everything after the dot in the item's name will be truncated.
Also if parent reports have a dot in their name and part of the name gets truncated during migration then linked reports cannot be relinked because the parent report's name is changed during the migration.