Jump to content
We've recently updated our Privacy Statement, available here ×

bls61793

Members
  • Posts

    2
  • Joined

  • Last visited

bls61793's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I have a field on my main report called jobPurchaserCollection which is a Java Collection containing objects of the custom type jobPurchaser. jobPurchaser contains several fields, including firstName and lastName, which can be accessed by calling getFirstName and getLastName respectively on the jobPurchaser object. I can retrieve the first jobPurchaser object in the Collection by using $F{jobPurchaserCollection}.iterator().next() in my expression and I can get the first and last names by adding .getPurchaser().get____Name(). However, the problem is that subsequent calls to .iterator().next() within the expression all retrun the same value (ie. the first object in the collection). I want to be able to advance the iterator to the next object so that I can create a list of purchasers with firstName and lastName. How can I do this in Jasper. I'm struggling to figure it out. I need an expression that will iterate through jobPurchaserCollection and get the first and last names of each purchaser. It doesn't appear that standarad Java loops work inside of the expression editior. I'd very much appreciate the insights of someone more experienced than myself.
  2. Hello everyone, this is my first time posting here. I have a jasper report template jrxml that I am trying to fill with the information from a specific JavaBean class. This class doubles as an entity for the Java Persistence API (JPA ) and thus maps directly to a database. Here is my Bean class: package main.java.gls.entities; import main.java.gls.entities.util.JobAmount; import java.io.Serializable; import java.math.BigDecimal; import java.util.Collection; import java.util.Date; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @Entity @Table(name = "job") @NamedQueries( { @NamedQuery(name = "Job.findAll", query = "SELECT j FROM Job j"), @NamedQuery(name = "Job.findByJobNum", query = "SELECT j FROM Job j WHERE j.JobPK.jobNum = :jobNum"), @NamedQuery(name = "Job.findByRev", query = "SELECT j FROM Job j WHERE j.JobPK.rev = :rev"), @NamedQuery(name = "Job.findByLastUpd", query = "SELECT j FROM Job j WHERE j.lastUpd = :lastUpd"), @NamedQuery(name = "Job.findByFCompDate", query = "SELECT j FROM Job j WHERE j.fCompDate = :fCompDate"), @NamedQuery(name = "Job.findByCCompDate", query = "SELECT j FROM Job j WHERE j.cCompDate = :cCompDate"), @NamedQuery(name = "Job.findByEntDate", query = "SELECT j FROM Job j WHERE j.entDate = :entDate"), @NamedQuery(name = "Job.findByFieldDate", query = "SELECT j FROM Job j WHERE j.fieldDate = :fieldDate"), @NamedQuery(name = "Job.findByFinDate", query = "SELECT j FROM Job j WHERE j.finDate = :finDate"), @NamedQuery(name = "Job.findByDueDate", query = "SELECT j FROM Job j WHERE j.dueDate = :dueDate"), @NamedQuery(name = "Job.findByJobIsRush", query = "SELECT j FROM Job j WHERE j.jobIsRush = :jobIsRush"), @NamedQuery(name = "Job.findByComRes", query = "SELECT j FROM Job j WHERE j.comRes = :comRes"), @NamedQuery(name = "Job.findByPltBk", query = "SELECT j FROM Job j WHERE j.pltBk = :pltBk"), @NamedQuery(name = "Job.findByPltPg", query = "SELECT j FROM Job j WHERE j.pltPg = :pltPg"), @NamedQuery(name = "Job.findByDeedBk", query = "SELECT j FROM Job j WHERE j.deedBk = :deedBk"), @NamedQuery(name = "Job.findByDeedPg", query = "SELECT j FROM Job j WHERE j.deedPg = :deedPg"), @NamedQuery(name = "Job.findByLandLot", query = "SELECT j FROM Job j WHERE j.landLot = :landLot"), @NamedQuery(name = "Job.findByDistrict", query = "SELECT j FROM Job j WHERE j.district = :district"), @NamedQuery(name = "Job.findBySection", query = "SELECT j FROM Job j WHERE j.section = :section"), @NamedQuery(name = "Job.findByLot", query = "SELECT j FROM Job j WHERE j.lot = :lot"), @NamedQuery(name = "Job.findByBlock", query = "SELECT j FROM Job j WHERE j.block = :block"), @NamedQuery(name = "Job.findByUnit", query = "SELECT j FROM Job j WHERE j.unit = :unit"), @NamedQuery(name = "Job.findByPhase", query = "SELECT j FROM Job j WHERE j.phase = :phase"), @NamedQuery(name = "Job.findBySubDiv", query = "SELECT j FROM Job j WHERE j.subDiv = :subDiv"), @NamedQuery(name = "Job.findBySubSec", query = "SELECT j FROM Job j WHERE j.subSec = :subSec"), @NamedQuery(name = "Job.findByParIdNum", query = "SELECT j FROM Job j WHERE j.parIdNum = :parIdNum"), @NamedQuery(name = "Job.findByStreetNum", query = "SELECT j FROM Job j WHERE j.streetNum = :streetNum"), @NamedQuery(name = "Job.findByStreetNumAlt", query = "SELECT j FROM Job j WHERE j.streetNumAlt = :streetNumAlt"), @NamedQuery(name = "Job.findByStreetName", query = "SELECT j FROM Job j WHERE j.streetName = :streetName"), @NamedQuery(name = "Job.findByCity", query = "SELECT j FROM Job j WHERE j.city = :city"), @NamedQuery(name = "Job.findByState", query = "SELECT j FROM Job j WHERE j.state = :state"), @NamedQuery(name = "Job.findByZipCode", query = "SELECT j FROM Job j WHERE j.zipCode = :zipCode"), @NamedQuery(name = "Job.findByOrderDate", query = "SELECT j FROM Job j WHERE j.orderDate = :orderDate"), @NamedQuery(name = "Job.findByAmtBill", query = "SELECT j FROM Job j WHERE j.amtBill = :amtBill"), @NamedQuery(name = "Job.findByAmtPaid", query = "SELECT j FROM Job j WHERE j.amtPaid = :amtPaid"), @NamedQuery(name = "Job.findByOldClientNum", query = "SELECT j FROM Job j WHERE j.oldClientNum = :oldClientNum"), @NamedQuery(name = "Job.findByOldClientAlpha", query = "SELECT j FROM Job j WHERE j.oldClientAlpha = :oldClientAlpha"), @NamedQuery(name = "Job.findByChkSum", query = "SELECT j FROM Job j WHERE j.chkSum = :chkSum") }) public class Job implements Serializable { private static final long serialVersionUID = 1L; @EmbeddedId protected JobPK JobPK; @Column(name = "AddInfo") private String addInfo; public Job () { } public Job ( JobPK jobPK ) { this.JobPK = jobPK; } public Job ( int jobNum, int rev ) { this.JobPK = new JobPK(jobNum, rev); } public JobPK getJobPK () { return JobPK; } public void setJobPK ( JobPK jobPK ) { this.JobPK = jobPK; } public String getAddInfo () { return addInfo; } public void setAddInfo ( String addInfo ) { this.addInfo = addInfo; } @Override public int hashCode () { int hash = 0; hash += (JobPK != null ? JobPK.hashCode() : 0); return hash; } @Override public boolean equals ( Object object ) { // TODO: Warning - this method won't work in the case the id fields are not set if ( !(object instanceof Job) ) { return false; } Job other = ( Job ) object; if ( ( this.JobPK == null && other.JobPK != null ) || ( this.JobPK != null && !this.JobPK.equals(other.JobPK) ) ) { return false; } return true; } @Override public String toString () { return "gls.entities.Job[ JobPK=" + JobPK + " ]"; } public boolean hasBalance(){ if (getAmtDue().equals(JobAmount.zero)){ return false; } else { return true; } } //total amount of applied payments. public BigDecimal getAmtApplied() { return JobAmount.getAmountApplied(this); } //amount billed minus amount applied. public BigDecimal getAmtDue() { return JobAmount.getAmountDue(this); } } My JRXML looks like this: <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1 --><!-- 2017-05-01T09:16:14 --><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="testInvoice_2" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4eedbb89-b4f6-4469-9ab6-f642a1688cf7"> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Test JOB Database"/> <style name="Title" forecolor="#FFFFFF" fontName="Times New Roman" fontSize="50" isBold="false" pdfFontName="Times-Bold"/> <style name="SubTitle" forecolor="#CCCCCC" fontName="Times New Roman" fontSize="18" isBold="false" pdfFontName="Times-Roman"/> <style name="Column header" forecolor="#666666" fontName="Times New Roman" fontSize="14" isBold="true"/> <style name="Detail" mode="Transparent" fontName="Times New Roman"/> <style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression> <style mode="Opaque" backcolor="#EEEFF0"/> </conditionalStyle> </style> <style name="Table"> <box> <pen lineWidth="1.0" lineColor="#000000"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> </style> <style name="Table_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_CH" mode="Opaque" backcolor="#CACED0"> <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> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression> <style backcolor="#D8D8D8"/> </conditionalStyle> </style> <field name="addInfo" class="java.lang.String"/> <field name="JobPK" class="main.java.gls.entities.JobPK"> <fieldDescription><![CDATA[JobPK]]></fieldDescription> </field> <columnHeader> <band height="57"> <staticText> <reportElement x="20" y="10" width="100" height="30" uuid="ce227a04-2d3c-41eb-a9a4-f8502249ba54"/> <textElement> <font fontName="SansSerif"/> </textElement> <text><![CDATA[Job Number:]]></text> </staticText> </band> </columnHeader> <detail> <band height="117"> <staticText> <reportElement x="20" y="27" width="100" height="30" uuid="ac395cac-88c5-4702-b0dd-d1cedad753d0"/> <text><![CDATA[Amount Billed:]]></text> </staticText> <staticText> <reportElement stretchType="ContainerBottom" x="23" y="90" width="75" height="20" uuid="5f2f6ac8-32d4-42df-a6fc-d78e0fd6a73a"/> <text><![CDATA[iNFO]]></text> </staticText> </band> </detail> <lastPageFooter> <band height="177"> <staticText> <reportElement positionType="Float" x="-1" y="30" width="261" height="101" uuid="1a0d7088-5af7-4865-8be1-41ec5f51fb36"/> <box> <topPen lineWidth="1.1" lineStyle="Dashed"/> <leftPen lineWidth="1.1" lineStyle="Dashed"/> <bottomPen lineWidth="1.1" lineStyle="Dashed"/> <rightPen lineWidth="1.1" lineStyle="Dashed"/> </box> <text><![CDATA[Your notes here]]></text> </staticText> <staticText> <reportElement positionType="Float" mode="Opaque" x="0" y="147" width="556" height="30" backcolor="#E6E8E9" uuid="36aa233d-4305-48e6-974a-1bbf89bb3c8f"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Serif" size="9" isItalic="true"/> </textElement> <text><![CDATA[THANKYOU FOR YOUR BUSINESS]]></text> </staticText> </band> </lastPageFooter></jasperReport> [/code] I saw this post: http://community.jaspersoft.com/questions/527187/nosuchmethodexception-unknown-property and have tried all of the possible solutions that I have found in this and other posts/articles, but I still can't seem to figure out what's going on, whener I run my application I get the following error:
×
×
  • Create New...