diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts index 814fbc2da..45956528e 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts @@ -137,7 +137,15 @@ export default class ReportsScreenComponent implements OnInit { } #getTemplateFilename(template: IReportTemplate): string { - return `${template.fileName} ${template.multiFileReport ? this.#translateService.instant(_('reports-screen.multi-file-report')) : ''}`.trim(); + const extensionIndex = template.fileName.lastIndexOf('.'); + const hasExtension = extensionIndex !== -1; + + const baseName = hasExtension ? template.fileName.substring(0, extensionIndex) : template.fileName; + const extension = hasExtension ? template.fileName.substring(extensionIndex) : ''; + + const multiFileSuffix = template.multiFileReport ? ` ${this.#translateService.instant(_('reports-screen.multi-file-report'))}` : ''; + + return `${baseName}${multiFileSuffix}${extension}`.trim(); } async #openOverwriteConfirmationDialog(file: File, multiFileReport: boolean): Promise {