Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Close SSRS report after excel generated

Posted on by 303
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
    Mohit Rampal 12,547 Super User 2024 Season 1 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
    GirishS 27,832 Super User 2024 Season 1 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans