2
votes

I have a visual studio solution that has several projects in it.

  • Solution
    • Domain Layer (Class Library > .Net Core 2.2)
      • Holds all the database models
    • EntityFramework (Class Library > .Net Core 2.2)
      • Holds all the interaction with the database. I reference Microsoft.EntityFrameworkCore and Oracle.EntityFrameworkCore
    • Presentation Layer (WPF Windows Application > .Net Core 3.1)
      • Is the main interaction for the application

I'm at the point where I need to integrate reporting and printing of reports. I've always used Crystal Reports for my applications (with good success). However, since Crystal requires Framework 4.5 I can't figure out how to make that work.

I've created my Reporting objects and tested them. They work great in their own standalone solution. Once I reference the Framework app in my Core app I break. In particular I break when I attempt to create a Crystal 'ReportDocument' object . I've seen all over SO (and tested) you can't mix a .Net Core with .Net Framework because of the different DLLs.

Any suggestions on how I can get reporting/printing to work? I'm not picky when it comes to Crystal Reports either.

2

2 Answers

4
votes

You are out of luck, because it is not supported. I would encourage you looking into other alternatives

From the Crystal Reports vendor website:

So update your Core Project to the full 4.7.1 and it should work. I just install 4.7.1 and it works for my existing ASP.NET project that was set to 4.0.

To be clear, Framework 2.0 Core is NOT supported

Source: Crystal Reports in ASP .NET Core 2.0

2
votes

How about you rethink your approach a bit. Do you really have to bundle everything to a single monolithic application?

Have you considered some separation of concern? What I'm trying to say is that you can abstract away your reporting service to a separate project/service and pass the data you need over let's say the wire - as an example.

Then you can build your application logic as you please. My line of though is:

  • sln

    • UI
    • API ?
    • Domain
    • Infra
  • sln

    • API (wcf/gRPC/REST)
    • reporting service

Also you might want to consider gRPC, it can probably integrate with your legacy code if you have any.