reportviewercore icon indicating copy to clipboard operation
reportviewercore copied to clipboard

ServerReport - DisplayName not working

Open rasika-sinha opened this issue 3 years ago • 3 comments

Hello,

I am using the ServerReport of Microsoft.Reporting.NETCore. I am using it in a dot net core 6.0 WebAPI project, returning the file stream so it opens the report in pdf format on the browser. I wanted to set the DisplayName of the server report so that when a user downloads it from the browser a proper name is prepopulated and not the endpoint's name. I have set the serverReport.DisplayName property but it is not reflecting. Can you please let me know how will this work?

Thanks!

rasika-sinha avatar Jul 13 '22 08:07 rasika-sinha

Hi,

this isn't really related to this project (or Report Viewer in general), but take a look at Index.cshtml.cs in ReportViewerCore.Sample.AspNetCore to see how to provide a prepopulated file name for a download.

lkosson avatar Jul 13 '22 08:07 lkosson

Thanks for the prompt response! Yes if I pass the 3rd param to the File function then it will name it accordingly but in that case, it will simply download the file. Whereas I want to display the report on the browser (the system-users are used to seeing the report viewer on the browser, but as we upgrade to dot net core it is no more an option). Therefore I don't pass the FileDownloadName param to File . Earlier when using the dot net framework, we use to set the DisplayName property of the ReportViewer's ServerReport. I was trying to do the same via setting the DisplayName property.

rasika-sinha avatar Jul 13 '22 09:07 rasika-sinha

I see. Not sure what to do with this. DisplayName doesn't really seem to be used - neither in this project nor in original sources.

lkosson avatar Jul 13 '22 09:07 lkosson