Skip to Content
0

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

Sep 12 at 02:10 PM

227

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Don Williams SAP Employee Moderator Sep 12 at 09:46 PM
1

Hi Beau,

What data source are you using and DB Client driver?

Don

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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
0
Nicolas Hatier 6 days ago
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Nicolas Hatier 6 days ago
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Nicolas Hatier 6 days ago
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Don Williams SAP Employee Moderator 5 days ago
0

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

Share
10 |10000 characters needed characters left characters exceeded