Jump to content

Unable to connect to MySQL using iReport


davix

Recommended Posts

Hi Everyone,

I'm new to JasperReports. I was trying to connect to my local instance of MySQL using iReport Designer. Now, when I test my connection, it shows 'Connection test successful'. After writing a suitable query like select * from employees group by total_experience, I include all the columns to be displayed. After this when I finish with the Report Wizard and look at the preview, it shows a blank page!

It would be of great help if some help and let me know where I'm going wrong. Thanks!

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thanks for your reply.

I'm pasting my report.jrxml file below --

 

Code:
<?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="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">    <queryString language="SQL">        <![CDATA[select * from employees group by total_experience]]>    </queryString>    <field name="id" class="java.lang.Integer"/>    <field name="first_name" class="java.lang.String"/>    <field name="last_name" class="java.lang.String"/>    <field name="mobile_number" class="java.lang.Integer"/>    <field name="total_experience" class="java.lang.Integer"/>    <background>        <band splitType="Stretch"/>    </background>    <title>        <band height="79" splitType="Stretch"/>    </title>    <pageHeader>        <band height="35" splitType="Stretch"/>    </pageHeader>    <columnHeader>        <band height="61" splitType="Stretch"/>    </columnHeader>    <detail>        <band height="125" splitType="Stretch"/>    </detail>    <columnFooter>        <band height="45" splitType="Stretch"/>    </columnFooter>    <pageFooter>        <band height="54" splitType="Stretch"/>    </pageFooter>    <summary>        <band height="42" splitType="Stretch"/>    </summary></jasperReport>
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...