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 :
Microsoft Dynamics AX (Archived)

How to export SSRS Report to Excel By selecting values from "Parameter window"

(0) ShareShare
ReportReport
Posted on by 781

Hello Experts,

I've to export the Developed SSRS report (with DP,Contract & UI builder class) to Excel without opening report Screen, But user has to have the option for selecting the Parameters from the parameter window.

* I tried below code but this code is not showing the parameters except the default(Print setting, etc..) parameters. 

* And also it is not considering my UI builder class.

** So please share your idea/code snippet to open the SSRS parameter window with all the parameters including UI builder overrided parameters for user selection and export the final result to Excel without showing Report screen.

SrsReportRunController controller = new SrsReportRunController();
saInstrumentVariantMovesTmpContract rdpContract = new saInstrumentVariantMovesTmpContract();
SRSPrintDestinationSettings settings;

// Define report and report design to use
controller.parmReportName(ssrsReportStr(saInstrumentVariantMovesReport,PrecisionDesign));
// Use execution mode appropriate to your situation
controller.parmExecutionMode(SysOperationExecutionMode::Synchronous);
// Suppress report dialog
controller.parmShowDialog(true);

// Explicitly provide all required parameters
rdpContract.parmStatus("Ready");
controller.parmReportContract().parmRdpContract(rdpContract);

// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileFormat(SRSReportFileFormat::Excel);
settings.overwriteFile(true);
settings.fileName(@'C:\Users\John\Desktop\111.xlsx');

// Execute the report
controller.startOperation();

*This post is locked for comments

I have the same question (0)
  • Johnkrish Profile Picture
    781 on at

    Any idea on above query?

  • Verified answer
    Martin Dráb Profile Picture
    237,896 Most Valuable Professional on at

    Do I understand correctly that you simply want to get the standard behavior back? Then delete all the unnecessary code and delete usage data, because I think that you're parmShowDialog = false from SysLastValue.

  • Johnkrish Profile Picture
    781 on at

    Hi Martin,

    Thank you for your response. As per your suggestion I've deleted usage data & the report and developed a new(since it has a simple design) report with all the necessary classes. Now it is working.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans