Populating a PDF form from database

I have asked this question here several times, but never get any replies. In fact my questions seem to be The Only ones that don't get a reply, which makes me think no one actually knows how to do this or my question is so remedial that no one is bothering. I'll try one more time.
/prays someone takes pity...
I have created a form that contains a subform with 4 text fields. The fields are read only and the form will be used only for printing. I have also connected to my Oracle database successfully and can populate the fields with data. My problem is I only get the first record. I have the subform set to repeat the data but am having no luck accomplishing this. I always just get the first record. Any suggestions would be more than appreciated as I have been fighting this for about a week now.
Thanks for any help.

Dear Robert,
Please first make sure that your form is dynamic, I mean, just create an Add button that clicking on it you will be able to create more rows. (there are many examples in the forum)
Once you got it you will have to create a function like this, please note that I have copied an pasted them without changing the objects, maybe you will need to change some of them, be careful
function populateDB()
var sDataConnectionName = "Oracle"; // name of the data connection to get the data from. Note the data connection will appear in the Data View.
// Search for sourceSet node which matchs the DataConnection name
var nIndex = 0;
while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)
nIndex++;
var oDB = xfa.sourceSet.nodes.item(nIndex);
oDB.open();
oDB.first();
// Search node with the class name "command"
var nDBIndex = 0;
while(oDB.nodes.item(nDBIndex).className != "command")
nDBIndex++;
// Backup the original settings before assigning BOF and EOF to stay
var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");
var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF", "bofAction");
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF", "eofAction");
// Search for the record node with the matching Data Connection name
nIndex = 0;
while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)
nIndex++;
var oRecord = xfa.record.nodes.item(nIndex);
// Find the node representing the columns in the table
var oCol1Node = null;
var oCol2Node = null;
var oCol3Node = null;
for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)
if(oRecord.nodes.item(nColIndex).name == "C1") // column 1
//app.alert(oRecord.nodes.item(nColIndex))
oCol1Node = oRecord.nodes.item(nColIndex);
else
if(oRecord.nodes.item(nColIndex).name == "C2") // column 2
oCol2Node = oRecord.nodes.item(nColIndex);
else
if(oRecord.nodes.item(nColIndex).name == "C3") // column 3
//app.alert(oRecord.nodes.item(nColIndex))
oCol3Node = oRecord.nodes.item(nColIndex);
var secuencial;
var secuencial_ant;
var oNewRow;
secuencial_ant = 0;
while(!oDB.isEOF())
// create new row in Table1
if (oCol3Node.value != secuencial_ant)
oNewRow = xfa.form.Formulario1.Linea_detalle.Bordes.Campos.instanceManager.addInstance(false);
app.alert(oCol1Node.value);
app.alert(oCol2Node.value);
app.alert(oCol3Node.value);
rellenaCampo(oCol1Node.value ,oCol2Node.value);
secuencial_ant = oCol3Node.value;
oDB.next();
// Restore the original settings
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, "bofAction");
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, "eofAction");
// Close connection
oDB.close();
function rellenaCampo(NombreCampo, ValorCampo)
var obj = xfa.form.resolveNode(NombreCampo);
if (obj != null)
obj.rawValue = ValorCampo;
Its read an Oracle DB table named T1 with three colums, name of the field, value and position into the list of fields (row 0, row 1, etc).
The second function just fill the field, the parameters are FieldName and FieldValue.
This codes are from the forum, I had your same problem and searching in it I founded it.
BR

Similar Messages

  • Populating a pdf form from a database

    There seems to be a lot of information on the forum that skirts around this problem, but so far everything I've tried falls short.
    <br />
    <br />I have a pdf form that can be filled out via a browser (the web server is Win2k and IIS.
    <br />
    <br />I can fill out this form and use an http submit button to send it to a .asp url where a vbscript program captures the data and creates a record in a sql server table.
    <br />
    <br />What I want to be able to do is call up that pdf form and populate it with the data from a specific record from the table - again using .asp and vbscript. The following code brings up the form, but does not fill in the fields. Is what I want to do possible and if so can someone help?
    <br />
    <br />Thanks.
    <br />
    <br />Dave Space
    <br />
    <br /><%@ LANGUAGE = VBScript%>
    <br />
    <!--#include virtual="/Common/adovbs.inc"-->
    <br /><%<br />On Error Resume Next<br />TableName = Request.Form("TableName")<br />Set Conn = Server.CreateObject("ADODB.Connection")<br />Conn.Open "Database=fff;DSN=fff;UID=myuid;Password=mypass"<br />Set RS = Server.CreateObject("ADODB.Recordset")<br />RS.CursorLocation = adUseServer<br />RS.CursorType = adOpenKeyset<br />RS.LockType = adLockOptimistic<br />RS.Open "Select * from iacuc where id = 4", Conn, , , adCmdText<br />Response.ContentType = "application/vnd.adobe.xdp+xml" <br />Response.Write "<?xml version=""1.0"" encoding=""UTF-8""?>" <br />Response.Write "<?xfa generator=""XFA2_0"" APIVersion=""2.2.5028.0""?>" <br />Response.Write "<xdp:xdp xmlns:xdp=""http://ns.adobe.com/xdp/"">" <br />Response.Write "<xfa:datasets xmlns:xfa=""http://www.xfa.org/schema/xfa-data/1.0/"">" <br />Response.Write "<xfa:data>" <br />Response.Write "<form1>" <br />For Each item in RS.Fields<br /> If InStr("IPADDR ID", uCase(item.name)) = 0 Then<br />  Response.Write("<"&item.name&">"&item.value&"</"&item.name&">")<br /> End If<br />Next<br />RS.Close<br />set RS = nothing<br />Conn.Close<br />Set Conn = Nothing<br />Response.Write "</form1>" <br />Response.Write "</xfa:data>" <br />Response.Write "</xfa:datasets>" <br />Response.Write "<pdf href=""http://aaa.bbb.edu/pdf_forms/aaa.pdf"" xmlns=""http://ns.adobe.com/xdp/pdf/"" />" <br />Response.Write "</xdp:xdp>" <br />Response.Flush <br />Response.End <br />%>

    David,<br /><br />Can you try to loop through your recordset before doing any of the Response.Write(). Save the the output in a string called "mystring" and output it at the end? So it would look something like this:<br /><br />Response.ContentType = "application/vnd.adobe.xdp+xml" <br />Response.Write "<?xml version=""1.0"" encoding=""UTF-8""?>" <br />Response.Write "<?xfa generator=""XFA2_0"" APIVersion=""2.2.5028.0""?>" <br />Response.Write "<xdp:xdp xmlns:xdp=""http://ns.adobe.com/xdp/"">" <br />Response.Write "<xfa:datasets xmlns:xfa=""http://www.xfa.org/schema/xfa-data/1.0/"">" <br />Response.Write "<xfa:data>" <br />Response.Write "<form1>" <br />Response.Write(mystring)<br />Response.Write "</form1>" <br />Response.Write "</xfa:data>" <br />Response.Write "</xfa:datasets>" <br />Response.Write "<pdf href=""http://aaa.bbb.edu/pdf_forms/aaa.pdf"" xmlns=""http://ns.adobe.com/xdp/pdf/"" />" <br />Response.Write "</xdp:xdp>" <br />Response.Flush <br />Response.End <br />%><br /><br />Can you tell me what is your "mystring" look like? See if you get a different result?

  • Populating a PDF form with database data

    I would love to know how (if possible) to populate an Adobe PDF form with data pulled from an Access database.
    Background
    I have a registration form already created using Adobe LiveCycle which is used by people to fill in their details.  With a built-in xml schema, the user saves the form and sends them to me.  I extract the data into an xml document which I can then import in an Access database using VBA code.
    The Need
    When it comes time to re-register, much of the original data provided by the user has not changed.  Rather than ask them to fill out the form all over again, I would like to send them their original data and they can update whichever fields they need to.  With the xml schema built into the form, I would love to turn this form into a two-way avenue for both importing and exporting data.  Is this possible?
    Any assistance in this matter would be greatly appreciated.  Please let me know if I have not provided enough information.
    Brett

    You can connect the form to the DB using anODBC connection. This functionality comes as part of Acrobat but the form must be Reader Extended by the full LiveCycle Server version of Reader Extension to allow this in Reader. In your case, if your system is the only on ethat will interact with the DB then this might be a viable solution (but you woudl have to use Acrobat). This solution woudl involve create an ODBC connection in your system then configuring the form to make use of that connection.
    Does that make sense?
    Paul

  • Fill pdf form from database table

    I am working on small application for my employer. We have record fo all new employee in table and want to fill PDF (I-9) from database using APEX application.
    Below PDF form, we want to fill from database table.
    http://www.uscis.gov/files/form/I-9.pdf
    I am not sure how to take from APEX. Any ideas?
    I know one way to export from database table and import to PDF form.
    Is there any other way?
    Thanks

    If I understand you correctly then I need to first export the xml file using Data-> Load sample XML data and later create template in template.rtf and upload data using APEX in template. In this case I need to create rtf template exactly similar to http://www.uscis.gov/files/form/I-9.pdf.
    I am not sure is there any way to to used existing pdf template or save pdf template to rtf template. Later that template can be used to populate data using APEX.

  • Dynamically populating a dropdown list in a pdf form from a datasource

    Is there a way to populate a dropdown list in a pdf form from a datasource, specifically from an Access database table or query, using LiveCycle Designer. I am easily able to do this using cfselect in Coldfusion, however, cannot seem to figure it out for pdf forms. I am aware of the Show Dynamic Properties option enabled in LiveCycle Designer, and then binding to a datasource. However, this seems limited as I am only able to select single columns from Access (currently using an Access database) tables, and a unable to select from queries like I do using cfselect in Coldfusion forms. Is this something that must be done with Java scripting? If so, is there any other way? I know nothing about scripting. Thanks

    Derrick,
    There is a sample posted at
    http://www.adobe.com/devnet/livecycle/articles/lc_designer_db_lookup_tip.pdf
    It was created for Designer 7.0 but it should function the same in later versions of Designer.
    Steve

  • I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically. Can some one out there help me?

    I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically.

    Update automatically under which circumstances, exactly?

  • Creating a PDF form from a docx or xlsx

    Hello,
    Pulling my hair out over here... Can you help me out?
    I am trying to create a PDF form from either a word or an excel file.
    When I choose File > Create > PDF Form, I get the dialouge box asking to use either a file or scan from paper. Choosing file, then hitting next shows the choice of current document or browse for file. I browse for file, find my docx file, but it shaded out. Docx or xlsx does not appear in the "show" drop down below, which suggests that this function doesn't support these formats. HUH?
    I have read & watched the tutorials linked below, both of which clearly say Word and Excel are supported.
    http://help.adobe.com/en_US/acrobat/pro/using/WSB3F26303-0F1D-494a-BC55-7BF7F6684B4D.html
    http://tv.adobe.com/watch/learn-acrobat-x/getting-started-creating-simple-forms/
    Then I noticed a difference in the create window from the video, to my version...
    The video says "(PDF, Word, Excel or other file format)":
    My pop-up says ONLY PDF:
    Whats going on?
    I am using:
    MAC OSX 10.7.4
    Office 2011 MAC
    Acrobat X Pro 10.1.3
    Only way I can create a Form from Word files is to first print it to PDF, then use the form wizard on the PDF file... Which seems to have POOR results in auto-recognizing fields.
    PLEASE HELP Adobe!
    Thanks.

    I just got Acrobat X for my mac, for a class.  I am SO frustrated.  Almost everything in the class focuses on PDFMaker options.   The 'save as adobe pdf' or save as pdf options have zero functionality.  So I now own PDF software that doesn't really function on a MAC, and have to go to a windows machine.  I keep reading that it is a Microsoft problem, but I don't know how that can be when the software I thought I bought is this fancy PDF software that converts everything!!
    I asked a tech today if there were 'any' adobe work-arounds for this and basically the answer is to save PDF with no attribute functionality.  Period.
    Wasted $$ for me

  • I created a pdf form from a Word doc with 9 pt aerial font formatting; the text on the pdf form is aerial 9 pt, but the fields are formatted in courier 12 pt - How do I reformat the font in the fields??

    I created a pdf form from a Word doc with 9 pt aerial font formatting; the text on the pdf form is aerial 9 pt, but the fields are formatted in courier 12 pt - How do I reformat the font in the fields??

    You can set up a temporary button (or link, bookmark, etc.) and add the following JavaScript action:
    // Mouse Up script for a temporary button (or bookmark, etc.)
    // Change the font and font size for all text fields in this document
    for (var i = 0; i < numFields; i += 1) {
        var f = getField(getNthFieldName(i));
        if (f.type === "text") {
            f.textFont = font.Helv;
            f.textSize = 9;
    It also sets the font size, but you can remove that line if you don't need to do that.

  • I need to add an attachment to a pdf form from the SBA it is OIC_TABS_NGPC_nl.pdf

    I need to add an attachment to a pdf form from the SBA it is OIC_TABS_NGPC_nl.pdf

    Do the people who made the form SAY you can add an attachment? If not, do not consider it. The form will probably be read by a computer, so it will only look in the form fields provided.

  • HT2506 I am trying to fill out a PDF form from an internet site, but when I go to print it, none of the content prints, only the header of the document.  Help!

    I am trying to fill out a PDF form from an internet site, but when I go to print it, none of the content prints, only the header of the document.  Help!

    Instead of printing it, try saving it as a pdf from the print menu, and then printing the pdf out.

  • When I try to open a PDF form from a site, my screen goes black.

    When I try to open a fillable PDF form from any web site my screen goes black and nothing further happens. I can use IE with success, but would prefer Firefox.

    You're welcome.
    Could you please click the "''Solved It''" button next to the post which solved the problem for you? This will help others searching for a solution to the same question.
    Thanks.

  • Fill out a pdf form from ADF application

    Hi
    I need to fill out a PDF form, from my ADF application and i want to know if exist a component or libarary to do this.
    i hope you can help me
    Regards.

    Hi,
    two options are:
    Oracle BI Publisher (by far best choice but needs to be licenced)
    http://www.oracle.com/technology/pub/articles/vohra-jdev-xmlpub.html
    Jasper Reports, Free but not as functional or easy to use as BIP
    http://jasperforge.org/projects/jasperreports
    Both products have Java API's which you can integrate with your application.
    Brenden

  • PDFMaker missing files issue with PDF Forms from Office 2007

    Hi,
    I have Adobe PDF 8.0 Pro installed  (full installation) and I upgraded office from 2003 to 2007 AND Windows from 2000 to XP Pro.
    I used to be able to create PDF Forms from an Excel document when using Office 2003.
    Now, when I choose to create a new form starting with an electronic document [from an Excel 2003 document (.xls)], I get this error message:
    "PDFMaker files are missing, would you like to repair?" (please image attached)
    I did the repair. Did not worked.
    I made sure the add-in in office was enabled. Did not worked.
    I un-installed Adobe 8.0 Pro and Adobe Reader 9.0 and re-installed only Adobe 8.0 Pro , thinking there was a problem there. Did not work.
    I googled for more answers, did not find anything else.
    I am able to "print as Adobe PDF", I can create normal PDF documents, but not the Forms.
    I used that option all the time for work. Can someone help me please?!!
    Thanks!
    Gwen

    Bill, it worked!!
    I updated to 8.1.6 and now I can use an electronic document to create a form.
    Thank you!
    I have another question: in the past, to enable Acrobat READER users to fill out a form and save it on their computer, all I had to do is "Enable Usage Rights in Adobe Reader" in the "advanced" menu of Acrobat Pro.
    I did just that but my colleagues who have Adobe Reader 9 cannot fill the form. It appears as a scanned PDF document to them.
    Any idea why?!
    Gwen

  • Read PDF form from email attachment

    Hope someone is able to help on this one...
    We are using a pdf form at work to gather some feedback and the user will be submitting the form via email...
    Using outlook 2003 I had a crack at writing a vba module to read the pdf form from the email attachment to update into an excel spreadsheet
    Is it possible to read pdf forms from the email attachment with outlook vba? Or does the attachment need to be saved to a directory first?
    I have in the past done a vba module to save the pdf form attachments to a directory and then using acrobat and it's in-built form data collection tool and exported as a csv, but this feedback form will be an ongoing thing that will be updated daily - and to minimise handling would like to run the outllook macro that reads straight from the email attachment instead of doing another 3 or so steps...
    Below is the snippet I am using - it's a mashup of different code I've found on the net
    Sub Feedback()
        On Error GoTo Feedback_err
        'Dim ns As NameSpace
        Dim objNS As NameSpace
        'Dim Inbox As MAPIFolder
        Dim objFolder As Outlook.MAPIFolder
        'Dim SubFolder As MAPIFolder
        Dim objExcel
        Dim oBook
        Dim oSheet
        Dim gApp As Acrobat.CAcroApp ' In Tools > References > Checked all Acrobat Libraries in VBA > Tools > References
        Dim pdDoc As Acrobat.CAcroPDDoc
        Dim jso As Object
        Dim Item As Object
        Dim Atmt As Attachment
        Dim filename As String
        'Dim i As Integer
        Dim myOrt As String ' Added 13/1/2010
        Set objApp = CreateObject("Outlook.Application")
        Set objNS = objApp.GetNamespace("MAPI")
        Set objFolder = objNS.PickFolder
    ' Check subfolder for messages and exit of none found
        If objFolder.Items.Count = 0 Then
        'If SubFolder.Items.Count = 0 Then
            MsgBox "There is no Feedback emails in this folder.", vbInformation, _
                   "Nothing Found"
            Exit Sub
        End If
    ' Check each message for attachments
        Set objExcel = CreateObject("Excel.Application")
        Set oBook = objExcel.Workbooks.Open("G:\Path\Filename.xls")
        Set oSheet = objExcel.Worksheets(1)
        oSheet.Range("A2").Select
        Set gApp = CreateObject("AcroExch.App") ' make acrobat session
        Set pdDoc = CreateObject("AcroExch.PDDoc")
        Set jso = pdDoc.GetJSObject ' set the Javascript object via this way we can fill in the PDF document fields
        For Each Item In objFolder.Items
            For Each Atmt In Item.Attachments
                If Right(Atmt.filename, 3) = "pdf" Then
                    Do
                    If IsEmpty(objExcel.ActiveCell) = False Then
                        objExcel.ActiveCell.Offset(1, 0).Select
                    End If
                    Loop Until IsEmpty(objExcel.ActiveCell) = True
                        objExcel.ActiveCell.value = jso.getField("CurrentDocDate").value
                        objExcel.ActiveCell.Offset(0, 1).value = Item.Session.CurrentUser
                        objExcel.ActiveCell.Offset(0, 2).value = jso.getField("txtJobNo").value
                        objExcel.ActiveCell.Offset(0, 3).value = jso.getField("rbStatus").value
                        objExcel.ActiveCell.Offset(0, 4).value = jso.getField("rbFeedback").value
                        objExcel.ActiveCell.Offset(0, 5).value = jso.getField("txtComments").value
                End If
            Next Atmt
        Next Item
        oBook.Save
        objExcel.Quit
    Feedback_exit:
        Set Atmt = Nothing
        Set Item = Nothing
        Set objNS = Nothing
        Set pdDoc = Nothing
        Set objExcel = Nothing
        Set jso = Nothing
        Exit Sub
    ' Handle Errors
    Feedback_err:
        MsgBox "An unexpected error has occurred." _
            & vbCrLf & "Please note and report the following information." _
            & vbCrLf & "Macro Name: Feedback" _
            & vbCrLf & "Error Number: " & Err.Number _
            & vbCrLf & "Error Description: " & Err.Description _
            , vbCritical, "Error!"
    Resume Feedback_exit
    End Sub
    I get a vba error 91 "Object Variable or With  block variable not set"
    Cheers
    Ben

    hi Phani,
    with regard to your problem I would suggest you to please go thru this link.
    Hope this would be helpful to you.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/offline%20interactive%20pdf%20form%20using%20e-mail.pdf
    Thanks,
    kris

  • Opening HCM PDF forms from UWL

    Dear Friends,
    I am working in an assignment which involves the following
    Portal version 7.01 SP3
    HCM Process and Forms
    ESS and MSS
    UWL
    I am doing the following steps
    1. logged in as a manager
    2.Go to Team
    3. Initiated the 'start process' to change the work timings for an employee
    4.Change the timings in the presented PDF form
    5.Send the form
    6. logged in as HR Admin
    7. Able to see the work item in the UWL inbox
    8. On clicking the from the UWL inbox portal does not open the submitted PDF form, rather opens start process.
    May I request you to help me in opening the PDF form from the UWL, please.
    Regards,
    Tarani

    Hi Terani,
    We are also facing the same issue with HCM forms in Portal. So could you please update how did you resolve this issue.
    Thanks,
    Naveen Kumar

Maybe you are looking for

  • Time Capsule & iTunes

    Hi, I just purchased a 2TB time capsule and a MB Air and I am having some issues. I plan on using the TC as backup and also wanted to park my music there to share with the rest of the family since I can not host the files on my 128gb drive The backup

  • PDF XChange annotations are not saving (temp folder problem?)

    Hello, I'm having a problem with the XChange PDF viewer within Firefox: When annotating a file outside of Firefox, I can save the changes and have them reappear when I close and re-open the file Doing this inside Firefox, I cannot, it appears that th

  • Check for Duplicate Credie Memos

    Hi , We have set up the Duplicate invoice check for our company code. Also, in the vendor master we have the " Chk. duplicate invoice " activated. This should check both the invoices and credit memos for duplicate entries. However, the same is not wo

  • Change email address on iphotos ?

    How do I update a photo ferom iPhotos to email the photo? I want to update to my current email, not an old problematic email. MDB

  • AirPrint works but it prints photos too small

    AirPrint can find my Epson Artisan 810 and it prints photos but somehow it prints them very small. 4 x 6 photo is printed in 1.5 x 2.5 dimensions. I do not know how I can fix this.