I am using JasperReports to generate a resume based on the data in three distinct databases. The resume has 3 parts which are personal background, career background and work experience. The details in personal background and career background are not repeatable. However, work experience can have multiple entries which can be or not repeatable.
I am having a problem with the output because I want it to be displayed like this:
[ Personal Background ]
info
[Career Background ]
info
[ Work experience ]
Work experience 1
info
Work experience 2
info
However, Personal Background and Career Background are repeated for each Work experience 1 and 2. I want the iteration to be only in the work experience, not all the three of them.
I'm just using text fields and frame (no subreports, lists or table components). I tried creating subdatasets but I'm lost on how to use it.
I am new to JasperReports and I was asked to create a report. I hope for the soonest response. I would be very glad then.
These are some of the code snippets:
<queryString>
<![CDATA[SELECT user.user_id, user.name, user.image, user.email, user.department, user.birthday, user.location, user.system_role, user.date_updated, user.date_deleted, user.gender, user.course, user.college_end, user.awards, user.industry_start, user.school,
certification.uID,
certification.ACTION_Graduate ,
certification.JLPT_Level_Internal ,
certification.JLPT_Level_Official ,
proj_exp.uID ,
proj_exp.Customer_Name ,
proj_exp.Project_Name ,
proj_exp.Start_Date ,
proj_exp.End_Date ,
proj_exp.Project_Role_Project_Manager ,
proj_exp.Project_Role_Project_Consultant ,
proj_exp.Project_Role_Project_Leader ,
proj_exp.Project_Role_Sub_Leader
FROM user
JOIN certification ON
user.user_id = certification.`uID`
JOIN proj_exp ON
certification.`uID` = proj_exp.`uID`
WHERE
user.user_id = 1527257724]]>
</queryString>
simplified version of .jrxml code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1 -->
<!-- 2015-11-18T10:33:04 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="atss_resume" pageWidth="595" pageHeight="842" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="efaabc27-78c1-480d-92f0-3de6a2ee75a6">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="atss"/>
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 2_TH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 2_CH" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 2_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<queryString>
<![CDATA[SELECT user.user_id, user.name, user.image, user.email, user.department, user.birthday, user.location, user.system_role, user.date_updated, user.date_deleted, user.gender, user.course, user.college_end, user.awards, user.industry_start, user.school,
certification.uID,
certification.ACTION_Graduate ,
certification.JLPT_Level_Internal ,
certification.JLPT_Level_Official ,
proj_exp.uID ,
proj_exp.Customer_Name ,
proj_exp.Project_Name ,
proj_exp.Start_Date ,
proj_exp.End_Date ,
proj_exp.Work_Location ,
proj_exp.Work_Location_Others ,
proj_exp.Project_Type ,
proj_exp.Project_Type_Others ,
proj_exp.Project_Role_Project_Manager ,
proj_exp.Project_Role_Project_Consultant ,
proj_exp.Project_Role_Project_Leader ,
proj_exp.Project_Role_Sub_Leader
FROM user
JOIN certification ON
user.user_id = certification.`uID`
JOIN proj_exp ON
certification.`uID` = proj_exp.`uID`
WHERE
user.user_id = 1527257724]]>
</queryString>
<field name="user_id" class="java.lang.Long">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="image" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="email" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="department" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="birthday" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="location" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="system_role" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="date_updated" class="java.sql.Timestamp">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="date_deleted" class="java.sql.Timestamp">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="gender" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="course" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="college_end" class="java.sql.Date">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="awards" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="industry_start" class="java.sql.Date">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="school" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="uID" class="java.lang.Long">
<fieldDescription><![CDATA[User ID]]></fieldDescription>
</field>
<field name="ACTION_Graduate" class="java.lang.Boolean">
<fieldDescription><![CDATA[ACTION Graduate]]></fieldDescription>
</field>
<field name="JLPT_Level_Internal" class="java.lang.Integer">
<fieldDescription><![CDATA[JLPT Level Internal 0: none 1: N5 / L4 2: N4 / L3 3: N3 4: N2 / L2 5: N1 / L1 JLPT Level Internal]]></fieldDescription>
</field>
<field name="JLPT_Level_Official" class="java.lang.Integer">
<fieldDescription><![CDATA[JLPT Level Official 0: none 1: N5 / L4 2: N4 / L3 3: N3 4: N2 / L2 5: N1 / L1 JLPT Level Official]]></fieldDescription>
</field>
<field name="COLUMN_21" class="java.lang.Long"/>
<field name="Customer_Name" class="java.lang.String">
<fieldDescription><![CDATA[Customer Name]]></fieldDescription>
</field>
<field name="Project_Name" class="java.lang.String">
<fieldDescription><![CDATA[Project Name]]></fieldDescription>
</field>
<field name="Start_Date" class="java.lang.String">
<fieldDescription><![CDATA[Start Date]]></fieldDescription>
</field>
<field name="End_Date" class="java.lang.String">
<fieldDescription><![CDATA[End Date]]></fieldDescription>
</field>
<field name="Work_Location" class="java.lang.Boolean">
<fieldDescription><![CDATA[1: Philippines 2: Japan 3: China 4: Others]]></fieldDescription>
</field>
<field name="Work_Location_Others" class="java.lang.String">
<fieldDescription><![CDATA[Work Location Others]]></fieldDescription>
</field>
<field name="Project_Type" class="java.lang.Boolean">
<fieldDescription><![CDATA[1: Development 2: Verification 3: Translation 4: Infra 5: Support]]></fieldDescription>
</field>
<field name="Project_Type_Others" class="java.lang.String">
<fieldDescription><![CDATA[Project Type Others]]></fieldDescription>
</field>
<field name="Project_Role_Project_Manager" class="java.lang.Boolean">
<fieldDescription><![CDATA[Project Role - Project Manager (PM)]]></fieldDescription>
</field>
<field name="Project_Role_Project_Consultant" class="java.lang.Boolean">
<fieldDescription><![CDATA[Project Role - Project Consultant / Advisor]]></fieldDescription>
</field>
<field name="Project_Role_Project_Leader" class="java.lang.Boolean">
<fieldDescription><![CDATA[Project Role - Project Leader / Scrum Master (PL)]]></fieldDescription>
</field>
<field name="Project_Role_Sub_Leader" class="java.lang.Boolean">
<fieldDescription><![CDATA[Project Role - Sub Leader (SL)]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="18" splitType="Stretch"/>
</title>
<pageHeader>
<band height="22" splitType="Stretch">
<staticText>
<reportElement x="40" y="4" width="100" height="10" uuid="95db4088-edf7-4b2e-a759-8e618c1492c7"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[AWS Confidential]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="75" splitType="Stretch">
<textField>
<reportElement x="40" y="30" width="320" height="30" uuid="93d6debe-5114-47cf-bef8-a39c628e2117"/>
<textElement>
<font fontName="Times New Roman" size="20" isBold="true"/>
<paragraph leftIndent="0"/>
</textElement>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="40" y="10" width="79" height="19" uuid="4564b3fc-d6b9-4178-9f95-fac5cbd37f88"/>
<textElement>
<font fontName="Times New Roman" size="16" isBold="true"/>
</textElement>
<text><![CDATA[PROFILE]]></text>
</staticText>
<image>
<reportElement x="422" y="7" width="72" height="60" uuid="09d1c125-7f6c-4f10-9fd3-f047d003ed99"/>
<imageExpression><![CDATA["C:/Users/kristian.bautista/JaspersoftWorkspace/MyReports/bin/AWS logo.png"]]></imageExpression>
</image>
</band>
</columnHeader>
<detail>
<band height="359" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<staticText>
<reportElement mode="Opaque" x="40" y="10" width="452" height="16" forecolor="#3688E0" backcolor="#E3DEDE" uuid="af1be546-40bb-44cc-8a44-f36fc222f70e"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="12" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Personal Background]]></text>
</staticText>
<frame>
<reportElement x="40" y="26" width="150" height="54" uuid="c5641bf3-e03b-4d3d-8863-3c338d875d6f">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<staticText>
<reportElement x="0" y="0" width="150" height="18" uuid="36d9f5d0-5722-4c96-adfe-b2db0f4a6c30"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="9" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Age]]></text>
</staticText>
<staticText>
<reportElement x="0" y="18" width="150" height="18" uuid="d4fbdaa2-de9f-457b-8422-f60063c216e6"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="9" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Gender]]></text>
</staticText>
<staticText>
<reportElement x="0" y="36" width="150" height="18" uuid="16316821-0aa5-4c0b-aa1d-8ac1fff51729"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="9" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Undergraduate Course]]></text>
</staticText>
</frame>
<staticText>
<reportElement mode="Opaque" x="40" y="113" width="452" height="16" forecolor="#3688E0" backcolor="#E3DEDE" uuid="05513f9a-6018-4730-b4ed-6ac48bac612e"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="12" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Career Background]]></text>
</staticText>
<frame>
<reportElement x="40" y="129" width="150" height="74" uuid="18c90b2c-4376-445c-9c2b-bdcd588228a2">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<staticText>
<reportElement x="0" y="0" width="150" height="26" uuid="76743f2b-0f74-4a94-b6d3-9a40b1e2b67a"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="9" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Years Working in Industry]]></text>
</staticText>
<staticText>
<reportElement x="0" y="26" width="150" height="24" uuid="62c04f1a-d664-408e-b809-9c6938bf34f7"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="9" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[English Language Skill]]></text>
</staticText>
<staticText>
<reportElement x="0" y="50" width="150" height="24" uuid="cb821738-3193-46c4-9f32-de20199e5a55"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="9" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Japanese Language Skill]]></text>
</staticText>
</frame>
<frame>
<reportElement x="190" y="26" width="302" height="54" uuid="082d0f9e-dad5-405e-ae60-17483e5c0623"/>
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="302" height="18" uuid="9aeba03d-ea9e-4e02-9cd2-c32d620df0b0"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana"/>
<paragraph leftIndent="10"/>
</textElement>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="0" y="18" width="302" height="18" uuid="2e79d960-147a-4d54-8a3e-e03e190e498a"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana"/>
<paragraph leftIndent="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{gender}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="0" y="36" width="302" height="51" uuid="ad7c33b1-4ca1-4055-93f1-2d122ce5385f"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana"/>
<paragraph leftIndent="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{course} + " (" + DATEFORMAT($F{college_end}, "MMM yyyy") + ") " + "\n" +
$F{school} + "\n" + "Awarded " + $F{awards}]]></textFieldExpression>
</textField>
</frame>
<frame>
<reportElement x="190" y="129" width="302" height="74" uuid="7fdb6ee8-f15d-4a36-90b0-14757690af9a"/>
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="302" height="26" uuid="005615f1-e118-4348-83dc-1f44eb338960"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana"/>
<paragraph leftIndent="10"/>
</textElement>
<textFieldExpression><![CDATA[YEARS($F{industry_start},TODAY( ))]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="0" y="26" width="302" height="24" uuid="4b64a97c-d01e-43e0-9cfa-749f7b2daaf4"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana"/>
<paragraph leftIndent="10"/>
</textElement>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="0" y="50" width="302" height="24" uuid="c66829bf-5979-4fac-9fbc-753c5ea68f50"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana"/>
<paragraph leftIndent="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{JLPT_Level_Official} == 1 ? "Japanese Language Proficiency - N5 Level":
$F{JLPT_Level_Official} == 2 ? "Japanese Language Proficiency - N4 Level":
$F{JLPT_Level_Official} == 3 ? "Japanese Language Proficiency - N3 Level":
$F{JLPT_Level_Official} == 4 ? "Japanese Language Proficiency - N2 Level":
$F{JLPT_Level_Official} == 5 ? "Japanese Language Proficiency - N1 Level": "none"]]></textFieldExpression>
</textField>
</frame>
<break>
<reportElement x="0" y="210" width="97" height="1" uuid="fcfa0301-1ee1-4633-9a9a-eff55911400f"/>
</break>
<frame>
<reportElement x="40" y="224" width="451" height="135" uuid="c8f2d1ae-cb0d-4cd8-ac4d-8dbd4ae2f26f"/>
<staticText>
<reportElement mode="Opaque" x="0" y="5" width="451" height="16" forecolor="#3688E0" backcolor="#E3DEDE" uuid="8757cd3c-3194-469f-9a3f-2c158cd1c4ec"/>
<box>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Verdana" size="12" isBold="true"/>
<paragraph leftIndent="10"/>
</textElement>
<text><![CDATA[Work Experience]]></text>
</staticText>
<textField>
<reportElement x="11" y="30" width="429" height="19" uuid="9ad6fca5-7a33-49d5-a4f6-bbd5060169e7"/>
<textElement verticalAlignment="Middle">
<font fontName="Verdana" isBold="true" isUnderline="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{Project_Name} + " (" + $F{Start_Date} + " - " + $F{End_Date} + ") "]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="11" y="49" width="130" height="20" uuid="5399a915-d463-45b3-92f0-88f6ae35212c"/>
<textElement verticalAlignment="Middle">
<font fontName="Verdana" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Project Description:]]></text>
</staticText>
<textField>
<reportElement x="41" y="69" width="330" height="20" uuid="7ce9748f-d059-4122-a917-98392c2bf60e"/>
<textElement>
<font fontName="Verdana"/>
</textElement>
<textFieldExpression><![CDATA["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="11" y="89" width="130" height="20" uuid="d79477cd-bdda-408a-b085-e0481fdfb836"/>
<textElement verticalAlignment="Middle">
<font fontName="Verdana" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Responsibilities:]]></text>
</staticText>
<textField>
<reportElement x="41" y="109" width="330" height="20" uuid="0c2bd147-fc15-44bd-87ec-065b10f8eb1d">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement>
<font fontName="Verdana"/>
</textElement>
<textFieldExpression><![CDATA[($F{Project_Role_Project_Manager}?"Project Manager (PM)":null)+", "+
($F{Project_Role_Project_Consultant}?"Project Consultant / Advisor":null)+", "+
($F{Project_Role_Project_Leader}?"Project Leader / Scrum Master (PL)":null)+", "+
($F{Project_Role_Sub_Leader}?"Sub Leader (SL)":null)]]></textFieldExpression>
</textField>
</frame>
</band>
</detail>
<columnFooter>
<band height="23" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="40" splitType="Stretch">
<textField>
<reportElement x="353" y="5" width="70" height="30" uuid="60675991-82e8-45b5-9080-3d09285609e9"/>
<textElement textAlignment="Right">
<font fontName="Arial" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="424" y="5" width="69" height="30" uuid="bd616de3-1e5d-4a30-8a28-a06cf0011598"/>
<textElement textAlignment="Left">
<font fontName="Arial" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" of " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="24" splitType="Stretch"/>
</summary>
</jasperReport>
Yes, the frame
element is only a way to group your elements.
A frame is an element that can contain other elements and optionally draw a border around them. Since a frame is a container of other elements, in the document outline view the frame is represented as a node containing other elements.
So probably you should move towards using subreport or the table / list component. I will answer
How can I achieve the desired result using subreports?
A subreport is a report included inside another report. This allows the creation of very complex layouts with different portions of a single document filled using different data sources and reports.
The structure will be
In main report load the user (only the user, no join on other tables) and display "Personal Background" for all users in where statement
Below the User Info (always in the detail band) included a subreport passing the user id
. The subreport is another report, that loads the data from certification
table with where
statement the users id
and display the "[Career Background ]"
Inside the subreport "[Career Background ]", below the info (always in the detail band) included a subreport passing the certification.uID
. The subreport is another report, that loads the data from proj_exp with where statement on proj_exp.uID
and display the "[ Work experience ]" relative to "[Career Background ]"
I will not complete you code, but show you how another subreport can be including passing parameter and how in that subreport you can execute another sql using the parameter passed
Including a sub report (another report) passing a parameter
<subreport>
<reportElement x="0" y="20" width="555" height="20" uuid="8ee71878-fc35-4991-a7dc-5199f23f2978"/>
<subreportParameter name="user_id">
<subreportParameterExpression><![CDATA[$F{user_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "certification.jasper"]]></subreportExpression>
</subreport>
NOTES:
We are passing the $F{user_id}
to our subreport that will have a parameter with the name user_id
and same class="java.lang.Long"
As connection we pass the $P{REPORT_CONNECTION}
, same connection as the main report
The subreport name is certification.jrxml
and we have already complied it to certification.jasper
since we need to pass the absolute path to the subreport in our main report we have a parameter with name SUBREPORT_DIR
that has a value similar to c:/the path to our subreports/
The subreport
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="subreport" language="java" pageWidth="555" pageHeight="842" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="6afeba62-b470-4dfb-a8fb-42e2226b906d">
<parameter name="user_id" class="java.lang.Long"/>
<queryString>
<![CDATA[SELECT * FROM certification WHERE certification.`uID` = $P{user_id}]]>
</queryString>
<field name="uID" class="java.lang.Long">
<fieldDescription><![CDATA[User ID]]></fieldDescription>
</field>
.. all the other fields you like ...
<detail>
<band height="125" splitType="Immediate">
Here goes the textfields to display Career Background ] and below you included another subreport for the [ Work experience ] (same procedure as above)
</band>
</detail>
</jasperReport>
Repeat for the work experience and you are done.
Watch out for:
Remember compiling the subreport's before executing the main report (if you use IDE es. iReport it's enough that you press "preview" and it will compile the report for you.
When you include a subreport let the height be small (it will stretch automatically), this will help you get page break where you like it to be.
Set correct size and margins on subreport.
Naturally there are other method's to achieve your result for example the use of grouping on data
<group name="User">
<groupExpression><![CDATA[$F{user_id}]]></groupExpression>
<groupHeader>
<band height="50">... texField .. with the user info</band>
</groupHeader>
</group>
or instead of subreport use components like <jr:table>
or <jr:list>
defining its data source, however for now (even if the subreport method is not the most efficient way, multiple query) I believe it's the most straight forward and simple way for you to achieve desired result.