Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd recommend using the JDBC connection option when generating a complex report, if only for the flexibility gained by writing the SQL directly. But having a JDBC connection trespassing in your view layer does not sound good, so without knowing much about Spring, I say move the actual report generation down to the service layer having it return the JasperPrint object (which is serializable) to the view layer where it can be presented.</p> <p>Here is a plain-vanilla RMI example, pretty much the way I do it. I suppose this can be translated into a Spring bean of some sort.</p> <pre><code>public interface ReportService extends Remote { public JasperPrint fillReport(final JasperReport report, final Map reportParameters)throws RemoteException, JRException; } public class ReportServiceImpl implements ReportService { final Connection connection; public ReportServiceImpl(final Connection connection) { this.connection = connection; } public JasperPrint fillReport(final JasperReport report, final Map reportParameters) throws RemoteException, JRException { return JasperFillManager.fillReport(report, reportParameters, connection); } } </code></pre> <p>One modification that springs to mind, no pun intended, would be to have the fillReport method take a report name or path as an argument instead of the actual JasperReport object and have the service layer load it (and cache it, since loading the report is a relatively expensive operation).</p> <p>Let me know if you want me to flesh out some parts of this example, I must warn you though that I am a Desktop/Swing programmer with only a rudimentary experience in web front-ends.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload