web
You’re offline. This is a read only version of the page.
close
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 345
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
I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at
    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.
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
    Hi Priya, In addition, you can check this article and let us know if still issues.
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans