locked
CRM 2013 - Reports - Alternative for Switch statements (Nested IIF is not working) RRS feed

  • Question

  • Hi,

    I'm trying to convert sql based ssrs reports to Fetchxml based reports to make it work in Online crm 2013. I've a problem with Switch statements used in the expressions of the report. As Switch is not supported in Online CRM report, I'm trying to change the expression accordingly with the IIF statements. In the BIDS, the result of the expression is exactly what is expected. But I'm not able to upload the RDL file into CRM. So I've started searching for the problem. I finally found, the problem is with the nested IIF statements.

    *Note, it worked if I have only one IIF condition.

    Below is the error I'm getting while uploading the report.

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.Detail: 
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147188072</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>An error occurred while trying to add the report to Microsoft Dynamics CRM. Try adding the report again. If this problem persists, contact your system administrator.</Message>
      <Timestamp>2014-11-24T09:47:22.6162745Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />
    </OrganizationServiceFault>

    Below is the expression, I've set in the expression.

    Can anyone help me on this please.

    Regards,

    Syai Reddy D


    Regards, Syai, Osmosys


    • Edited by Syai Monday, November 24, 2014 9:52 AM
    Monday, November 24, 2014 9:50 AM

Answers

  • Hi,

    I've verified the issue, and found the problem is not with the Nested IIF conditions. The issue is with the Deprecated functions/statements used in the IIF conditions. If we observe, in the query we found "DateAdd, DateSerial, etc.." These are specific to SQL which didn't work on CRM online 2013. So we've changed these conditions with its alternatives. Now it is working fine.

    Regards,

    Syai Reddy D


    Regards, Syai, Osmosys

    • Marked as answer by Syai Tuesday, November 25, 2014 7:16 AM
    Tuesday, November 25, 2014 7:16 AM