I guess you need to have reportData as a field in the Action and do
setReportData(reportData) in execute() after populating it.
On 10/26/07, carmi_cd <[EMAIL PROTECTED]> wrote:
>
>
> 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-Datasource-is-null-in-JasperReports-integration-tf4695652.html#a13422205
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>