0

Jasper JPA

asked 2009-09-10 20:13:54 +0800

pymsoft gravatar image pymsoft
133 5

I'm a newbie with zk, java, jasper, html, xml....

I did a pdf report with jasper and zk and works fine, with datasource.
Is possible to use zk and jasperreport with JPA?


I try this but don't work: (zero records printed)

<?page title="Report jpa DataFast" contentType="text/html;charset=UTF-8"?>
<zk>
<style src="test.css"></style>
<include src="/menu.zul" height="25px" />
<window title="Stampa Movimenti prova jpa" border="normal"
width="100%" height="95%">
<zscript>
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public EntityManagerFactory emf;
emf = Persistence.createEntityManagerFactory("MiUnidadPersistente");
EntityManager em = emf.createEntityManager();

Map parameters = new HashMap();
parameters.put("JPA_ENTITY_MANAGER", em);
//zk.demo.categ.CategDS ds = new zk.demo.categ.CategDS();
</zscript>
<jasperreport id="report" src="reports/report1_jpa.jasper"
parameters="${parameters}" type="html" >
<attribute name="onCreate">
Clients.showBusy("Attendere mentre si genera il report...", true);
Events.echoEvent("onLater", self, null);
</attribute>
<attribute name="onLater">
Clients.showBusy(null, false);
</attribute>
</jasperreport>
</window>
</zk>

with iReport 3.0.0 works ok.


Thank you

Pedro Gonzalez

delete flag offensive retag edit
Be the first one to reply this discussion!
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-09-10 20:13:54 +0800

Seen: 1,274 times

Last updated: Sep 10 '09

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