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>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Atemp | string | false | Indicate if the result is stored in a temporary file. By default the file is not temporary, unless explicitly stated otherwise or a file name is indicated. | ||
Afile | string | If the file in which is deposite the result is not temporary (temp='false') a file name can be indicated. If it is not indicated a name file, the file is temporary and the system generates a automatic name. | |||
Atype | string | Type of result to generate. By default, the result is returned in PDF format. You can also obtain the XML data, or the code in PCL or the PostScript to later send it to a print which interpret the language. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Efop.form | |||||
Acode | string | Code of the object to execute | |||
Acond | string | Condition of selection of records. | |||
Arows | string | Maximum number of result records. | |||
Adin | string | Size of the page. | |||
Evars | Input variables of the SQL Object. | ||||
Evar | |||||
Aname | string | Code of the object to execute | |||
Evarvalue | Object | ||||
Efop.array | It is possible to indicate a variable number of '''FO''' documents to group passing an array to the function. | ||||
Earr | Array which contains the 'XML' of the 'FO' documents to group and later convert it. The text should be in 'string' format, for this reason the 'fop.form' tag admits the 'type="xml-string"'. |
Returns | |
---|---|
Type | Description |
string|byte[] | Returns the handler (string) of the generated file (PDF, XML-FO, PS, PCL). |
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.
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.
<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>
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.
<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>