I've this code below:
ComboBoxField wt1NameNumber = (ComboBoxField)doc.Form["frmMain[0].Page1[0].WT1NameNumber[0]"];ComboBoxField wt2NameNumber = (ComboBoxField)doc.Form[“frmMain[0].Page1[0].WT2NameNumber[0]”];
ComboBoxField wt3NameNumber = (ComboBoxField)doc.Form[“frmMain[0].Page1[0].WT3NameNumber[0]”];
ComboBoxField wt4NameNumber = (ComboBoxField)doc.Form[“frmMain[0].Page1[0].WT4NameNumber[0]”];foreach (Employee emp in employees)
{
wt1NameNumber.AddOption(emp.Id.ToString(), emp.FullNameNumber);
wt2NameNumber.AddOption(emp.Id.ToString(), emp.FullNameNumber);
wt3NameNumber.AddOption(emp.Id.ToString(), emp.FullNameNumber);
wt4NameNumber.AddOption(emp.Id.ToString(), emp.FullNameNumber);
}I’m getting “Object reference not set to an instance of an object.” when it hits >> wt1NameNumbere.AddOption(emp.Id.ToString(), emp.FullNameNumber);
I’ve checked that emp is not null, obviously employess is not null, emp.Id is not null, emp.FullNameNumber is not nullStack Trace:at ..(String , String )
at Aspose.Pdf.InteractiveFeatures.Forms.OptionCollection.(String , String )
at Aspose.Pdf.InteractiveFeatures.Forms.ChoiceField.AddOption(String export, String name)…