how to add items in existing combobox

Last post 04-19-2011, 9:48 AM by aspose.notifier. 12 replies.
Sort Posts: Previous Next
  •  10-05-2010, 9:05 AM 261984

    how to add items in existing combobox .NET

    Attachment: Present (inaccessible)
    we have PDFs which have ComboBoxes defined but they are empty. Give the sample code for populates the values[ add items ] in the existing ComboBox dynamically.



    gopi
    Filed under: aspose.pdf.Kit
     
  •  10-06-2010, 2:26 AM 262126 in reply to 261984

    Re: how to add items in existing combobox

    Hi Gopinath,

    You can add values to an existing ComboBox using AddListItem method of FormEditor class. You can use the following code snippet to add values:

    //create new object of FormEditor class
    FormEditor formEditor = new FormEditor("form.pdf", "output.pdf");
    //add new item with export value
    formEditor.AddListItem("combobox", new string[] { "First", "First" });
    formEditor.AddListItem("combobox", new string[] { "Second", "Second" });
    formEditor.AddListItem("combobox", new string[] { "Third", "Third" });
    formEditor.AddListItem("combobox", new string[] { "Fourth", "Fourth" });
    //save output PDF file
    formEditor.Save();

    I hope this helps. If you have any further questions, please do let us know.
    Regards,

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  10-06-2010, 4:35 AM 262148 in reply to 262126

    Re: how to add items in existing combobox .NET

    Thanks for your reply. In output of pdf file, added items are  not effected in combobox. Is there any file attributes i need set?

    my code is,

     Response.ContentType = "application/pdf";
                    string templatePdf = Server.MapPath(@"\Xml\Input.pdf");
                    string templatePdfOutput = Server.MapPath(@"\Xml\Output.pdf");

                    FormEditor formEditor = new FormEditor(templatePdf, templatePdfOutput);
                   
                    formEditor.AddListItem("AccountCurrency", new string[] { "0", "000000000" });
                    formEditor.AddListItem("AccountCurrency", new string[] { "1", "111111111" });
                    formEditor.AddListItem("AccountCurrency", new string[] { "2", "222222222" });
                    formEditor.AddListItem("AccountCurrency", new string[] { "3", "333333333" });
                    formEditor.Save();
    Response.AppendHeader("Content-disposition", "attachment; filename=RequestForm.pdf");
                    Response.WriteFile(templatePdfOutput);
                    Response.Flush();
                    Response.End();

    gopi
    Filed under: Aspose.Pdf.Kit
     
  •  10-06-2010, 12:30 PM 262211 in reply to 262148

    Re: how to add items in existing combobox

    Hi Gopinath,

    I have also tried to test this issue at my end and couldn't fill the field. I have logged this issue as PDFKITNET-20588 in our issue tracking system for further investigation by our development team. Please spare us some time and we'll update you via this forum thread once this issue is resolved.

    We're sorry for the inconvenience.
    Regards,

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  01-31-2011, 3:45 PM 282098 in reply to 262211

    Re: how to add items in existing combobox

    Is there any additional information regarding this issue?  I have an XFA form and we can not fill the drop down list.
     
  •  02-01-2011, 5:22 AM 282206 in reply to 282098

    Re: how to add items in existing combobox

    Hi David,

    Please share the input PDF file with us, so we could test the issue at our end. You'll be updated with the results accordingly.

    We're sorry for the inconvenience.
    Regards,

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  02-03-2011, 9:30 AM 282798 in reply to 282206

    Re: how to add items in existing combobox

    I have found a way to add items to a drop down but I can't add Value/Text combination only text.  Is this possible and how?

    Thanks
     
  •  02-04-2011, 1:15 AM 282935 in reply to 282798

    Re: how to add items in existing combobox

    Hi David,

    You may try this overload of AddListItem which allows you to specify label and export value for the combobox field.

    I hope this helps. If you have any further questions, please do let us know.
    Regards,

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  02-08-2011, 1:39 PM 284005 in reply to 282935

    Re: how to add items in existing combobox

    I could not get this working.  the code I am using for a test is:

    string[] vals = new string[] { "xxx", "val 1" };
    frmEditor1.AddListItem("topmostSubform[0].TopSixSectionSub[0].LeftColumn[0].ChildInfoSub[0].student_grade[0]", vals);

    When I use just an export value it works as expected but there is no Label/Export Value pair.  When I use the code above it executed but no changes are made to the form.  I am using a Dynamic XFA form.  Is my code incorrect or is there a work-around?
     
  •  02-09-2011, 12:15 AM 284177 in reply to 284005

    Re: how to add items in existing combobox

    Hi David,

    Please share the input PDF file with us, so we could test and reproduce the same issue at our end. You'll be updated with the results accordingly.

    We're sorry for the inconvenience.
    Regards,

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  02-09-2011, 7:49 AM 284311 in reply to 284177

    Re: how to add items in existing combobox

    Attachment: Present (inaccessible)
    Here is the file I am testing with.

    Thanks,
     
  •  02-10-2011, 4:20 AM 284723 in reply to 284311

    Re: how to add items in existing combobox

    Hi David,

    I have reproduced this problem at my end and logged it as PDFKITNET-24360 in our issue tracking system. Our team will look into this issue and you'll be updated via this forum thread once it is resolved.

    We're sorry for the inconvenience.
    Regards,

    Shahzad Latif - [Follow me on Twitter!]
    Support Developer/Developer Evangelist
    Aspose Sialkot Team
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  04-19-2011, 9:48 AM 298058 in reply to 261984

    Re: how to add items in existing combobox

    The issues you have found earlier (filed as 20588) have been fixed in this update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.
     
View as RSS news feed in XML