-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
i have problems to run my first JasperReport under ZKoss.
ErrorMessage: HTTP 410
type Status report HTTP 410 Failed to load /view/gglm/z_gl_8b/0/reports/AuftragDetailsPojo_Report.pdf Cause: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : auftrag.aufBezeichnung description The requested resource (Failed to load /view/gglm/z_gl_8b/0/reports/AuftragDetailsPojo_Report.pdf Cause: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : auftrag.aufBezeichnung ) is no longer available, and no forwarding address is known. Apache Tomcat/6.0.18
Logger:
2009-02-24 20:31:30,421 DEBUG OrderDialogCtrl M[onClick$btnPrintReportOrder] - --> [ForwardEvent onClick$btnPrintReportOrder <OrderDialogCtrl orderDialogWindow>] 2009-02-24 20:31:30,421 DEBUG OrderDialogCtrl M - --> begin with printing 2009-02-24 20:31:30,515 DEBUG JRBaseFiller M[<init>] - Fill 6350802: created for AuftragDetailsPojo_Report 2009-02-24 20:31:31,218 DEBUG JRBaseFiller M - Fill 6350802: filling report 2009-02-24 20:31:31,234 DEBUG JRBaseFiller M[<init>] - Fill 2423095: created for AuftragDetailsPojo_Report 2009-02-24 20:31:31,234 DEBUG JRBaseFiller M - Fill 2423095: filling report
Must i configure something in the zk.xml???
any ideas are welcome
Stephan
Hi,
it seems the filling of my report is false.
Can you explain me with wich JR-DataSource you fill the reports.
I work with hibernate at the backend. So i became java.util.List as resultSets.
public class AuftragDetails_Report { private static AuftragService auftragService; public static AuftragService getAuftragService() { if (auftragService == null) { auftragService = (AuftragService) SpringUtil.getBean("auftragService"); } return auftragService; } public JRDataSource createBeanCollectionDatasource(Auftrag auftrag) { return new JRBeanCollectionDataSource(createBeanCollection(auftrag)); } @SuppressWarnings("unchecked") public static Vector createBeanCollection(Auftrag auftrag) { java.util.Vector collection = new java.util.Vector(); /* * This should gives back a single customers order with it's orderPositions. * The order object (auftrag) is overhanded by param. */ Kunde kunde = getAuftragService().getKundeForAuftrag(auftrag); List<Auftragposition> auftragposition = getAuftragService().getAuftragsPositionenByAuftrag(auftrag); collection.add(kunde); collection.add(auftrag); collection.add(auftragposition); return collection; }
Is the JRBeanCollectionDataSource false for these usecase?
thanks
Stephan
I have a similar problems some weeks ago.
I check my code and my jasper report definition and the problem was in my bean I have a Date field and in my jasper report I defined this field as TimeStamp. I changed to Date and everything works ok.
So check the definition between fields in your bean and definition of those fields in your jasper file.
HTH
Hi Stephan,
Can you please tell me what is Solution of above issue i am frusted from this problem same code working with other project with same jar but not working with my project. Can you please post some Help
thanks
Hmmmmm, sorry, very old stuff. I have changed to the DynamicJasper framework http://dynamicjasper.com/. It allows coding Jasper reports in pure java.
You can see a SampleReports in Zksample2
i.e. folder: zkoss\src\main\java\de\forsthaus\webui\order\report\OrderDJReport.java
sorry and best
Stephan
PS: seems like a false 'setter' in my case in the starting thread..
Thanks Stephen,
So you suggesting me to use Dynamic Jasper report rather than Manually Creating i will try it also If you will get time please check this Issue Here.
I found the issue in my Build path i am using the
itext-2.1.4.jar
That was the cause of above exception i updated with
itext-2.1.7.jar
and my code worked fine.
$
But How can we open in model window i do not know it is giving download option rather than opening into modelwindow.
Look at the report code that i mention. This is a skeleton who opens a modal window. In it the report is shown.
window
-> iFrame
---> AMedia
-----> Report
best
Stephan
Hi Stephen ,
Thanks for your reply i have issue with IE only other browser able to show me report in model Window but in IE9 Model Window is blank and Ie telling me to download the report? Can you please let me know its Browser issue or ZK Issue with IE.
Thanks
i don't know that.
Have a try with my skeleton and only modify the constructor and the doprint() method with your jasper code for generating the report and give it to the aMedia component.
best
Stephan
PS: you should write modal not mod'e'l window. It confuses others.
Current Code...
@Command public void dynamicJaserReport() throws JRException { Window win = (Window) Executions.createComponents("/core/report/report.zul", null, null); List<CustomBean> customList = new ArrayList<CustomBean>(); customList.add(new CustomBean("Delhi", 1, "Hariom", "GHaziabd")); customList.add(new CustomBean("Delhi1", 2, "Hariom", "GHaziabd")); customList.add(new CustomBean("Delhi2", 3, "Hariom", "GHaziabd")); customList.add(new CustomBean("Delhi3", 4, "Hariom", "GHaziabd")); customList.add(new CustomBean("Delhi4", 5, "Hariom", "GHaziabd")); customList.add(new CustomBean("Delhi5", 6, "Hariom", "GHaziabd")); customList.add(new CustomBean("Delhi6", 7, "Hariom", "GHaziabd")); FastReportBuilder drb = new FastReportBuilder(); DynamicReport dr = null; try { dr = drb.addColumn("City", "city", String.class.getName(), 30).addColumn("Name", "name", String.class.getName(), 30) .addColumn("Street", "street", String.class.getName(), 50).addColumn("Id", "id", Integer.class.getName(), 50).addGroups(2) .setTitle("Amanda Tests report").setSubtitle("This report was generated at " + new Date()).setPrintBackgroundOnOddRows(true) .setUseFullPageWidth(true).build(); } catch (ColumnBuilderException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (ClassNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } JRDataSource ds = new JRBeanCollectionDataSource(customList); JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), new HashMap()); String OutputFormat = "PDF"; ByteArrayOutputStream output = new ByteArrayOutputStream(); JasperPrint jasperPrint = jasperPrint = JasperFillManager.fillReport(report, new HashMap(), ds); if (OutputFormat.equalsIgnoreCase("PDF")) { JasperExportManager.exportReportToPdfStream(jasperPrint, output); ByteArrayInputStream mediais = new ByteArrayInputStream(output.toByteArray()); AMedia amedia = new AMedia("FirstReport.pdf", "pdf", "application/pdf", mediais); Iframe frame = (Iframe) win.getFellow("reportframe"); frame.setContent(amedia); } } }
Which not not opening Report in ModelWindow (In IE only)
Asked: 2009-02-24 19:23:31 +0800
Seen: 698 times
Last updated: Oct 18 '12