July 30, 2023

tJasperOutput – Docs for ESB 7.x

tJasperOutput

Creates a report in rich formats using Jaspersoft’s iReport.

This component is closely related to Jaspersoft’s report designer — iReport. It reads
and processes data from an input flow to create a report against a .jrxml report
template defined via iReport.

tJasperOutput reads and processes data from an input
flow to create a report against a .jrxml report template defined via iReport.

tJasperOutput Standard properties

These properties are used to configure tJasperOutput running in the Standard Job framework.

The Standard
tJasperOutput component belongs to the Business Intelligence family.

The component in this framework is available in all Talend
products
.

Basic settings

Jrxml file

Report template file created via iReport.

Temp path

Path of temporary files.

Destination path

Path of the final report file.

File name/Stream

Name of the final report.

Report type

File type of the final report.

Schema and Edit
schema

A schema is a row description. It defines the number of fields
(columns) to be processed and passed on to the next component. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

Click Edit
schema
to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this
    option to view the schema only.

  • Change to built-in property:
    choose this option to change the schema to Built-in for local changes.

  • Update repository connection:
    choose this option to change the schema stored in the repository and decide whether
    to propagate the changes to all the Jobs upon completion. If you just want to
    propagate the changes to the current Job, you can select No upon completion and choose this schema metadata
    again in the Repository Content
    window.

 

Built-in: The schema is created
and stored locally for this component only. Related topic: see the

Talend Studio

User Guide.

 

Repository: The schema already
exists and is stored in the Repository, hence can be reused. Related
topic: see
Talend Studio

User Guide.

Sync columns

Click to synchronize the output file schema with the input file
schema. The Sync function only displays once the Row connection is linked with the output
component.

iReport

Edit the command to provide the path of iReport’s execution file,
e.g. replacing __IREPORT_PATH__
with E:Program
FilesJaspersoftiReport-4.1.1in
, or giving the
full path of the execution file such as “E:Program
FilesJaspersoftiReport-4.1.1iniReport.exe”
.

Launch

Click to run iReport.

Advanced settings

tStatCatcher Statistics

Select this check box to collect log data at the component
level.

Specify Locale

Select this check box to choose a locale from the Report Locale list.

Note:

The first line of the Report
Locale
list is empty. You can click it to
customize a locale.

Encoding

Select an encoding mode from this list. You can select Custom from the list to enter an encoding
method in the field that appears.

Global Variables

Global Variables

NB_LINE: the number of rows read by an input component or
transferred to an output component. This is an After variable and it returns an
integer.

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see
Talend Studio

User Guide.

Usage

Usage rule

This component is closely related to Jaspersoft’s report designer
— iReport. It reads and processes data from an input flow to create
a report against a .jrxml report template defined via
iReport.

Generating a report against a .jrxml template

The following Job reads data from a .csv file and creates a .pdf report based on an
existing .jrxml report template. Note that the template file should be created via
Jaspersoft’s iReport based on a file that shares the same schema with the source .csv
file of this job.

Setting up the Job

  1. Drag and drop the following components from the Palette to the workspace: tFileInputDelimited and tJasperOutput.
  2. Connect tFileInputDelimited and
    tJasperOutput using a Row link.

    tJasperOutput_1.png

Configuring the input component

  1. Double-click the tFileInputDelimited
    component to display its Basic settings
    view.

    tJasperOutput_2.png

  2. Select Built-In from the Property Type drop-down list.

    Note:

    You can select Repository from the
    Property Type drop-down list to
    fill in the relevant fields automatically if the relevant metadata has
    been stored locally in the Repository.
    For more information about Metadata,
    see the
    Talend Studio

    User Guide.

  3. Fill in the File name/Stream field to
    give the path and name of the source file, e.g. “C:/Documents and Settings/Andy ZHANG/nom.csv”.
  4. Keep the default settings for the Row
    Separator
    and Field
    Separator
    fields. You can also change them as needed.
  5. Set 1 in the Header field and 0 in the
    Footer field. Leave the Limit field empty. You can also change them as
    needed.
  6. Select Built-In from the Schema drop-down list and click Edit schema to define the data structure of the
    input file. In this case, the input file has 2 columns: Nom and Prenom.

    tJasperOutput_3.png

Configuring the output component

  1. Double-click tJasperOutput to display its
    Basic settings view.

    tJasperOutput_4.png

  2. Enter the full path of the report template file created via Jaspersoft’s
    iReport in the Jrxml file field. You can
    click the three-dot button to browse.

    Note:

    The schema of the file, which is used to create a .jrxml template file
    via iReport, should be the same as that of the source file that is used
    to create the report.

  3. Enter the path for the temporary files generated during the job execution
    in the Temp path field. You can click the
    three-dot button to browse.
  4. Enter the path for the final report file generated during the job
    execution in the Destination path field.
    You can click the three-dot button to browse.
  5. Enter the name for the final report file generated during the job
    execution in the File name/Stream field.
  6. Select the format for the final report file generated during the job
    execution in the Report type field.
  7. Click Sync columns to retrieve the
    schema from the previous component.
  8. Enter the path of execution file of Jaspersoft’s iReport in the iReport field, e.g. replacing __IREPORT_PATH__ with E:Program FilesJaspersoftiReport-4.1.1in. You can
    click the Launch button to run
    iReport.

    Note:

    This step is not mandatory. Yet, this helps you conveniently access
    the iReport software for relevant operations, e.g. creating a report
    template, etc.

Job execution

  1. Press CTRL+S to save your Job.
  2. Press F6 to execute it.

    You can find the file out.pdf in the
    folder specified in the Destination path
    field.

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x