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/11/01 12:31:30 UTC
Re: [S2]Datasource is null in JasperReports integration
i have done what you suggested but got the same errors..thanks again.
strutstwouser wrote:
>
> 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 <ca...@yahoo.com> 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: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/-S2-Datasource-is-null-in-JasperReports-integration-tf4695652.html#a13526998
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