Posted 30 April 2024, 7:08 pm EST
We have a system which generates three PDF files sequentially based on an INT parameter and a FlexReport template. I found through testing that it takes around eight seconds for the files to be generated and wanted to speed this up using tasks as the files are not interdependant.
After creating the tasks and testing I found an issue using RenderToFilter within a task as it would throw an error that the index could not contain the same key.
I found the RenderToFilterAsync method along with the Ex version, both of which get past the above error but then throw “System.InvalidOperationException: ‘Operation is not valid due to the current state of the object.’” The first task executes but then stalls when the second tries to complete.
This exception was originally thrown at this call stack:
C1.Win.C1Document.C1DocumentSource.a(C1.Win.C1Document.Export.ExportFilter)
C1.Win.C1Document.C1DocumentSource.ExportAsyncEx(C1.Win.C1Document.Export.ExportFilter)