Jump to content
  • Composite Element


    morlandin
    • Version: v8 Product: Jaspersoft® Studio

    Overview

    The composite elements are a new kind of user created element introduced in Jaspersoft® Studio with version 6.1.1. They allow to create a new element in the palette starting from one or more basic elements, and reuse them whenever you want in any report. For example it is possible to create a composite element using a static text and a text field with some attributes already predefined (like the fonts or the colors). You will have this new element in the palette and when you drag it in the report it will create the same Static Text and Text Field with the same set of properties of the originals.

    This composite elements are stored inside a special folder of your Workspace, so when you switch your version of Jaspersoft Studio you can always find your previously created elements as soon as you use the same Workspace.

    Create a Composite Element

    Creating a Composite Element is really simple. In any report create the elements you want to add to the Composite Element and customize their properties as you want, when you have finished, select these elements, right click on them and from the contextual menu select "Save as Composite Element..". NOTE: A composite element can be created only from a set of Basic Elements, basic means elements that are not depending from a dataset.

    1(121).png.578ce95bcfb8d5220582b2f304204594.png

    When you click this option a Dialog will appear, in this dialog you will be able to specify:

    1. The name of your Composite Element, this information is mandatory since it will be used inside the palette and must be an unique name
    2. An optional description for the element
    3. An optional icon used in the palette for the Composite Element, if this field is leave blank then a default image is used.
    4. The palette section where this element will be placed

    2(79).png.fcc6bc5b1101f4cac5d24816eef3f43d.png

    After you have set all the information, press Finish.  The element will now be created in the selected palette, NOTE: If you create the element inside a palette and in the next run it is missing, then this can happen maybe because you have created it with a Jaspersoft Studio Pro, placing them inside the Pro Components section of the palette, but you are reusing them into a Community version. The Community version does not have the Pro Components section. In this case and in every case where the palette of a Composite Element is missing, it will be displayed in the Composite Elements section of the palette.

    Use a Composite Element

    To use your element, you have to simply drag and drop it inside a report, it and all its contents will be created in the same way it was defined originally.

    Modify a Composite Element

    When you right click on a Composite Element you have 3 options:

    3(52).png.12a81e8001a24ae5c9b4bd57fad8f515.png

    1. Edit: This option reopens the dialog used to Create the element and all information (name, description, icon and palette location) can be changed. 
    2. Open in Designer: This option can be used to modify the content of the composite element, in other words you can modify the single elements inside it. When this option is selected a special editor will be opened where you can see all the contents of the element and you can modify it as you wish. This editor will look really similar to the report editor but with some simplifications: there will be only a band where the content is placed, there will be no dataset and no possibility to create one and the palette will allow to use only a set of basic elements. In this editor you can add new elements, remove the existing ones or change their properties. When you have finished simply save your work and the associated Composite Element will be reloaded automatically
    3. Delete: After confirming request this action will simply delete the Composite Element and all its resources

    Import/Export of the Composite Elements

    The composite elements can be exported and imported in any instance of Jaspersoft Studio.

    To Export a Composite Element:

    1. In the Palette, Right-Click on the the element you want to export and select "Export Composite Elements"
    2. A dialog will popup and here you can select any number of composite elements to export. The element that was selected in the palette will be already marked for the export. Every element selected in this page will be exported.
    3. Press "Finish" and select the destination, every element selected and their resources, like images, will be exported into a single Zip container. This container can then be used in the import procedure to get this elements back.

    To Import a Composite Element:

    1. Right-Click on any position in the Palette and select "Import Composite Elements".
    2. Select a Zip container obtained during the Export procedure.
    3. A wizard will popup where you can review every element that will be imported, you can define the name, the icon, the description and the palette position of every imported element. However all this fields will be precompiled with the information of the original exported elements, but you can re-define them during the import procedure. If one of the imported elements has the same name as one of the Composite Elements in your workspace, you will need to provide a new name for it, since the name must be unique.
    4. When you have reviewed all the elements, press Finish to complete the import procedure.

    1(121).png.66151290c52a261a2b034bc94277659d.png

    2(79).png.ef2fd982aa94b9af9c3f939acdaa7955.png


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...