直接调用iReport生成的jrxml文件生成报表

    技术2022-05-11  68

    public class JasperReportsIntro

    {

     public static void main(String[] args)

     {

        JasperReport jasperReport;

        JasperPrint jasperPrint;

        try

        {

          jasperReport = JasperCompileManager.compileReport(          "reports/jasperreports_demo.jrxml");      jasperPrint = JasperFillManager.fillReport(          jasperReport, new HashMap(), new JREmptyDataSource());      JasperExportManager.exportReportToPdfFile(          jasperPrint, "reports/simple_report.pdf");

        }

        catch (JRException e)

        {

          e.printStackTrace();

        }

     }

    }

     

    最新回复(0)