Προς το περιεχόμενο

jasperreports ireports emptydata source


xampos20

Προτεινόμενες αναρτήσεις

Δημοσ.

Καλησπερα ηθελα να ρωτησω οταν στο IREPORT ορίζουμε οτι θα έχουμε empty datasource πως μπορούμε να το ορίσουμε και οταν έχουμε την κλάση στον κώδικα της java διότι όταν τρέχω τον κώδικα δεν μου εμφανίζει το pdf μου το εμφανίζει κενο.....ενώ δεν είναι....

 

code:

 

public class ReportDriver {

public static void main(String[] args) {

JasperDesign jasperDesign;

JRDataSource jrd;

 

try {

jasperDesign = JRXmlLoader.load("C:\\report1.jrxml");

JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

jasperReport.getWhenNoDataType();

 

JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,null);

 

JasperExportManager.exportReportToPdfFile(jasperPrint,"C:\\report1.pdf");

JasperViewer.viewReport(jasperPrint);

} catch (JRException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

 

 

}

}

 

jrxml:

 

 

<?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="java" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">

<property name="ireport.zoom" value="1.0"/>

<property name="ireport.x" value="0"/>

<property name="ireport.y" value="0"/>

<background>

<band splitType="Stretch"/>

</background>

<title>

<band height="79" splitType="Stretch">

<staticText>

<reportElement x="190" y="31" width="252" height="21"/>

<textElement>

<font fontName="Arial" size="14" isBold="true" isItalic="true" isUnderline="true"/>

</textElement>

<text><![CDATA[xarhs]]></text>

</staticText>

</band>

</title>

<pageHeader>

<band height="35" splitType="Stretch">

<staticText>

<reportElement x="190" y="14" width="252" height="21"/>

<textElement>

<font fontName="Arial" size="14" isBold="true" isItalic="true" isUnderline="true"/>

</textElement>

<text><![CDATA[xarhs]]></text>

</staticText>

</band>

</pageHeader>

<columnHeader>

<band height="61" splitType="Stretch">

<staticText>

<reportElement x="190" y="31" width="252" height="21"/>

<textElement>

<font fontName="Arial" size="14" isBold="true" isItalic="true" isUnderline="true"/>

</textElement>

<text><![CDATA[xarhs]]></text>

</staticText>

</band>

</columnHeader>

<detail>

<band height="125" splitType="Stretch">

<staticText>

<reportElement x="190" y="31" width="252" height="21"/>

<textElement>

<font fontName="Arial" size="14" isBold="true" isItalic="true" isUnderline="true"/>

</textElement>

<text><![CDATA[xarhs]]></text>

</staticText>

</band>

</detail>

<columnFooter>

<band height="45" splitType="Stretch">

<staticText>

<reportElement x="190" y="24" width="252" height="21"/>

<textElement>

<font fontName="Arial" size="14" isBold="true" isItalic="true" isUnderline="true"/>

</textElement>

<text><![CDATA[xarhs]]></text>

</staticText>

</band>

</columnFooter>

<pageFooter>

<band height="54" splitType="Stretch">

<staticText>

<reportElement x="190" y="31" width="252" height="21"/>

<textElement>

<font fontName="Arial" size="14" isBold="true" isItalic="true" isUnderline="true"/>

</textElement>

<text><![CDATA[xarhs]]></text>

</staticText>

</band>

</pageFooter>

<summary>

<band height="42" splitType="Stretch">

<staticText>

<reportElement x="180" y="21" width="252" height="21"/>

<textElement>

<font fontName="Arial" size="14" isBold="true" isItalic="true" isUnderline="true"/>

</textElement>

<text><![CDATA[xarhs]]></text>

</staticText>

</band>

</summary>

</jasperReport>

 

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...