我正在嘗試使用NetBeans的jasper報告插件。 我創建了我的連接(測試是可以的) 我創建了jrxml ,我嘗試預覽它。Jasper該文檔沒有頁面
它自動編譯(出現.jasper),我有一條消息說:「文檔沒有頁面」。
我讀的問題可能是空的數據源,但它是不是這樣的..所以我決定做一個非常簡單的JRXML(靜:只有沒有參考數據庫的任何字段中的文本)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD JasperReport//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="report name" pageWidth="595" pageHeight="1500" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<background>
<band/>
</background>
<title>
<band height="79"/>
</title>
<pageHeader>
<band height="35"/>
</pageHeader>
<columnHeader>
<band height="61"/>
</columnHeader>
<detail>
<band height="696">
<textField isBlankWhenNull="false">
<reportElement key="textField-23" x="0" y="274" width="449" height="134"/>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Justified">
<font size="11" pdfFontName="Tiffy.ttf" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression><![CDATA["Vous avez reçu il y a quelques mois une attestation de la Caisse Primaire d'Assurance Maladie destinée à réduire le coût de votre adhésion à une complémentaire santé.\n\n"+
"Si vous rencontrez des difficultés dans vos démarches d'accès aux droits et aux soins, le Service social de l'Assurance Maladie est à votre disposition pour vous informer, vous conseiller et vous accompagner.\n\n" +
"Aussi, je propose de vous rencontrer à votre domicile le : "]]>
</textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45"/>
</columnFooter>
<pageFooter>
<band height="54"/>
</pageFooter>
<summary>
<band height="42"/>
</summary>
</jasperReport>
同樣認爲它編譯,但我也有消息
所以我添加這兩條線:
<noData>no Data</noData>
<queryString>select * from dual</queryString>
沒有什麼顯然顯示,但相同的消息..所以連接似乎沒問題?
此鏈接可能會幫助你... [該文檔沒有頁面](https://stackoverflow.com/a/47102519/4783846) –