Forum Discussion

GuillemCaceres's avatar
GuillemCaceres
New Member
2 years ago
Solved

Data parameter on Paginated report file title.

We have just implemented the paginated report solution for our users who wanted to receive an extraction every day, and they are delighted with the result.

 

However, they want the name of the excel file they receive not to be always the same and to to avoid being overwritten when downloading.
Is it possible to add a current date parameter to the file name?

This is very useful and something that users are requesting a lot.

 

Thank you very much!

4 Replies

  • Hi GuillemCaceres 

    Sadly this isn't (to my knowledge) an available feature. There is a Power BI idea for it here:
    https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=677c1dad-4793-ee11-a81c-6045bdba0236

     

    The only way currently would be to embedd the Paginated Report within a Power BI report and then have a button that exports the data using a Power Automate flow.

    This isn't a 1 to 1 but includes most of the steps:
    https://pbi-guy.com/2023/02/03/export-paginated-reports-automatically-in-a-low-code-way-without-power-bi-premium/

  • Hello SamWiseOwl 

    Thank for your reply!

    It is so bad to don't have integrated an easy option like meanwhile other tool have it.

    Which is the best place to make a request to Microsoft developers to think on this requirements for the next PowerBI updates?

     

    Thanks!

  • aduguid's avatar
    aduguid
    Memorable Member

    You could use a PowerShell script to run on Windows Task Scheduler on the server. Here's an example that saves the file. I'd set the task up under a service account.

     

    <#
        Description: Weekly Performance Summary
        Purpose: To export reports from SQL Server Reporting Services.
    #>
    
    Try
    { 
        $dateTimeFormat = 'yyyyMMdd';
        $executeStart = Get-Date
        $executeStart = $executeStart.ToString($dateTimeFormat)
        $exportPath = 'C:\Temp\';
        $ssrsPath = 'https://YourReportServer/ReportServer/Pages/ReportViewer.aspx?%2fFinance/Weekly%20Performance%20Report';
        $ssrsFileName = $ssrsPath.split('/')[-1] -replace '%20', ' ';
        $ssrsFile = $exportPath + $ssrsFileName + $dateTimeFormat + '.pdf';
        $ssrsFilePdf = $ssrsPath + '&rs:Format=EXCELOPENXML'
        (Invoke-WebRequest -Uri $ssrsFilePdf -OutFile $ssrsFile -UseDefaultCredentials -TimeoutSec 60);
    }