Jump to content
We've recently updated our Privacy Statement, available here ×
  • Table Component from Domain Source


    Guest

     

     

    Creating Table Components from a Domain Datasource

    This is a guide on creating a domain based report with a Table Component from a Domain query.

     

    SubDataset

    You will need a Sub Dataset based on a Domain query. There is no "wizard" in iReport to achieve this so you'll need to make sure that you've got a query written, possibly by using the Domain based Report wizard.

     

    Create the subdataset

    Change the Query language to domain and paste your query in from the main report.

    Domain_query.png.77be4da9ff7c6fe128547cd33f59bc63.png

    Create the Fields

    Then you need the fields in the table component. For this example I just copy them and paste them from the main dataset:

    Domain_fields.png.81e0f0c516624b2739570716f7b8e2a0.png

    Any Parameters that you are going to pass from the report (such as Input Selects) will need to be copied into the table componentarea as well. A simple copy & paste will accomplish this. If you are passing variables into the table you'll have to copy those, but if you are using them only locally within the table you can create them in the table component without creating them in the report component.

     

    Create the Table Component

    Drag in the table component. Set the Connection/Datasource Expression:

    Domain_connection.png.0a94bfdae862df3ea27cd6b583266f11.png

    This step is critical, set the Parameters Map Expression to $P{REPORT_PARAMETERS_MAP}:

    Domain_parameters_map.png.eac8686d49fb4540f38b1c65e69da7a3.png

    Any parameters that you are passing in will need to be mapped in addition to setting the Parameters Map Expression.

     

    Example Report

    Here's an example JRXML showing the above: Example Report It uses the "simple-domain" that ships with JasperReports Server

     

    domain_based_table.jrxml


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...