Jump to content
Changes to the Jaspersoft community edition download ×

Problem with data retrieval in JasperIntelligence


Mohan

Recommended Posts

Hi,

 

1. I am creating one query with the following query:

 

[select course_cd, course_nm, first_nm, last_nm from courses, instructors;]

 

2. I am also creating one data source which connects to the database having the above 2 tables (courses and instructors).

 

3. Then I created one .jrxml file which has the following contents:

 

<?xml version="1.0"?>

<!DOCTYPE jasperReport

PUBLIC "-//JasperReports//DTD Report Design//EN"

"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="Database_Report">

<field name="course_cd" class="java.lang.String" />

<field name="course_nm" class="java.lang.String" />

<field name="first_nm" class="java.lang.String" />

<field name="last_nm" class="java.lang.String" />

<detail>

<band height="20">

<textField>

<reportElement x="10" y="0" width="600" height="20" />

<textFieldExpression class="java.lang.String">

<![CDATA[$F{course_cd}]]>

</textFieldExpression>

</textField>

<textField>

<reportElement x="80" y="0" width="200" height="20" />

<textFieldExpression class="java.lang.String">

<![CDATA[$F{course_nm}]]>

</textFieldExpression>

</textField>

<textField>

<reportElement x="280" y="0" width="200" height="20" />

<textFieldExpression class="java.lang.String">

<![CDATA[$F{first_nm}]]> + " " + <![CDATA[$F{last_nm}]]>

</textFieldExpression>

</textField>

</band>

</detail>

</jasperReport>

 

 

3. Finally I created one report unit with above query and the datasource and the jrxml file.

 

I am able to get the report. But the problem is I am not getting all the fields. I am getting only the course_nm and the first_nm field. Can anyone suggest me with a solution? I will be really thankful.

 

Mohan.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

Your query does not seem to be complete.

You do not specify any join condition between the tables.

Are you sure you want a FULL join?

When you say you don't get all the fields, do you mean you have null displayed in the report or that you do not see anything there?

If it is rather the latter, try set the text fields with isStretchWithOverflow="true".

 

I hope this helps.

Teodor

Link to comment
Share on other sites

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...