Jasper Reportsの練習用に小さな Java プログラムを作成しました。
以下は、レポートを生成して PDF にエクスポートする Java プログラムです。
public class BaseReporter {
    public static void main(String[] args)  {
        try { 
        InputStream inputStream = BaseReporter.class.getResourceAsStream("/reports/helloworld.jasper");
        DataBeanMaker dataBeanMaker = new DataBeanMaker();
        ArrayList<DataBean> dataBeanList = dataBeanMaker.addDataBean();
        JRBeanCollectionDataSource JRbeancollectiondatasource = new JRBeanCollectionDataSource(dataBeanList);
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("Created By", "xxx");
        parameters.put("StylePath", "d:/Learn-WS/Jasper/src/reports/jr.jrtx");
        // Export to PDF
        JasperPrint jasperPrint = JasperFillManager.fillReport(inputStream, parameters, JRbeancollectiondatasource);
        JasperExportManager.exportReportToPdfFile(jasperPrint, "d:/Learn-WS/Jasper/src/reports/helloworld.pdf");
       System.out.println("report process completed ....");
        }
        catch(Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
そして、私のパッケージ構造は
project
       src
          com
             BaseReport.java
             DataBean.java
             DataBeanMaker.java
          reports
             helloworld.jasper
             helloworld.jrxml
             jr.jrtx
          jr.properties
jr.propertiesファイルに、レポートで使用するプロパティを追加しました。report.name="テスト レポート"
jasperReport タグの helloworld.jrxml ファイルにリソース バンドル名を含め、resourceBundle="jr"という名前の属性を付けました。
レポートでリソース バンドル プロパティを次のように呼び出しました。
<title>
        <band height="30">
            <staticText>
                <reportElement uuid="6fbe7eb7-04cd-4c03-bc6e-b2cda3026d3b" mode="Opaque" x="0" y="3" width="535" height="23"/>
                <textElement textAlignment="Center">
                    <font size="14" isBold="true"/>
                </textElement>
                <text><![CDATA[$R{report.name}]]></text>
            </staticText>
        </band>
    </title>
しかし、リソース バンドル プロパティが読み込まれておらず、レポートに適切に配置されていません。
よろしくお願いします。