Search code examples
c#.netwindowscrystal-reportswindows-store-apps

C# Windows Store App How To Call Method of Windows Forms Project


I've created a Windows Store App that's running on a tablet that has Windows 8.1 as it's operating system. This app needs to print reports so I've created a report using Crystal Reports For Visual Studio. Because the Windows Store App and Windows Forms projects are on two different frameworks within the same solution, I've not been able to reference each project directly like I would in a normal solution.

I have managed to pass values between the Windows Store App project and Windows Forms project by using a Portable Class Library... but now the problem I am hitting is how to call a method that prints the report from Windows Store to the report located in Windows Forms?

I've tried referencing the Portable Class Library from my Windows Forms project but I get a circular dependency exception... which makes sense. I've further tried creating another Portable Class Library to call the Windows Forms method... but apparently Portable Class Libraries can only reference other Portable Class Libraries.

Surely their has to be a way to do this? Any suggestions would be greatly appreciated!


Solution

  • Windows Store App in C# and Windows Form Application use different .NET Framework, so you can not reference a Windows Form project in Windows Store App project. Portable Class Libraries could not resolve the communication problem between 2 types of project. The possible solution is using the communication framework like WCF.