[OfficeUtils] Having error on Excel_Export_GenerateFile

Forge Component
(28)
Published on 2 Apr (6 days ago) by Bruno Gonçalves
28 votes
Published on 2 Apr (6 days ago) by Bruno Gonçalves

When I try to generate a report,It keeps on having this error.


Attempt by security transparent method 'NPOI.OpenXml4Net.OPC.ZipPackage..ctor(System.IO.Stream, NPOI.OpenXml4Net.OPC.PackageAccess)'
to access security critical method 'ICSharpCode.SharpZipLib.Zip.ZipInputStream..ctor(System.IO.Stream)' failed. Assembly 'NPOI.OpenXml4Net,
Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the
level 2 security transparency model.Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default,
which may be the cause of this exception.

Hi Patrick Robles,

I believe that your error is related with the library version of SharpZipLib.

On the OutSystems Platform Server version 11.7.2 it has been upgraded.

So if your server version is lower then 11.7.2 you should use OfficeUtils version 4.0.1.

If it is 11.7.2 or higher you should use OfficeUtils version 5.0.


Best regards,

Elena