0

JasperReports HTTP 410 error

asked 2009-02-24 19:23:31 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2009-02-24 19:33:08 +0800

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

delete flag offensive retag edit

12 Replies

Sort by ยป oldest newest

answered 2009-02-24 20:47:05 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2009-02-24 21:32:22 +0800

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

link publish delete flag offensive edit

answered 2009-02-25 00:18:02 +0800

YamilBracho gravatar image YamilBracho
1722 2

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

link publish delete flag offensive edit

answered 2012-10-17 17:27:11 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

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

link publish delete flag offensive edit

answered 2012-10-17 19:17:53 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2012-10-17 19:20:58 +0800

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..

link publish delete flag offensive edit

answered 2012-10-18 01:45:51 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

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.

link publish delete flag offensive edit

answered 2012-10-18 06:19:26 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

updated 2012-10-18 06:20:29 +0800

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.

link publish delete flag offensive edit

answered 2012-10-18 07:26:21 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

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

link publish delete flag offensive edit

answered 2012-10-18 07:40:45 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

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

link publish delete flag offensive edit

answered 2012-10-18 07:58:36 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2012-10-18 07:59:44 +0800

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.

link publish delete flag offensive edit

answered 2012-10-18 08:00:47 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

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)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-24 19:23:31 +0800

Seen: 698 times

Last updated: Oct 18 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More