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)

WinForm.ReportViewer in Dynamics AX 2012

(0) ShareShare
ReportReport
Posted on by 25

Hi!

I am new in Dynamics AX and programming.

So i have some problem with embedding SSRS remote report into DAX.

How i did it in Visual Studio:

- Created Empty winform

- using Microsoft.Reporting.WinForms;

- In Form1_Load

ReportViewer rep = new ReportViewer();
this.Controls.Add(rep);
rep.Dock = DockStyle.Fill;
Uri uri = new Uri("http://myURL/ReportServer");
rep.ProcessingMode = ProcessingMode.Remote;
rep.ServerReport.ReportServerUrl = uri;
rep.ServerReport.ReportPath = "/MyReport";
rep.RefreshReport();

-Easy and works perfectly!

But in Dynamics..

- Created reference to Microsoft.Reporting.WinForms.ReportViewer

- Created Form in AOT, created ManagetHost in form>Design and linked it to Microsoft.Reporting.WinForms.ReportViewer

In init method:

Microsoft.Reporting.WinForms.ReportViewer myReportViewer = new Microsoft.Reporting.WinForms.ReportViewer();
Microsoft.Reporting.WinForms.ServerReport myServerReport = new Microsoft.Reporting.WinForms.ServerReport();

Microsoft.Reporting.WinForms.ProcessingMode ProcessingMode = ClrInterop::parseClrEnum("Microsoft.Reporting.WinForms.ProcessingMode", "Remote");

System.Uri serveruri = new System.Uri("http://ServerURL/ReportServer");

super();


myReportViewer.set_ProcessingMode(ProcessingMode);
myServerReport.set_ReportServerUrl(serveruri);
myServerReport.set_ReportPath("/MyReport");

myReportViewer = Viewer.control() as Microsoft.Reporting.WinForms.ReportViewer;
//Here must be something that bypass ReportServerURL and ReportPath to ReportViewer
myReportViewer.RefreshReport();

 

And i cant understand how to bypass ReportServerUrl and ReportPath to ReportViewer, as ReportViewer has no such properties.

Or maybe there is another good ways to embed report into DAX?

Tried WebBrowser.Navigate(url) - not good, throws javascript errors;

Awesomium SDK - works fine, but have issues with pdf.js

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aleksandr Sh Profile Picture
    25 on at

       Microsoft.Reporting.WinForms.ReportViewer myReportViewer = new Microsoft.Reporting.WinForms.ReportViewer();
       Microsoft.Reporting.WinForms.ServerReport myServerReport;
       
       Microsoft.Reporting.WinForms.ProcessingMode ProcessingMode = ClrInterop::parseClrEnum("Microsoft.Reporting.WinForms.ProcessingMode", "Remote");

       System.Uri serveruri = new System.Uri("http://dax-report/ReportServer");

       super();
       
       myReportViewer = Viewer.control();
        
       myReportViewer.set_ProcessingMode(ProcessingMode);
        
       myServerReport = myReportViewer.get_ServerReport();
        
       myServerReport.set_ReportServerUrl(serveruri);
       myServerReport.set_ReportPath("/url/Report");   
        
       myReportViewer.RefreshReport();

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