Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error while opening Report URL...

Posted on by Microsoft Employee

Hi Everyone,

I am trying to run a report from java script ,

function OpenOrderReport() {
debugger;
var rdlName = "Complaints Acknowledgement Report.rdl"; //Replace
var reportGuid = "FD140AAF-4DF4-11DD-BD17-0019B9312238"; //Replace
var entityType = "112"; //Replace
var entityGuid = Xrm.Page.data.entity.getId();
var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType;
window.open(url, null, 800, 600, true, false, null);
}

The thing is when i am trying to open crm report URL

 Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?

It's not opening and i am getting following error

48330.Capture.PNG

Please Help me  on this....

*This post is locked for comments

  • ARIFNIIT Profile Picture
    ARIFNIIT 1,391 on at
    RE: Error while opening Report URL...

    Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx  is the report viewer url. you need to pass action, helpId(optional) and report Id. without report Id how report viewer identify to open/run an report.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error while opening Report URL...

    Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx

    even i tried using above url i am unable to connect ,it throws me the same error(in the pic).

  • Suggested answer
    ARIFNIIT Profile Picture
    ARIFNIIT 1,391 on at
    RE: Error while opening Report URL...

    We can open a report by passing appropriate parameter values to the below URL

    [organization url]/crmreports/viewer/viewer.aspx 

    This URL accepts the following parameters:

    action: Two possible values for this parameter are run or filter. When run is used, the report will be displayed using the default filters. When filter is used, the report will display a filter that the user can edit before choosing the Run Report button to view the report.

    helpID: This parameter is optional. For reports that are included with Microsoft Dynamics 365 the value in this parameter allows the Help button to display appropriate content about this report when Help on This Page is chosen. The value should correspond to the report File Name attribute value.

    id: This parameter is the report ReportId attribute value.

    if you are using run in action then no need to pass record id and type. you can pass it into filter action.

    Try below code

    function OpenOrderReport() {
    debugger;
    var rdlName = "Complaints Acknowledgement Report.rdl"; //Replace
    var reportGuid = "FD140AAF-4DF4-11DD-BD17-0019B9312238"; //Replace
    var entityType = "112"; //Replace
    var entityGuid = Xrm.Page.data.entity.getId(); 
    var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&helpID=" + rdlName + "&id={" + reportGuid + "}"
    window.open(url, null, 800, 600, true, false, null);
    }

  • Suggested answer
    imayur Profile Picture
    imayur 630 on at
    RE: Error while opening Report URL...

    Hi,

    Looks like "g" parameter is null from stacktrace.

    Why do you need  "&records=" + entityGuid + "&recordstype=" + entityType;" in url.

    Try without records and recordstype in url.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans