Skip to Content
avatar image
Former Member

Upgrade to SP 21 - Unable to cast to interface type ISCRReportSource

I installed SP 21 to provide Visual Studio 2017 compatibility. I followed the steps given in the wiki, removed existing Crystal Reports references, and then added them back in via References -> Extensions. All references now show as 13.0.3500.0.

Via C# I call ReportDocument.SetDataSource(IEnumerable). This throws the below exception:

Unable to cast COM object of type 'CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass' to interface type 'CrystalDecisions.ReportAppServer.Controllers.ISCRReportSource'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{31E7715A-8AD0-4D1C-958E-C1BE0A6F2D0C}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Any thoughts on what a solution might be? I have not had any luck as of yet.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Sep 14, 2017 at 08:00 PM

    Hi Nicolas,

    Yes we know, it unfortunately cannot be avoided due to platform updates. Removed dependency on VC 2005 C++ runtime and updated to newer/support Framework 4.7.

    If you read the New In SP21 Release on the download page it is noted there:

    2. Microsoft Windows Update KB2999226 is a prerequisite for SP21

    4. As most of CR/RAS .NET Assemblies are now re-versioned from 13.0.2000.0 to 13.0.3500.0, user MUST remove all old CR assemblies from Reference list and add the new version of CR assemblies, then rebuild the application.

    a. For those customer/user who do not wanted to rebuilt their application, there’s workaround to use <dependentAssembly> in app.config/web.config, please see attachment.

    I have not tested this in an older version of my test app's but there is a file attached that you can add to the same location as the exe is and it should work without having to rebuild your app.

    We do however recommend rebuilding because eventually MS will stop supporting and updating the older Frameworks which will force you to upgrade anyways. R&D will use the updated versions when fixing/adding things which may force you also.

    It's because MS no longer supports the VC 2005 C++ dependency, our compiler is now using VS 2015.

    Thanks again

    Don

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 12, 2017 at 09:46 PM

    Hi Beau,

    What data source are you using and DB Client driver?

    Don

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      We fill a List<T> from SQL Server using some sql queries, process that data, and then use the List<T> as the data source.

      var dataSource = new List<T>();
      //fill dataSource from SQL ...
      //process resulting data

      var reportDoc = new ReportDocument(); reportDoc.Load(<crystal file path>);
      reportDoc.SetDataSource(dataSource); //error occurs here
  • avatar image
    Former Member
    Sep 13, 2017 at 05:12 PM

    I finally managed to find the solution. Some crystal references were shown as 13.0.3500.0 but I didn't actually remove them and reinstall them all, only those that were showing as 13.0.3200.

    So I redid the whole procedure and removed all crystal references in all projects, re-added them, and it finally worked.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 13, 2017 at 02:53 PM

    I get the exact same exception when calling ReportDocument.PrintToPrinter

    We don't call SetDataSource here, we set ConnectionInfo and related settings to connect to our SQL Server.

    The issue arises after the print driver is initialized, as the print task appears queued in the spooler, and only then the exception is thrown, before any actual data is sent to the printer.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 13, 2017 at 05:26 PM

    This incompatibility between SP20 and SP21 will cause a lot of headaches in the development and upgrade cycles, as trying to run a binary created for SP20 on a machine where SP21 is installed will crash, and vice-versa.

    Add comment
    10|10000 characters needed characters exceeded

    • It's the price we pay for upgrading to current C++ supported binaries from Microsoft.

      You should be deploying the same version to all users anyways.