Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Close SSRS report after excel generated

(0) ShareShare
ReportReport
Posted on by 323
Hi,
I have created SSRS report which will create excel directly on report generation. but after excel generated the page is not closing and shows a blank page. It should redirect to home page after excel is generated.
 
Please find the below code for reference.
public final class OrderBookReportController extends SrsReportRunController implements BatchRetryable{    SRSPrintDestinationSettings printDestinationSetting;   /// <summary>   /// Main method   /// </summary>   /// <param name = /_args/>args</param>    public static void main(Args _args)    {        NAVOrderBookReportController controller = new OrderBookReportController();        controller.parmReportName(ssrsReportStr(OrderBookReport,Report));        controller.parmArgs(_args);        controller.parmShowDialog(false);        controller.startOperation();       //FormRun fr= _args.caller();       // fr.close();      //  _args.caller().close();                  }    protected void preRunModifyContract()    {        printDestinationSetting = new SRSPrintDestinationSettings();        printDestinationSetting.printMediumType(SRSPrintMediumType::File);        printDestinationSetting.fileName(System.IO.Path::GetTempPath() +/OrderBookReport.XLSX/);        printDestinationSetting.fileFormat(SRSReportFileFormat::Excel);        printDestinationSetting.overwriteFile(true);        this.parmReportContract().parmPrintSettings(printDestinationSetting);      }}
 
Please suggest.
Thanks,
Priya
  • Suggested answer
    Mohit Rampal Profile Picture
    12,556 Moderator on at
    Close SSRS report after excel generated
    Hi Priya, In addition, you can check this article and let us know if still issues.
     
  • Suggested answer
    GirishS Profile Picture
    27,823 Moderator on at
    Close SSRS report after excel generated
    Hi Priya,
     
    I am not sure why this happening.
    But instead of extending the controller class - Create normal class like mentioned in the below blog.
    I mean don't extend the SrsReportRunController.
     
    Thanks,
    Girish S.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,202 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans