Can you paste the entire struts.xml ; ensure that you have : <package name="mypackage" extends="struts-default,jasperreports-default">
On Nov 7, 2007 8:51 PM, carmi_cd <[EMAIL PROTECTED]> wrote: > > hi actually i tried using that tutorial and got a pdf with no data in it > only > page and column titles. > i dont know why.. > > Stacktrace of my sun application server, it has no problem. i dont know > why > the report is not filled with the data. here is my code: > > public class EIS_HR_004_JASPER extends eisSupport { > private String reportId; > private String dateStart = null; > private String dateEnd = null; > private String pdfFile; > private final static String _REPORT_FOLDER = "EIS_HR_003"; > private Report thisReport; > private String dateRange; > private ArrayList<Personnel> reportData = new ArrayList<Personnel>(); > > public String execute(ActionMapping mapping,ActionForm form, > HttpServletRequest request, HttpServletResponse response) > throws Exception { > ReportBean reportBean = new ReportBean(); > setThisReport(reportBean.getReport(getReportId())); > setReportData(); > try { > JasperCompileManager.compileReportToFile( > "apps/reports/templates/hr004.jrxml", > "apps/reports/templates/hr004.jasper"); > } catch (Exception e) { > System.out.println("empty"); > e.printStackTrace(); > return ERROR; > } > return SUCCESS; > } > > public String getReportId() { > return reportId; > } > > public void setReportId(String reportId) { > this.reportId = reportId; > } > > public String getDateStart() { > if (this.dateStart == null || this.dateStart.equals("")) { > ResourceBundle eisProperty=ResourceBundle.getBundle("eis"); > this.dateStart = eisProperty.getString("eis.minimum.date"); > } > return this.dateStart; > } > > public void setDateStart(String dateStart) { > this.dateStart = dateStart; > } > > public String getDateEnd() { > if (this.dateEnd == null || this.dateEnd.equals("")) { > Calendar cal = Calendar.getInstance(TimeZone.getDefault()); > this.dateEnd = (new SimpleDateFormat("MMM d, > yyyy").format(cal.getTime())); > } > return this.dateEnd; > } > > public void setDateEnd(String dateEnd) { > this.dateEnd = dateEnd; > } > > public String getPdfFile() { > //setPdfFile(); > return pdfFile; > } > > public Report getThisReport() { > return thisReport; > } > > public void setThisReport(Report thisReport) { > this.thisReport = thisReport; > } > > public String getDateRange() { > setDateRange(); > return dateRange; > } > > public void setDateRange() { > this.dateRange = "( " + getDateStart() + " - " + getDateEnd() + " > )"; > } > > public ArrayList<Personnel> getReportData() { > // setReportData(); > return reportData; > } > > public void setReportData() { > Personnel p1=new Personnel(); > p1.setSurname("Dela Cruz"); > p1.setFirstname("Juan"); > p1.setExamcode("CSC111"); > p1.setExamdate("January 1,2003"); > Personnel p2=new Personnel(); > p2.setSurname("Cruz"); > p2.setFirstname("Miguel"); > p2.setExamcode("CSC222"); > p2.setExamdate("December 2,2003"); > reportData.add(p1); > reportData.add(p2); > } > > } > > here is part of my struts.xml > > <action name="EIS-HR-004_JASPER" class="eis.report.EIS_HR_004_JASPER"> > <result name="error">/apps/reports/ReportNotFound.jsp</result> > <result name="success" type="jasper"> > apps/reports/templates/hr004.jasper > reportData > PDF > </result> > </action> > > i hope you could help me..thanks a lot. > > > > > strutstwouser wrote: > > > > http://struts.apache.org/2.x/docs/jasperreports-tutorial.html ; I was > able > > to use this as-is and get a report fine. > > > > -Joseph > > > > > > carmi_cd wrote: > >> > >> > >> I need a tutorial that uses ArrayList of Object as datasource > >> for JasperReports..do you know any? > >> > > > > > > -- > View this message in context: > http://www.nabble.com/-S2--ArrayList-of-Object-as-datasource-in-JasperReports-tf4749173.html#a13639836 > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >