//Variable declaration myReport Report; myReportData ReportData; //Function containing report invocation code function makeReport() //Initialize Report file locations myReport.reportDesignFile = "reportDesignFileName.jasper"; myReport.reportDestinationFile = "reportDestinationFileName.jrprint"; //Set the report data via a connection using the SQL statement //embedded in the report design sysLib.defineDatabaseAlias("alias", "databaseName"); sysLib.connect("alias", "userid", "password"); myReportData.connectionName="connectionName"; myReport.reportData = myReportData; //Fill the report with data reportLib.fillReport(myReport, DataSource.databaseConnection); //Export the report in PDF format myReport.reportExportFile = "reportDesignFileName.pdf"; reportLib.exportReport(myReport, ExportFormat.pdf); end
//Variable declaration myReport Report; myReportData ReportData; //Function containing the report driving code function makeReport() //Initialize myReport file locations myReport.reportDesignFile = "reportDesignFileName.jasper"; myReport.reportDestinationFile = "reportDestinationFileName.jrprint"; //Set the report data populateReportData(); myReport.reportData = myReportData; //Fill the report with data reportLib.fillReport(myReport, DataSource.reportData); //Export the report in HTML format myReport.reportExportFile = "reportDesignFileName.html"; reportLib.exportReport(myReport, ExportFormat.html); end function populateReportData() //Insert EGL code here which populates myReportData ... end
//Variable declaration myReport Report; myReportData ReportData; //Function containing report driving code function makeReport() //Initialize Report file locations myReport.reportDesignFile = "reportDesignFileName.jasper"; myReport.reportDestinationFile = "reportDestinationFileName.jrprint"; //Set the report data via a SQL statement myReportData.sqlStatement = "SELECT * FROM dataBaseTable"; myReport.reportData = myReportData; //Fill the report with data reportLib.fillReport(myReport, DataSource.sqlStatement); //Export the report in text format myReport.reportExportFile = "reportOutputFileName.txt"; reportLib.exportReport(myReport, ExportFormat.text); end
相关概念
EGL 报告概述
EGL 报告创建过程概述
相关任务
编写用于生成报告的代码
相关参考
EGL 报告库
数据源
库中的数据记录
EGL 报告处理程序