0
我是相當新的JasperReports我需要從自定義數據源創建一個報告。爲此,我實現了JRDataSource
接口,用兩種方法:JasperReports:訪問自定義數據源
public class FacultyStudentsDS implements JRDataSource {
@Override
public Object getFieldValue(JRField field) throws JRException {
...
}
@Override
public boolean next() throws JRException {
...
}
}
然後我嘗試創建一個PDF文檔時,這樣說:
pdf = JasperRunManager.runReportToPdf(reportFile.getAbsolutePath(),
new HashMap(), studentsDS);
我的問題是,我不知道如何訪問我傳遞給報告的數據。我不知道要在.jrxml文件中寫什麼。如何訪問我傳遞給報告的studentsDS
變量,在.jrxml文件中?
謝謝!這似乎很簡單。 –