Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Report (RDL) in CRM

Posted on by Microsoft Employee

I was creating RDL report in Visual studio.

In my report, I required the using of System.Net.WebClient  and System.Web.Script.Serialization.JavaScriptSerializer references in the custom code so that i can deserialize JSON.

However I was getting the following error when previewing:

6886.ssrs.PNG

Any clues as of what happens?

*This post is locked for comments

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Report (RDL) in CRM

    Also, just FYI, here is what you can/can't do in CRM online when writing code for SSRS:

    support.microsoft.com/.../custom-code-that-is-allowed-for-use-in-microsoft-dynamics-crm-online-fetchxml-reports

  • Suggested answer
    M.Azwar Alam Profile Picture
    M.Azwar Alam on at
    RE: Report (RDL) in CRM

    Hi try the following:

    Create and an entity and create records in that entity using webservice and then generate report using Report Wizard of CRM on newly created entity

    Mark answer as verified, if it works for you

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Report (RDL) in CRM

    Is there a workaround? As I want to access information from the webservice & populate in the report. Thanks.

  • Verified answer
    David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Report (RDL) in CRM

    This is a code-access security issue. If you have CRM OnPremise, you may be able to configure ReportingServices to allow it to use the System.Net.WebClient  and System.Web.Script.Serialization.JavaScriptSerializer assemblies, but if you're using CRM Online, then you won't be able to use these assemblies in a report

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Report (RDL) in CRM

    This is my custom code:

    Public Class GetMemberDetails

           Public Block As String

       End Class

    Public Class MemberDetails

           Public getResult As GetMemberDetails

     End Class

    Function GetMemberDetailsFromWebService(ByVal nricField As String) As String

           Dim returnJson As String

    Dim jsonUrl = String.Format("http://URLxxxxxxxxxx?",nricField )

           Using webClient

               Dim json = webClient.DownloadString(jsonUrl)

         Dim result = javaScriptSerializer.Deserialize(Of MemberDetails)(json)

              Dim resultAddress = String.Format("Block No.: {0}", result.getResult.Block)

               If json = "" Then

                   returnJson = ""

               Else

                   returnJson = resultAddress

               End If

           End Using

       End Function

    ---

    Where javaScriptSerializer & webClient are the Instance Name that I had set up in the "References"

    Class Name: System.Net.WebClient  Instance Name: webClient

    Class Name: System.Web.Script.Serialization.JavaScriptSerializer Instance Name: javaScriptSerializer

    The VB function was utilised in the expression in the Table cell:

    =Code.GetMemberDetailsFromWebService(Fields!governmentid.Value)

    And I got the error as shown in th screenshot.

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans