Skip to Content

XML Web Service Data Source Error in SP21 - Empty String

Hello,

We recently upgraded to SP21 (on Windows 10 / Windows Server 2012) and since then a number of our reports have stopped working. We are using crdb_xml.dll version 13.0.21.2533. Since upgrading, there seems to be an issue with empty strings not being accepted in fields on a report. The error we get:

Visual Studio Main Report Preview: Failed to retrieve data from the database. Details: XML field value is invalid - empty String

Runtime: Failed to retrieve data from the database.

If I create a test report and add a field where all values are present, the report works. If I add an additional field that may not always contain a value, I receive the above error. If I delete the field and re-run, it works.

Note that in my XSD for the data source every field has the attribute nillable=true. For example:

<xsd:element type="xsd:double" name="SIR_Tot_dose_Cispl" minOccurs="0" nillable="true"/>

None of the reports have changed, but I now consistently get this error after upgrading to SP21 and VS2017.

Any ideas? Has something changed in SP21 where I need to give other attribute information in the XSD response? Is there a registry setting I'm missing when I installed SP21?

Thanks,

Rick

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Nov 24, 2017 at 03:19 PM

    Hi Guys,

    R&D replied indicating due to W3C Standards this is why it changed, someone else pointed out that we were not following the standards and it broke their xml data sources.

    From DEV:

    "Yes, We change the logic to treat null values.

    In the previous release, all the ‘’ values are treated as null data.

    We changed the logic to follow W3C standard -- return empty string for <A></A>, and return null for </A xsi::nil=’TRUE’>

    It doesn’t make sense that CR could handle both valid and invalid XML."

    So what you need to do is add that tag to the XML file -

    xsi:nil="TRUE"

    Then your XML will work, we can't change it back now.

    Use Google and search for this KBA to get more details:

    2567826 - Failed to retrieve data from the database. Details: XML field value is invalid empty string using CR for VS WEB Service XML driver

    Thanks again

    Don

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 16, 2017 at 03:36 PM

    Hi Rick,

    I suspect that since the legacy CRDB_XML.dll still relies on the old VC 2005 C++ runtime you will need to add the LegacyMode back into the app.config file in your project. That driver will not be updated, we've deprecated it a long time ago, it's "as is"... It took time for me to get them to release that driver in a separate package, I doubt I'll be able to convince them to update it.

    I suggest you move to ADO.NET and use it's XML driver, there are differences but it will be fully supported in the VS 2017 and 3.5 Framework and above.

    I'll ping DEV and see if they know about this.

    Thanks again

    Don

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 24, 2017 at 06:20 PM

    Hi Rich,

    Thank you for the info. I can duplicate it now but need to test this in CR Designer and due to Proxy issues I need to find out how to get around it.

    It does appear to be an migration issue so by end of day I may escalate to DEV.

    With the Framework update it may be the cause.

    On the Download page there is a XML file you can put into your app folder that reverts the SDK back to SP 20. See if that works for you?

    Don

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 20, 2017 at 04:07 PM

    Hi Rick,

    Correct, we do version checking so you can't mix them.

    This issue appears to have been reported by one of our Support Customers and it will be fixed in CR Designer 2016 SP 5.

    According to the SAP Note the Developer fixed it in SP 21 but I believe this is a typo and they meant to note SP 22.

    So I'm going to install SP 22 build 2515 and see if it works, I've asked DEV to verify it was in SP 21 or a typo.

    I'll let you know if it is fixed in SP 22, if not I'll get them to test and get it into SP 22 for sure.

    Thanks again

    Don

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rick,

      I found an this SAP Note - 2445274 - Empty String interpreted as NULL when reporting off an XML file using the XML and Web Services driver in Crystal Reports

      Tested it in latest SP 22 and it still failed, I asked the Developer to test using your link as well and it failed for them also. It fails in SP 21 and CR 2013 SP 11.

      It appears it was only fixed for specific versions....

      They are looking into it and it should be fixed in SP 22.

      New KBA for this issue -

      2567826 - Failed to retrieve data from the database. Details: XML field value is invalid empty string using CR for VS WEB Service XML driver

      Thanks again

      Don

  • Nov 22, 2017 at 02:37 PM

    Hi Guys,

    R&D had a look at it and it could be due to the XML source.

    If you change/add the xsi:nil="TRUE" it should start working.

    Discussing with Dev more more info on why the change and if the change was due to XML Standards.

    <?xml version="1.0"?>

    <NewDataSet>

    <data>

    <numb1>1</numb1><str1 xsi:nil="TRUE" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><RecordTruncated>False</RecordTruncated>

    </data>

    <data>

    <numb1>2</numb1><str1></str1><RecordTruncated>False</RecordTruncated>

    </data>

    <data>

    <numb1>3</numb1><RecordTruncated>False</RecordTruncated>

    </data>

    </NewDataSet>

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Don,

      Thanks again for all of your help. We made the changes to our web service and now all seems to be working with SP 21. Hopefully this will remain stable now!

      Best regards,

      Rick