This methode allows to execute several SQL Objects and convert the query using FOP to generate the output in PDF, PCL, PS, XML.

1 fop.form.group

<fop.form.group
    temp='true|false'
    file='file'
    type='pdf|xml|pcl|ps'
>
    <fop.form
        code='code'
        cond='cond'
        rows='rows'
        din='A3|A4|A5|B5'
    > *
        <vars> ?
            <var name='name'> +
                <varvalue /> !
            </var>
        </vars>
    </fop.form>
    <fop.array> *
        <arr /> +
    </fop.array>
</fop.form.group>

Exceptions

required attribute 'code' not defined

The name of the SQL Object has not been specified.

required attribute 'cond' not defined

The condition of the SQL Object has not been specified.

insuficient query parameters (vars required ?)

The query of the SQL Object cannot be performed, for lack of consition (mandatory input fields) or input variables.

database required

The name of the database has not been informed.

user must be set for operations

The username has not been specified.

Exceptions

Each one of the tags <fop.form> must return the xml resulting of the execution of the form, Cada uno de los tags<fop.form> debe retornar el xml resultado de la ejecución del form, so you should indicate xml-string type.

Example

A simultaneous printing of an invoice and its corresponding delivery note are generated. The result is not stored in a file, but it is returned. For example, this can be used from a SQL object or from another XSQL-Script which collects the result.

Copy
<xsql-script name='fop_form'>
    <body>
        <set name='m_file'>
            <string>c:<file.separator />jas<file.separator />pepe.pdf</string>
        </set>
        <set name='p_docser'>FC-000026</set>
        <!-- =========================================================================== -->
        <!--                                                                             -->
        <!--     Selection condition of the delivery notes associated to the invoice     -->
        <!--                                                                             -->
        <!-- =========================================================================== -->
        <set name='m_sqlcond'><string>
           <string>
           gcomalbh.cabid IN (SELECT cabid
                                FROM gcomalbl
                               WHERE linid IN (SELECT linori
                                                 FROM gcomfacl, gcomfach, gcomfacd
                                                WHERE gcomfacl.cabid  = gcomfach.cabid  AND
                                                       gcomfach.docser = '</string><p_docser /><string>' AND
                                                       gcomfach.tipdoc = gcomfacd.codigo AND
                                                       gcomfacd.tabori = 'TC'            AND
                                                       gcomfacl.linori IS NOT NULL))</string>
           </string>
        </set>
        <!-- ======================================================================== -->
        <!--  Create and link the PDFs                                                -->
        <!-- ======================================================================== -->
        <file.bytes.write>
            <file name='#m_file' type='absolute' />
            <fop.form.group type='pdf'>
               <fop.form code='gcomalbh_print' cond='#m_sqlcond' />
               <fop.form code='gcomfach_print' cond="docser='#p_docser'" />
            </fop.form.group>
        </file.bytes.write>
    </body>
</xsql-script>
Example

An array is used to pass as argument the '''FP''' documents in '''string''' format. This mode is useful for productions in which the number of documents to group is unknown.

Copy
<xsql-script name='fop_form'>
   <body>
       <array name='arr' />
       <foreach>
           <select prefix='cvenfach_'>
               <columns>facidx </columns>
               <from table='cvenfach' />
               <where>
                   fecfac > <mdy d='01' m='01' y='2010' />
               </where>
           </select>
           <do>
                <println>Genreating FOP document for cvenfach: <cvenfach_facidx /></println>
                <array.add name='arr'>
                    <fop.form   code='cvenfach' 
                                cond='cvenfach.facidx=${cvenfach_facidx}' 
                                type='xml-string' 
                                emit-blockid='false'/>
                </array.add> 
           </do>
       </foreach>

       <fop.form.group file='/tmp/cvenfach.pdf' type='pdf'>
           <fop.array>
               <arr/>
           </fop.array>
       </fop.form.group>
       
       <return name='facturas.pdf' type='application/pdf'><file name='/tmp/cvenfach.pdf' /></return>
 </body>

</xsql-script>