该文档无页面碧玉报告

如何解决该文档无页面碧玉报告

首先,资源管理…

如果可以,您应该只打开与数据库的单个连接。确保在关闭应用程序之前将其关闭。连接过程可能会很昂贵,因此您只在确实必须这样做时才真正想要这样做。

You close your resources once you have finished with them. This is best achieved by using a try-finally block…

private Connection con;

protected void close() throws SQLException {
    if (con != null) {
        con.close();
    }
}

protected Connection getConnection() throws ClassNotFoundException, SQLException {
    if (con == null) {
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        String url = "jdbc:odbc:*****";
        String user = "******";
        String pass = "******";
        Connection con = DriverManager.getConnection(url, user, pass);
    }
    return con;
}

private void search() throws Exception {

    Statement state = null;
    ResultSet rs = null;

    try {

        state = getConnection().createStatement();

        rs = state.executeQuery("SELECT "
                + "pIDNo AS 'Patient ID',"
                + "pLName AS 'Last Name',"
                + "pFName AS 'First Name',"
                + "pMI AS 'M.I.',"
                + "pSex AS 'Sex',"
                + "pStatus AS 'Status',"
                + "pTelNo AS 'Contact No.',"
                + "pDocID AS 'Doctor ID',"
                + "pAddr AS 'St. No.',"
                + "pStreet AS 'St. Name',"
                + "pBarangay AS 'Barangay',"
                + "pCity AS 'City',"
                + " pProvince AS 'Province',"
                + " pLNameKIN AS 'Last Name',"
                + "pFNameKIN AS 'First Name',"
                + "pMIKIN AS 'M.I.',"
                + "pRelationKIN AS 'Relation',"
                + "pTotalDue AS 'Total Due'"
                + " FROM dbo.Patients");
        ResultSetMetaData rsmetadata = rs.getMetaData();
        int columns = rsmetadata.getColumnCount();

        DefaultTableModel dtm = new DefaultTableModel();
        Vector column_name = new Vector();
        Vector data_rows = new Vector();

        for (int i = 1; i < columns; i++) {
            column_name.addElement(rsmetadata.getColumnName(i));
        }
        dtm.setColumnIdentifiers(column_name);

        while (rs.next()) {
            data_rows = new Vector();
            for (int j = 1; j < columns; j++) {
                data_rows.addElement(rs.getString(j));
            }
            dtm.addRow(data_rows);
        }
        tblPatient.setModel(dtm);

    } finally {
        try {
            rs.close();
        } catch (Exception e) {
        }
        try {
            state.close();
        } catch (Exception e) {
        }
    }
}

Now to the problem at hand…

It appears you have create two references to con. One as class field and one as a method variable (in search).

You are then passing con to Jasper Reports, which I suspect is null. Instead you should use the getConnection() as outlined above.

public void reportviewer() {
    try{
        String report = "C:\\Users\\cleanfuel\\Documents\\NetBeansProjects\\StringManipulation\\src\\stringmanipulation\\report1.jrxml";
        JasperReport jasp_report = JasperCompileManager.compileReport(report);
        JasperPrint jasp_print = JasperFillManager.fillReport(jasp_report, null, getConnection());
        JasperViewer.viewReport(jasp_print);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

A report can take some time to compile and fill. You should off load this work to a background thread so it doesn’t interfere with your UI (or make it look like you application as hung).

The simplest solution would be to use a SwingWorker. It has functionality to resync the threads with the UI

public void reportviewer() {
    // Disable any UI components you don't want the user using while
    // the report generates...
    new ReportWorker().execute();
}

public class ReportWorker extends SwingWorker<JasperPrint, Void> {

    @Override
    protected JasperPrint doInBackground() throws Exception {
        String report = "C:\\Users\\cleanfuel\\Documents\\NetBeansProjects\\StringManipulation\\src\\stringmanipulation\\report1.jrxml";
        JasperReport jasp_report = JasperCompileManager.compileReport(report);
        JasperPrint jasp_print = JasperFillManager.fillReport(jasp_report, null, getConnection());
        return jasp_print;
    }

    @Override
    protected void done() {
        try {
            JasperPrint jasp_print = get();
            JasperViewer.viewReport(jasp_print);
        } catch (Exception exp) {
            exp.printStackTrace();
        }
        // Renable any UI components you disabled before the report run
    }
}

Take a look at Concurrency in Swing for more details.

If you can pre-compile the report and load it (rather the loading the XML), it will make the report process quicker.

解决方法

我在寻找解决此问题的方法时遇到问题。运行它后,我的代码可以正常工作。它假定将我的sql数据库中的数据显示到jtable上,并且有一个按钮将触发显示jasper报告,但存在一点问题,它始终向我显示消息“文档无页面”。这是为什么?有人可以帮我解决我的问题吗?我做错什么了?

这是我的代码:

package stringmanipulation;
import java.sql.*;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.view.JasperViewer;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;


public class r2xml extends javax.swing.JFrame {


    public r2xml() {
        initComponents();
    }

Connection con;
    private void search() throws Exception{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String url = "jdbc:odbc:*****";
            String user = "******";
            String pass = "******";
            Connection con =  DriverManager.getConnection(url,user,pass);
            Statement state = con.createStatement();

            ResultSet rs = state.executeQuery("SELECT "
                    + "pIDNo AS 'Patient ID',"
                    + "pLName AS 'Last Name'," 
                    + "pFName AS 'First Name',"
                    + "pMI AS 'M.I.',"
                    + "pSex AS 'Sex',"
                    + "pStatus AS 'Status',"
                    + "pTelNo AS 'Contact No.',"
                    + "pDocID AS 'Doctor ID',"
                    + "pAddr AS 'St. No.',"
                    + "pStreet AS 'St. Name',"
                    + "pBarangay AS 'Barangay',"
                    + "pCity AS 'City',"
                    + " pProvince AS 'Province',"
                    + " pLNameKIN AS 'Last Name',"
                    + "pFNameKIN AS 'First Name',"
                    + "pMIKIN AS 'M.I.',"
                    + "pRelationKIN AS 'Relation',"
                    + "pTotalDue AS 'Total Due'"
                    + " FROM dbo.Patients");
            ResultSetMetaData rsmetadata = rs.getMetaData();
            int columns = rsmetadata.getColumnCount();
            DefaultTableModel dtm = new DefaultTableModel();
            Vector column_name = new Vector();
            Vector data_rows = new Vector();

            for (int i=1; i<columns;i++){
                column_name.addElement(rsmetadata.getColumnName(i));
            }
            dtm.setColumnIdentifiers(column_name);

            while(rs.next()){
                data_rows = new Vector();
                for (int j=1; j<columns; j++){
                data_rows.addElement(rs.getString(j));
                }
                dtm.addRow(data_rows);
            }
            tblPatient.setModel(dtm);
    }

    public void reportviewer() {


        try{

        String report = "C:\\Users\\cleanfuel\\Documents\\NetBeansProjects\\StringManipulation\\src\\stringmanipulation\\report1.jrxml";
        JasperReport jasp_report = JasperCompileManager.compileReport(report);
        JasperPrint jasp_print = JasperFillManager.fillReport(jasp_report,null,con);
        JasperViewer.viewReport(jasp_print);
        }
        catch (Exception e) {System.out.print(e);}
    }
    @SuppressWarnings("unchecked")




public static void main(String args[]) {
        PatternLayout pl = new PatternLayout("[%-5p] %C.%M:%L: %m%n");
        ConsoleAppender appender = new ConsoleAppender(pl);
        Logger.getRootLogger().addAppender(appender);

        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new r2xml().setVisible(true);
            }
        });
    }

这是XML报告:

<?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="null" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" 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="71"/>
    <style name="Title" forecolor="#FFFFFF" fontName="Times New Roman" fontSize="50" isBold="false" pdfFontName="Times-Bold"/>
    <style name="SubTitle" forecolor="#666666" 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" pdfFontName="Times-Roman"/>
    <style name="Detail" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-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="#F0EFEF"/>
        </conditionalStyle>
    </style>
    <subDataset name="PieChartDataset"/>
    <queryString language="SQL">
        <![CDATA[SELECT
     Patients."pIDNo" AS Patients_pIDNo,Patients."pLName" AS Patients_pLName,Patients."pFName" AS Patients_pFName,Patients."pMI" AS Patients_pMI,Patients."pSex" AS Patients_pSex,Patients."pStatus" AS Patients_pStatus,Patients."pTelNo" AS Patients_pTelNo,Patients."pDocID" AS Patients_pDocID,Patients."pAddr" AS Patients_pAddr,Patients."pStreet" AS Patients_pStreet,Patients."pBarangay" AS Patients_pBarangay,Patients."pCity" AS Patients_pCity,Patients."pProvince" AS Patients_pProvince,Patients."pLNameKIN" AS Patients_pLNameKIN,Patients."pFNameKIN" AS Patients_pFNameKIN,Patients."pMIKIN" AS Patients_pMIKIN,Patients."pRelationKIN" AS Patients_pRelationKIN,Patients."pTotalDue" AS Patients_pTotalDue
FROM
     "dbo"."Patients" Patients]]>
    </queryString>
    <field name="Patients_pIDNo" class="java.lang.String"/>
    <field name="Patients_pLName" class="java.lang.String"/>
    <field name="Patients_pFName" class="java.lang.String"/>
    <field name="Patients_pMI" class="java.lang.String"/>
    <field name="Patients_pSex" class="java.lang.String"/>
    <field name="Patients_pStatus" class="java.lang.String"/>
    <field name="Patients_pTelNo" class="java.lang.String"/>
    <field name="Patients_pDocID" class="java.lang.String"/>
    <field name="Patients_pAddr" class="java.lang.String"/>
    <field name="Patients_pStreet" class="java.lang.String"/>
    <field name="Patients_pBarangay" class="java.lang.String"/>
    <field name="Patients_pCity" class="java.lang.String"/>
    <field name="Patients_pProvince" class="java.lang.String"/>
    <field name="Patients_pLNameKIN" class="java.lang.String"/>
    <field name="Patients_pFNameKIN" class="java.lang.String"/>
    <field name="Patients_pMIKIN" class="java.lang.String"/>
    <field name="Patients_pRelationKIN" class="java.lang.String"/>
    <field name="Patients_pTotalDue" class="java.math.BigDecimal"/>
    <group name="Patients_pIDNo">
        <groupExpression><![CDATA[$F{Patients_pIDNo}]]></groupExpression>
        <groupHeader>
            <band height="31">
                <frame>
                    <reportElement mode="Opaque" x="72" y="7" width="730" height="24" forecolor="#B89F7D" backcolor="#70A9C6"/>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="SubTitle" isPrintRepeatedValues="false" x="155" y="1" width="110" height="23" forecolor="#FFFFFF"/>
                        <textElement>
                            <font fontName="Arial" isBold="false" pdfFontName="Helvetica"/>
                        </textElement>
                        <textFieldExpression><![CDATA[$F{Patients_pIDNo}]]></textFieldExpression>
                    </textField>
                </frame>
            </band>
        </groupHeader>
        <groupFooter>
            <band height="6"/>
        </groupFooter>
    </group>
    <background>
        <band height="555" splitType="Stretch">
            <pie3DChart>
                <chart isShowLegend="false" evaluationTime="Report">
                    <reportElement x="-18" y="406" width="229" height="139"/>
                    <chartTitle/>
                    <chartSubtitle/>
                    <chartLegend/>
                </chart>
                <pieDataset>
                    <dataset>
                        <datasetRun subDataset="PieChartDataset">
                            <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(5)]]></dataSourceExpression>
                        </datasetRun>
                    </dataset>
                    <keyExpression><![CDATA[/* Replace with your key expression here */
$V{REPORT_COUNT}]]></keyExpression>
                    <valueExpression><![CDATA[new Double(200*Math.random()*5)]]></valueExpression>
                </pieDataset>
                <pie3DPlot>
                    <plot backgroundAlpha="0.5" foregroundAlpha="0.8">
                        <seriesColor seriesOrder="0" color="#3399FF"/>
                        <seriesColor seriesOrder="1" color="#00CCFF"/>
                        <seriesColor seriesOrder="2" color="#0066CC"/>
                        <seriesColor seriesOrder="3" color="#6699FF"/>
                        <seriesColor seriesOrder="4" color="#004A94"/>
                        <seriesColor seriesOrder="5" color="#00356A"/>
                    </plot>
                    <itemLabel color="#000000" backgroundColor="#FFFFFF"/>
                </pie3DPlot>
            </pie3DChart>
            <image>
                <reportElement x="-20" y="65" width="229" height="250">
                    <printWhenExpression><![CDATA[$V{PAGE_NUMBER} == 1]]></printWhenExpression>
                </reportElement>
                <imageExpression><![CDATA["flower1.png"]]></imageExpression>
            </image>
            <image>
                <reportElement x="-20" y="-20" width="229" height="250">
                    <printWhenExpression><![CDATA[$V{PAGE_NUMBER} > 1]]></printWhenExpression>
                </reportElement>
                <imageExpression><![CDATA["flower1.png"]]></imageExpression>
            </image>
            <staticText>
                <reportElement mode="Opaque" x="318" y="315" width="239" height="181" backcolor="#FFFFCC">
                    <printWhenExpression><![CDATA[Boolean.FALSE]]></printWhenExpression>
                </reportElement>
                <box topPadding="4" leftPadding="4" bottomPadding="4" rightPadding="4">
                    <pen lineWidth="1.0" lineColor="#CC9900"/>
                    <topPen lineWidth="1.0" lineColor="#CC9900"/>
                    <leftPen lineWidth="1.0" lineColor="#CC9900"/>
                    <bottomPen lineWidth="1.0" lineColor="#CC9900"/>
                    <rightPen lineWidth="1.0" lineColor="#CC9900"/>
                </box>
                <textElement>
                    <font size="12"/>
                </textElement>
                <text><![CDATA[Each chart is populated on each page.
The 3 pie charts are currently using an empty datasource and the values are
generated using a random generator.

This rectangle element is not printed (see the print when expression of this
element)]]></text>
            </staticText>
            <line>
                <reportElement x="201" y="431" width="117" height="1">
                    <printWhenExpression><![CDATA[Boolean.FALSE]]></printWhenExpression>
                </reportElement>
                <graphicElement>
                    <pen lineWidth="3.0" lineStyle="Dotted" lineColor="#996600"/>
                </graphicElement>
            </line>
            <staticText>
                <reportElement mode="Opaque" x="275" y="-10" width="240" height="181" backcolor="#FFFFCC">
                    <printWhenExpression><![CDATA[Boolean.FALSE]]></printWhenExpression>
                </reportElement>
                <box topPadding="4" leftPadding="4" bottomPadding="4" rightPadding="4">
                    <pen lineWidth="1.0" lineColor="#CC9900"/>
                    <topPen lineWidth="1.0" lineColor="#CC9900"/>
                    <leftPen lineWidth="1.0" lineColor="#CC9900"/>
                    <bottomPen lineWidth="1.0" lineColor="#CC9900"/>
                    <rightPen lineWidth="1.0" lineColor="#CC9900"/>
                </box>
                <textElement markup="none">
                    <font size="12"/>
                </textElement>
                <text><![CDATA[Flowers

There are two flowers,the first one is printed only starting from the second page,the other one only in the first page.]]></text>
            </staticText>
            <line>
                <reportElement x="72" y="37" width="204" height="1">
                    <printWhenExpression><![CDATA[Boolean.FALSE]]></printWhenExpression>
                </reportElement>
                <graphicElement>
                    <pen lineWidth="3.0" lineStyle="Dotted" lineColor="#996600"/>
                </graphicElement>
            </line>
        </band>
    </background>
    <title>
        <band height="94" splitType="Stretch">
            <staticText>
                <reportElement style="SubTitle" x="336" y="65" width="449" height="29"/>
                <textElement textAlignment="Right">
                    <font size="22" isBold="false"/>
                </textElement>
                <text><![CDATA[Hospital ]]></text>
            </staticText>
            <frame>
                <reportElement mode="Opaque" x="-20" y="0" width="822" height="65" forecolor="#006699" backcolor="#006699"/>
                <staticText>
                    <reportElement style="Title" x="231" y="0" width="578" height="65"/>
                    <textElement textAlignment="Right">
                        <font size="54" isBold="false"/>
                    </textElement>
                    <text><![CDATA[Patient Form]]></text>
                </staticText>
            </frame>
        </band>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="14" splitType="Stretch">
            <frame>
                <reportElement x="210" y="0" width="575" height="14"/>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="99" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pSex]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="132" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pStatus]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="165" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pTelNo]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="198" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pDocID]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="231" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pAddr]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="264" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pStreet]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="297" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pBarangay]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="330" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pCity]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="363" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pProvince]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="396" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pLNameKIN]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="429" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pFNameKIN]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="462" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pMIKIN]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="495" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pRelationKIN]]></text>
                </staticText>
                <staticText>
                    <reportElement style="Column header" positionType="Float" x="528" y="0" width="33" height="14" forecolor="#000000"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                    </textElement>
                    <text><![CDATA[Patients_pTotalDue]]></text>
                </staticText>
            </frame>
            <staticText>
                <reportElement style="Column header" positionType="Float" x="0" y="0" width="72" height="14" forecolor="#000000"/>
                <textElement>
                    <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                </textElement>
                <text><![CDATA[ Last Name]]></text>
            </staticText>
            <staticText>
                <reportElement style="Column header" positionType="Float" x="72" y="0" width="65" height="14" forecolor="#000000"/>
                <textElement>
                    <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                </textElement>
                <text><![CDATA[First Name]]></text>
            </staticText>
            <staticText>
                <reportElement style="Column header" positionType="Float" x="137" y="0" width="74" height="14" forecolor="#000000"/>
                <textElement>
                    <font fontName="Arial" size="12" isBold="true" pdfFontName="Helvetica"/>
                </textElement>
                <text><![CDATA[Middle Initial]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="15" splitType="Stretch">
            <line>
                <reportElement positionType="FixRelativeToBottom" x="227" y="14" width="575" height="1"/>
            </line>
            <frame>
                <reportElement x="226" y="0" width="575" height="14"/>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="99" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pSex}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="132" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pStatus}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="165" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pTelNo}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="198" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pDocID}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="231" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pAddr}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="264" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pStreet}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="297" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pBarangay}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="330" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pCity}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="363" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pProvince}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="396" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pLNameKIN}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="429" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pFNameKIN}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="462" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pMIKIN}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="495" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pRelationKIN}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="Detail" positionType="Float" x="528" y="0" width="33" height="14"/>
                    <textElement>
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{Patients_pTotalDue}]]></textFieldExpression>
                </textField>
            </frame>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement style="Detail" positionType="Float" x="4" y="0" width="68" height="14"/>
                <textElement>
                    <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Patients_pLName}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement style="Detail" positionType="Float" x="72" y="1" width="65" height="14"/>
                <textElement>
                    <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Patients_pFName}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement style="Detail" positionType="Float" x="137" y="1" width="72" height="14"/>
                <textElement>
                    <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Patients_pMI}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band height="7" splitType="Stretch">
            <line>
                <reportElement positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1"/>
                <graphicElement>
                    <pen lineWidth="0.5" lineColor="#999999"/>
                </graphicElement>
            </line>
        </band>
    </columnFooter>
    <pageFooter>
        <band height="16" splitType="Stretch">
            <frame>
                <reportElement mode="Opaque" x="2" y="0" width="800" height="16" forecolor="#D0B48E" backcolor="#006699"/>
                <textField evaluationTime="Report">
                    <reportElement style="Column header" x="753" y="0" width="40" height="16" forecolor="#FFFFFF"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement style="Column header" x="673" y="0" width="80" height="16" forecolor="#FFFFFF"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
                </textField>
                <textField pattern="EEEEE dd MMMMM yyyy">
                    <reportElement style="Column header" x="2" y="0" width="197" height="16" forecolor="#FFFFFF"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Arial" size="12" isBold="false" pdfFontName="Helvetica"/>
                    </textElement>
                    <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
                </textField>
            </frame>
        </band>
    </pageFooter>
    <summary>
        <band splitType="Stretch"/>
    </summary>
</jasperReport>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res