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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Custom Code in SSRS Reports for 365 Online

(0) ShareShare
ReportReport
Posted on by 17

Hello,

I am getting the following error message when I am trying to upload an SSRS Report to D365 Online. "The report server has RDLSandboxing enabled and the report contains custom code. Remove the Code element from the report definition." I have read other posts where they say it is not possible to use Custom Code in the Online version. How can I use Custom Code or what else can be done to replace Custom Code.

Thanks!

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You can't use custom code in report in online. It's limitation and you can't do anything with it. Th other question - why do you need that code? May be there is other way to implement your scenario.

  • NKaur Profile Picture
    17 on at

    I have a lot of conditions that need to be checked before the value is populated in the column. Like If Service is "" and DocumentType Contains "" and so on..

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    There should be a button "Download Log" when you get an error message during report upload. Can you please click it and download the report? That should give you more information on issue you experience. Also check if you not use any of "denied" members in your report - docs.microsoft.com/.../rdl-sandboxing

  • NKaur Profile Picture
    17 on at

    No nothing from the Denied list is being used. The log file is too big to be attached. But the Message is:

    Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]

    Message: The report server has RDLSandboxing enabled and the report contains custom code. Remove the Code element from the report definition.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Ok, what do you have in "Code" element? Can you please post it here?

  • NKaur Profile Picture
    17 on at

    This is what I have in my Custom Code:

    Function GetPurchaseItemLine_itemRefForVendorPOs(JobType As String, Service As String) As String

    If Service.Contains("Back Translate") And JobType = "Life Sciences" Then Return "Back Translate - LST (P)"

    If Service.Contains("Back Translate") And JobType = "Linguistic Validation" Then Return "Back Translate - LV (P)"

    If Service.Contains("Edit") And JobType = "Life Sciences" Then Return "Edit - LST (P)"

    If Service.Contains("Edit") And JobType = "Linguistic Validation" Then Return "Edit - LV (P)"

    If Service.Contains("Interpret") And JobType = "Life Sciences" Then Return "Interpret - LST (P)"

    If Service.Contains("Interpret") And JobType = "Linguistic Validation" Then Return "Interpret - LV (P)"

    If Service.Contains("Linguistic Proofread") And JobType = "Life Sciences" Then Return "Linguistic Proofread - LST (P)"

    If Service.Contains("Linguistic Proofread") And JobType = "Linguistic Validation" Then Return "Linguistic Proofread - LV (P)"

    If Service.Contains("Rekey") And JobType = "Life Sciences" Then Return "Rekey - LST (P)"

    Return Service

    End Function

    Ad I am calling this in the Expression as:

    =Code.GetPurchaseItemLine_itemRefForVendorPOs(Fields!cti_jobtype.Value,Fields!serviceid.Value)

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Ok, I got it. If you want to deploy report to cloud you will have to remove this code and put it to the place (I believe it's a cell or so) and use it there. I'm really sorry but that's the only way at the moment.

  • NKaur Profile Picture
    17 on at

    Thanks. Do you know how I can use Like or Contains in a Switch statement? So I want to see that if Service contains Trans then display Translate in the report.

  • NKaur Profile Picture
    17 on at

    I figured that out. Thanks very much for your help!

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    I don't remember that I was implementing exactly your requirement and I haven't done reports for a while so I can't give you exact answer. My recommendation - start doing and you will achieve that.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans