Mon Mar 13, 2023 12:22 pm
Thank you for the reply. I did try out coding using the example given. One problem is that we already have a .pdf and it is already loaded with the state values (NY, NJ, MA, RI, etc) If we are given a value not found in the list, which is possible outside of this code, what would be the best option to check and disallow that value? Currently an error is thrown due to the value being processed not being in the item list from the dropdown, so we need to test for that and not allow it to process and just leave the dropdown empty. Let me know what you think. Thanks!
It also looks like the .pdf we are working with doesn't have a blank space as one of the dropdown entries. So we should probably test for that before we try and set the value. I just wanted to see if there was a way to test if a value we are trying to set is in the list of values before making the call to set it and having it fail due to that value not being in the dropdown. Here is the error we got:
Host app generates error, from DD
System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at Spire.Pdf.Widget.PdfChoiceWidgetFieldWidget.SetSelectedValue(String[] values)
at Tyler.TMS.Business.Reports.NYS19AReportHelper.ProcessDS870(GetEmployeesForNYS19A_Result emp) in D:\a\transportation-traversa\transportation-traversa\Source\Tyler.TMS\Tyler.TMS.Business\Reports\NYS19AReportHelper.cs:line 462
at Tyler.TMS.Business.Reports.NYS19AReportHelper.Process(IEnumerable1 employees, IEnumerable1 reportIds, Dictionary2 commonFields) in D:\a\transportation-traversa\transportation-traversa\Source\Tyler.TMS\Tyler.TMS.Business\Reports\NYS19AReportHelper.cs:line 175 at Tyler.TMS.Business.Reports.ReportManager.ExecuteStateReports(StateReportModel model) in D:\a\transportation-traversa\transportation-traversa\Source\Tyler.TMS\Tyler.TMS.Business\Reports\ReportManager.cs:line 395 at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---