Skip to content

Fixed migration of reports with dot in name#1026

Merged
uc-msft merged 2 commits intomicrosoft:masterfrom
v-seradi:master
Sep 12, 2022
Merged

Fixed migration of reports with dot in name#1026
uc-msft merged 2 commits intomicrosoft:masterfrom
v-seradi:master

Conversation

@v-seradi
Copy link
Copy Markdown
Contributor

@v-seradi v-seradi commented Jul 6, 2022

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.

@ghost
Copy link
Copy Markdown

ghost commented Jul 6, 2022

CLA assistant check
All CLA requirements met.

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
Copy link
Copy Markdown
Member

@jtarquino jtarquino Jul 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove me

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)
Copy link
Copy Markdown
Member

@jtarquino jtarquino Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid abbreviations FE should be FileExtension #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected.

@maggiesMSFT
Copy link
Copy Markdown
Contributor

#sign-off

@Hopscotch8
Copy link
Copy Markdown

Remove me

@uc-msft uc-msft merged commit 176b55e into microsoft:master Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants