Where to fit in Jasper Reports - front end or business?

I am trying to use Jasper Reports (v3.5.2) to create and print reports in PDF / HTML in a browser for webapp. This webapp already uses JSF (Woodstock) for the frontend and EJB 3 (with JPA and Hibernate as the continuity provider for MySQL db).

My question is: where should the code for generating reports based on Jasper be? I am completely confused by this. Should I put it in the front end of the JSF? Or should it be a β€œreporting” module in business logic like a beans session?

I would think that a suitable place for this is the business layer as a separate module. I would name the business method with the name of the report, the input parameters card and the report format as parameters to the business method and would receive the generated pdf / html in return, which I could then send to the browser. Am I on the right track with this?

Can you offer a sample of how to do this?

Also, I would like to use EJBQL as I already use JPA.

Thanks.

+3
source share
3 answers

, , , , . , EJB, JVM, .

, , .

+3

, " " = "api ".

- .

, , ()

+1

. bean, , JSF , facesContext.responseComplete() , .

, JSF , .

0

Source: https://habr.com/ru/post/1713474/


All Articles