Docentric Support for Xamarin Forms

0
danvonfeldt posted this 19 April 2022

Is there a docentric nuget package that supports Xamarin forms for mobile development?

29 Posts
29 Points
6 Comments
Order By: Standard | Newest | Votes
0
jles posted this 20 April 2022

Hi Dan,

Docentric Toolkit report engine is built targeting .NET Framework 3.5 (or higher) and .NET Standard 2.0. Just reference the Nuget package from your Xamarin project: https://www.nuget.org/packages/DocentricToolkitEngine/

Also see this: https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/net-standard?tabs=windows

Best regards, Jure

Last edited 20 April 2022

155 Posts
295 Points
0
danvonfeldt posted this 20 April 2022

Unfortunately I was unable to reference the Toolkit Engine DLL from a Xamarin project. The reference to Docentric.OpenXml has some Windows platform-dependent APIs from System.Drawing and System.IO.Packaging. Let me know if I am missing something. Thank You.

29 Posts
29 Points
0
jles posted this 21 April 2022

Thank you for the input. We will investigate and be back to you soon.

Regards, Jure

155 Posts
295 Points
0
jles posted this 22 April 2022

Hi Dan,

Could you please tell me exactly which Xamarin project exactly would you like to incorporate Docentric Engine into? Also, could you also share the error you are experiencing. Does the error occur when you try to add the Docentric nuget package, or during a build operation?

Thanks, Jure

155 Posts
295 Points
0
danvonfeldt posted this 22 April 2022

Hi Jure, === Mono Framework MDK === Runtime: Mono 6.12.0.174 (2020-02/adf1bc4335d) (64-bit) Package version: 612000174

=== NuGet === Version: 5.9.0.7134

=== Xamarin.Android === Version: 12.2.4.3 (Visual Studio Professional) SDK Tools Version: 26.1.1 SDK Platform Tools Version: 30.0.4 SDK Build Tools Version: 30.0.2

=== Xamarin.iOS === Version: 15.8.0.3 (Visual Studio Professional) Branch: xcode13.3

=== Xamarin.Forms === Version: 5.0.0.2196

The error happens during a build operation: iOS: MTOUCH: Error MT2002: Failed to resolve assembly: 'Docentric.OpenXml, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c2a1f9cfb4f15acd' (MT2002)

Android: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Legacy.targets(5,5): Error XA2002: Can not resolve reference: Docentric.OpenXml, referenced by Docentric.Documents. Please add a NuGet package or assembly reference for Docentric.OpenXml, or remove the reference to Docentric.Documents. (XA2002)

Also possibly of note: I need to manually add package SixLabors.ImageSharp (2.1.0). If I don't, the build will end with an error similar to those above except it will say that SixLabors.ImageSharp is referenced by Docentric.Documents and cannot be found. I've also added a reference to package Microsoft.Windows.Compatibility (6.0) but that did not resolve the issue.

Thanks

29 Posts
29 Points
0
jles posted this 25 April 2022

Hi Dan,

We were able to reproduce the issue in our environment. After studying the problem, we figured out that Xamarin has its own rules sometimes and it seems that the Xamarin compiler requires all dependencies present as normal references. The problem with the Docentric.Documents assembly is that it has merged the two assemblies into it and this is what the Xamarin compiler doesn't want. At the moment, there is nothing we can do because we would need to make huge changes.

Still, the next major version of Docentric v7.0 has been reworked so that it doesn't have any embedded assemblies in the output assembly. This release is scheduled for later this year, most probably somewhere 2022 Q3/Q4.

Let me know if you would like to know more.

Best regards, Jure

155 Posts
295 Points

Our 229036 members have posted 345 times in 102 discussions