Posted 18 April 2024, 6:53 am EST
we are having an issue exporting to pdf using web api.
when we use the online version of the webapi project, it works fine.
however, when we use this same format for our project or even the sample web api project included in the componentonecontrolpanel downloads
…/$report/export?exportOptions.format=pdf
the export fails with this error:
An error has occurred.
Method not found: ‘Void C1.Win.C1Document.Export.PdfSecurityOptions.set_EncryptionType(C1.C1Pdf.PdfEncryptionType)’.
System.MissingMethodException
at #Cjt.#Zjt.CreateExportFilter() at C1.Web.Api.Document.Models.ExportFilterOptions.ToExportFilter(String tempFolder) at C1.Web.Api.Document.DocumentRequestContext
1.GetExportFilter(ExportFilterOptions options) at C1.Web.Api.Report.ReportController.#Tyb.#Kmt() at C1.Web.Api.C1ApiController.ProcessAction(Func
1 func) at lambda_method(Closure , Object , Object ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_0.b__2(Object instance, Object methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.d__5.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ExceptionFilterResult.d__6.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Controllers.ExceptionFilterResult.d__6.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__15.MoveNext()
the url used with sample project was this:
http://localhost:16410/api/report/ReportsRoot/DataManipulation/Parameters.flxr/parameters/$report/export?exportOptions.format=pdf
Note: if I change pdf to html in that url it DOES work.