You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by carmi_cd <ca...@yahoo.com> on 2007/10/25 11:58:59 UTC
[S2] JasperReports and Struts2 DataSource was null error
i'm new in integrating JasperReports and Struts 2..my problem is its always
saying that my datasouce is
null so it displays a pdf file with all the labels in it without anything on
the detail part..my datasource
is an ArrayList of Personnel object, i name it reportData.
here is part of my code..
public class EIS_HR_004_JASPER extends eisSupport {
private String reportId;
private String dateStart = null;
private String dateEnd = null;
private Report thisReport;
private String dateRange;
private ArrayList<Personnel> reportData;
public String execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
ReportBean reportBean = new ReportBean();
setThisReport(reportBean.getReport(getReportId()));
reportData=new ArrayList<Personnel>();
Personnel p1=new Personnel();
p1.setSurname("De la Cruz");
p1.setFirstname("Juan");
p1.setExamcode("CSC111");
p1.setExamdate("January 1,2003");
Personnel p2=new Personnel();
p2.setSurname("Hepburn");
p2.setFirstname("Audrey");
p2.setExamcode("CSC222");
p2.setExamdate("December 2,2003");
reportData.add(p1);
reportData.add(p2);
return SUCCESS;
}
public ArrayList<Personnel> getReportData() {
// setReportData();
return reportData;
}
}
thanks in advance for your help. :-)
--
View this message in context: http://www.nabble.com/-S2--JasperReports-and-Struts2-DataSource-was-null-error-tf4689733.html#a13403514
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org