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>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Acode | string | Code of a object to execute. | |||
Acond | string | Condition of selection of records. | |||
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 the result is deposited is not temporary, (temp='false') you can indicate a file name. If it is not indicated a name, the file is temporary and the system generates an automatic name. | |||
Atype | string | Type of transformation to perform. By default, the result is returned in PDF format. You can also get the XML text of the 'FO' document needed to produce the 'PDF' format, the code in PCL or PostScript to later send to a print which interprets the language. In the case of indicating the 'xml-string' type, the function returns the 'XML' text (string) of the 'FO' document, useful when you want to pass the text to the 'fop.form.group' function. | |||
Aemit-blockid | boolean | true | When using the type='xml-string', prevents the ids of the groups from being broadcast, which can cause errors of duplicate ids in several times the generation of the same report. | ||
Arows | string | -1 (all) | Maximum number of records of the result. | ||
Adin | string | A4 | Size of the page. | ||
Aduplex | boolean | false | Allows to generate a PDF document to print it on double-sided printers. If the number of pages issued for each record is odd, the system inserts automatically a blank page interspersed , so that each first page of each issued document starts in a odd page of the PDF. | ||
Ashare-temp-tables | boolean | true | By default, the temporary tables created by the generation of a report in PDF persist when this ends during the lifetime of the main script, allowing to access to the data of the temporary tables generated in the report from the script itself. This can provoke errors when it is called recursively a fop.form because the temporary tables are not deleted and it would give a duplicated table error. If you want that the temporary tables will be deleted once the PDF report is generated, you can deactivate the sharing of the temporary tables. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Evars | Input variables of the SQL Object. | ||||
Evar | |||||
Evarvalue | Object |
Returns | |
---|---|
Type | Description |
File|String | Return the handler (string) of the generated file (PDF, XML-FO, PS, PCL), except when the indicated type is xml-stringin which is returned a string with the XML text of the generated FO document. |
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>
Perform the gcompedh object and returns the result in PDF format.
<xsql-script name='fop_form'> <body> <fop.form code='gcompedh' cond='1=1' file='test.pdf' type='pdf' /> </body> </xsql-script>
Perform the gcompedh object and returns the XML document of the FO code produced in string format to be used directly from a variable.
<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>