Crystal Reports in WPF, which references do I need to add to my project?
In this software development game it can be hard to avoid developing reports, I haven’t had the need to use CrystalReports in many along year, but last year I had the misfortune of using Microsoft’s shoddy reporting services for a client and decided after that that I would try at all to avoid a repeat of the experience!
So here I am with SAP’s shiny Crystal Reports, so far so good, except for some slightly worrying bitness problems, I am developing on Windows 7 64bit targeting x86 and found that I _sometimes_ had to set my project’s build target to x86 (from AnyCPU) to avoid getting exceptions thrown like this:
. The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception .
With an inner exception like this:
. Retrieving the COM class factory for component with CLSID {4DB2E2BB-78E6-4AEA-BEFB-FDAAB610FD1B} failed due to the following error: 80040154 Class not registered... .
Anyway back to the point of the post:
Which references need to be included in my WPF project?
There are millions of them to choose from and I hate having to add them all if I know they are not all required, so here’s what I found that you need at a minimum:
. CrystalDecisions.CrystalReports.Engine CrystalDecisions.ReportSource CrystalDecisions.Shared SAPBusinessObjects.WPF.Viewer SAPBusinessObjects.WPF.ViewerShared .