This methode allows to execute a SQL Object and converts the query through FOP to generate the output in PDF, PCL, PS, XML.
 

1 fop.form

<fop.form
    code='code'
    cond='cond'
    temp='true|false'
    file='file'
    type='pdf|pcl|ps|xml|xml-string'
    emit-blockid='true|false'
    rows='rows'
    din='A3|A4|A5|B5'
    duplex='true|false'
    share-temp-tables='true|false'
>
    <vars> ?
        <var> !
            <varvalue /> !
        </var>
    </vars>
</fop.form>

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 indicated.

insuficient query parameters (vars required ?)

The query of the SQL Object cannot be perfomed for lack of condition (mandatory entry 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.

Object not valid for form printing

The SQL Object does not have a form programmed, the function webapp.wic_jrep_object.call must be used to generate a pdf of a SQL Object without form.

Evitar el uso de fop.form type PDF en bucles!!

You should avoid PDFs inside of loops. For this cases, it is more efficient to call the tag with the attribute type='xml-string' amd generate a single PDF using the tag <fop.form.group>

For more information you can see the examples of the tag <fop.form.group>

Example

Perform the gcompedh object and returns the result in PDF format.

Copy
<xsql-script name='fop_form'>
  <body>
    <fop.form code='gcompedh' cond='1=1' file='test.pdf' type='pdf' />
  </body>
</xsql-script>
Example

Perform the gcompedh object and returns the XML document of the FO code produced in string format to be used directly from a variable.

Copy
<xsql-script name='sample_1'>
    <body>

        <set name='template'>
            <freemarker.template>
<![CDATA[
FreeMarker Template example: ${message} 

=======================
===== County List =====
=======================
<#list countries as country>
${country_index + 1}. ${country}
</#list> 
]]>
            </freemarker.template>
        </set>

        <set name='message'>
            <string>Hello world!</string>
        </set>
        <array name='countries'>
            <string>India</string>
            <string>United States</string>
            <string>Germany</string>
            <string>France</string>
        </array>
        
        <println>
            <freemarker.template.process>
                <template/>
            </freemarker.template.process>
        </println>

    </body>
</xsql-script>