5 Replies Latest reply on Nov 11, 2007 8:53 AM by (Oliver_Harris)

    Creation a number of pdf files based on DB rows

    Level 1
      Hi ,

      I want to create a batch which will pull users data from a db.
      For each user after manipulating with his data insert it into a
      template form ,create pdf file and email it to him.
      I would like to hear your views what is the best way to implement it,
      where to store user details after pulling it from a db? Can I use the
      "query for multiple rows as xml" component , if so how do I traverse
      the records? and how I create pdf file after I updating my xfaForm variable(from this xml)??

      thanks ,
        • 1. Re: Creation a number of pdf files based on DB rows
          Jasmin Charbonneau Level 4
          I'll try to make is easy, but here are the steps that I think you'll have to follow.

          1- Get the user data from DB using "query for multiple rows as xml"
          2- Use a "Set Value" and get a specific record for a user (ex. /process_data/xmlVar/Users/User[number(/process_data/@index)] and store it in a temporary xml variable (tmpXML).
          3- put the tmpXML var into a "document" variable (tmpDoc) because that's what LiveCycle Forms RenderPDFForm expects for the data type.
          4- Call RenderPDFForm and pass the tmpDoc var to merge with your form template.
          5- Use the email service to send an email with the PDF
          6- Increment your counter and loop back to get the next record in the xmlVar and start again from 2.

          Jasmin
          • 2. Re: Creation a number of pdf files based on DB rows
            HowardTreisman Level 1
            Hi Oliver
            We have a component that will invoke a sub-process for each row it finds in a SQL statement. So you don't have to worry about looping. If you'd like to try this component, send an email to info@avoka.com

            Regards,
            howard
            • 3. Re: Creation a number of pdf files based on DB rows
              Level 1
              Hi, Jasmin.
              Thank you for reply. I still have a problem with RenderPDFForm service.
              Caused by: com.adobe.livecycle.formsservice.exception.RenderFormException: ContentRootURI not specified
              at com.adobe.formServer.FormServer.renderForm(FormServer.java:178)
              at com.adobe.formServer.FormServer.renderForm(FormServer.java:256)
              at com.adobe.formServer.docservice.FormsDocService.renderForm(FormsDocService.java:446)
              at com.adobe.formServer.docservice.FormsDocService.renderForm(FormsDocService.java:405)
              at com.adobe.formServer.docservice.FormsDocService.renderPDFForm(FormsDocService.java:109)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:181)

              It looks like a problem with my RenderPDFForm settings .
              In the Form to Render field I put my xfaForm variable(/process_data/myForm), and in the Form Data I put my tmpDoc variable(/process_data/@tmpDoc).
              Do you have any ideas??
              thanks a lot, Oliver
              • 4. Re: Creation a number of pdf files based on DB rows
                Jasmin Charbonneau Level 4
                In the RenderPDFForm service, make sure the ContentRootURI is set to repository://

                Jasmin
                • 5. Re: Creation a number of pdf files based on DB rows
                  Level 1
                  Thanks a lot ,Jasmin
                  it works.