[TANYA] Bagaiman Mengirim Absolute Path Agar Sub Report Bisa Dijalankan Di Banyak Komputer?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[TANYA] Bagaiman Mengirim Absolute Path Agar Sub Report Bisa Dijalankan Di Banyak Komputer?

MUHAMMAD TAUFIK
Salam para master java, saya sedang bikin program pos kecil2an, saya buat laporan penjualan dengan element sub report di dalamnya, ketika saya build n run di komputer yg saya gunakan, bisa jalan, tp saat di run di komputer lain keluar error seperti ini :

net.sf.jasperreports.engine.JRException: Resource not found at : [hidden email]
        at net.sf.jasperreports.repo.RepositoryUtil.getResource(RepositoryUtil.java:155)
        at net.sf.jasperreports.repo.RepositoryUtil.getReport(RepositoryUtil.java:126)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateReport(JRFillSubreport.java:317)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:347)
        at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:275)
        at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:257)
        at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:473)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalFiller.java:434)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVerticalFiller.java:398)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:259)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:765)
        at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:605)
        at paperman.service.impl.ReportServiceImpl.getKartuPembayaranReport(ReportServiceImpl.java:117)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy21.getKartuPembayaranReport(Unknown Source)
        at paperman.report.ui.LaporanKartuBayar.btnMuatActionPerformed(LaporanKartuBayar.java:211)
        at paperman.report.ui.LaporanKartuBayar.access$000(LaporanKartuBayar.java:31)
        at paperman.report.ui.LaporanKartuBayar$1.actionPerformed(LaporanKartuBayar.java:109)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6263)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
        at java.awt.Component.processEvent(Component.java:6028)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at net.sf.jasperreports.swing.JRViewerPanel.setFitWidthZoomRatio(JRViewerPanel.java:1091)
        at net.sf.jasperreports.swing.JRViewer.setFitWidthZoomRatio(JRViewer.java:224)
        at paperman.report.ui.LaporanKartuBayar.btnMuatActionPerformed(LaporanKartuBayar.java:216)
        at paperman.report.ui.LaporanKartuBayar.access$000(LaporanKartuBayar.java:31)
        at paperman.report.ui.LaporanKartuBayar$1.actionPerformed(LaporanKartuBayar.java:109)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6263)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
        at java.awt.Component.processEvent(Component.java:6028)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4630)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


File ReportServiceImpl.java saya spt ini :

 public JasperPrint getKartuPembayaranReport(Integer lambung, Date dateAwal, Date dateAkhir) {
        try {
            List<KartuBayarReport> ListKartuBayarReport = sessionFactory.getCurrentSession().createQuery("select std.setor_map.counter_setoran as setKe, "
                    + "std.setor_map.tglJatuhTempo as tglJatuhTempo, std.setor_map.tglSPO as tglSPO, std.angsuran as angsuran, std.tabungan as tabungan, std.kasbon as kasbon, "
                    + "std.bayar as bayarKasbon, std.KS as cicilanKas, std.ovtime as overtime, std.setor_map.totalSetoran as totalAngsur, std.ket as keterangan "
                    + "from setoranDetail std "
                    + "where std.kemudi.kend.noLambung=:lb and std.setor_map.tglSPO >=:start and std.setor_map.tglSPO <=:end order by std.setor_map.counter_setoran ASC")
                    .setInteger("lb", lambung)
                    .setDate("start", dateAwal)
                    .setDate("end", dateAkhir)
                    .setResultTransformer(Transformers.aliasToBean(KartuBayarReport.class))
                    .list();

            InputStream reportClassURL = ReportServiceImpl.class.getResourceAsStream("/paperman/report/LaporanKartuPembayaran.jasper");
            InputStream subReportURL = ReportServiceImpl.class.getResourceAsStream("/paperman/report/saldoAwalKartuBayar.jasper");
            Connection conn = sessionFactory.getCurrentSession().connection();
            try {
                System.out.println("Connection : " + conn.getMetaData().getURL().toString());
            } catch (SQLException ex) {
                Logger.getLogger(ReportServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
            }
            Map<String, Object> parameters = new HashMap<String, Object>();
            parameters.put("lambung", lambung);
            parameters.put("dateAwal", dateAwal);
            parameters.put("dateAkhir", dateAkhir);
            parameters.put("JDBC_CONNECTION", conn);
            parameters.put("SUBREPORT_DIR", subReportURL);
            System.out.println("sub report dir = " +subReportURL);

            return JasperFillManager.fillReport(reportClassURL, parameters, new JRBeanCollectionDataSource(ListKartuBayarReport));
        } catch (JRException ex) {
            Logger.getLogger(ReportServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

Pemanggilan Report dengan file LaporanKartuBayar.java :

   private void btnMuatActionPerformed(java.awt.event.ActionEvent evt) {                                       
        JasperPrint getReport = new JasperPrint();
        getReport = Main.getReportService().getKartuPembayaranReport(new Integer(txtLambung.getText()), dateAwal.getDate(), dateAkhir.getDate());
        DateTime(st.getIdClosing().getPeriodeBulan()).dayOfMonth().getMinimumValue()).plusMonths(1).toDate());
        DateTime(st.getIdClosing().getPeriodeBulan()).dayOfMonth().getMaximumValue()).plusMonths(1).toDate());

        JRViewer reportInstance = new JRViewer(getReport);
        reportInstance.setFitWidthZoomRatio();
        reportInstance.setBounds(this.getBounds());
        reportInstance.setSize(pnlReport.getSize());
        reportInstance.setVisible(true);
        pnlReport.removeAll();
        pnlReport.add(reportInstance, BorderLayout.CENTER);
        pnlReport.updateUI();

Report yang di tuju = LaporanKartuPembayaran.jasper, di dalamnya ada sub report =  saldoAwalKartuBayar.jasper,
parameter yang di gunakan :

LaporanKartuBayar.jasper :
~ dateAwal    java.util.Date
~ dateAkhir   java.util.Date
~ lambung    java.lang.Integer
~ SUBREPORT_DIR  java.lang.String
~ JDBC_CONNECTION   java.sql.Connection

saldoAwalKartuBayar.jasper :
~ dateAwal    java.util.Date
~ lambung    java.lang.Integer
~ SUBREPORT_DIR  java.lang.String

Saya bingung, mengambil absolute path untuk sub report yang dilempar dengan parameter SUBREPORT_DIR, bagaimana caranya agar path yang dibaca berada dalam folder "{nama-project}/src"

Terima kasih atas bantuan para master.


Muhammad Taufik
[hidden email]
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [TANYA] Bagaiman Mengirim Absolute Path Agar Sub Report Bisa Dijalankan Di Banyak Komputer?

Endy Muhardin
Errornya di sini nih :

InputStream subReportURL = ReportServiceImpl.class.getResourceAsStream("/
paperman/report/saldoAwalKartuBayar.jasper");

getResourceAsStream itu mencari dari classpath.
Yang paling gampang sih, jaspernya masukkan ke jar file, di dalam folder
/paperman/report

Asal jarnya bisa kebaca sama aplikasi (misalnya ditempat yang sama dengan
jar mysql dsb), maka file jaspernya juga bisa kebaca.

Endy Muhardin
http://software.endy.muhardin.com


On Mon, Oct 22, 2012 at 8:29 AM, MUHAMMAD TAUFIK
<[hidden email]>wrote:

> **
>
>
> Salam para master java, saya sedang bikin program pos kecil2an, saya buat
> laporan penjualan dengan element sub report di dalamnya, ketika saya build
> n run di komputer yg saya gunakan, bisa jalan, tp saat di run di komputer
> lain keluar error seperti ini :
>
> net.sf.jasperreports.engine.JRException: Resource not found at :
> [hidden email]
>         at
> net.sf.jasperreports.repo.RepositoryUtil.getResource(RepositoryUtil.java:155)
>         at
> net.sf.jasperreports.repo.RepositoryUtil.getReport(RepositoryUtil.java:126)
>         at
> net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateReport(JRFillSubreport.java:317)
>         at
> net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:347)
>         at
> net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:275)
>         at
> net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:257)
>         at
> net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:473)
>         at
> net.sf.jasperreports.engine.fill.JRVerticalFiller.fillBandNoOverflow(JRVerticalFiller.java:434)
>         at
> net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVerticalFiller.java:398)
>         at
> net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:259)
>         at
> net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
>         at
> net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836)
>         at
> net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:765)
>         at
> net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)
>         at
> net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
>         at
> net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:605)
>         at
> paperman.service.impl.ReportServiceImpl.getKartuPembayaranReport(ReportServiceImpl.java:117)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
>         at
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
>         at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
>         at
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
>         at
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>         at
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>         at $Proxy21.getKartuPembayaranReport(Unknown Source)
>         at
> paperman.report.ui.LaporanKartuBayar.btnMuatActionPerformed(LaporanKartuBayar.java:211)
>         at
> paperman.report.ui.LaporanKartuBayar.access$000(LaporanKartuBayar.java:31)
>         at
> paperman.report.ui.LaporanKartuBayar$1.actionPerformed(LaporanKartuBayar.java:109)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
>         at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
>         at java.awt.Component.processMouseEvent(Component.java:6263)
>         at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
>         at java.awt.Component.processEvent(Component.java:6028)
>         at java.awt.Container.processEvent(Container.java:2041)
>         at java.awt.Component.dispatchEventImpl(Component.java:4630)
>         at java.awt.Container.dispatchEventImpl(Container.java:2099)
>         at java.awt.Component.dispatchEvent(Component.java:4460)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
>         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
>         at java.awt.Container.dispatchEventImpl(Container.java:2085)
>         at java.awt.Window.dispatchEventImpl(Window.java:2475)
>         at java.awt.Component.dispatchEvent(Component.java:4460)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
>         at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
>         at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
>         at
> net.sf.jasperreports.swing.JRViewerPanel.setFitWidthZoomRatio(JRViewerPanel.java:1091)
>         at
> net.sf.jasperreports.swing.JRViewer.setFitWidthZoomRatio(JRViewer.java:224)
>         at
> paperman.report.ui.LaporanKartuBayar.btnMuatActionPerformed(LaporanKartuBayar.java:216)
>         at
> paperman.report.ui.LaporanKartuBayar.access$000(LaporanKartuBayar.java:31)
>         at
> paperman.report.ui.LaporanKartuBayar$1.actionPerformed(LaporanKartuBayar.java:109)
>         at
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
>         at
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
>         at
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
>         at
> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
>         at
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
>         at java.awt.Component.processMouseEvent(Component.java:6263)
>         at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
>         at java.awt.Component.processEvent(Component.java:6028)
>         at java.awt.Container.processEvent(Container.java:2041)
>         at java.awt.Component.dispatchEventImpl(Component.java:4630)
>         at java.awt.Container.dispatchEventImpl(Container.java:2099)
>         at java.awt.Component.dispatchEvent(Component.java:4460)
>         at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
>         at
> java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
>         at
> java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
>         at java.awt.Container.dispatchEventImpl(Container.java:2085)
>         at java.awt.Window.dispatchEventImpl(Window.java:2475)
>         at java.awt.Component.dispatchEvent(Component.java:4460)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
>         at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
>         at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
>
> File ReportServiceImpl.java saya spt ini :
>
>  public JasperPrint getKartuPembayaranReport(Integer lambung, Date
> dateAwal, Date dateAkhir) {
>         try {
>             List<KartuBayarReport> ListKartuBayarReport =
> sessionFactory.getCurrentSession().createQuery("select
> std.setor_map.counter_setoran as setKe, "
>                     + "std.setor_map.tglJatuhTempo as tglJatuhTempo,
> std.setor_map.tglSPO as tglSPO, std.angsuran as angsuran, std.tabungan as
> tabungan, std.kasbon as kasbon, "
>                     + "std.bayar as bayarKasbon, std.KS as cicilanKas,
> std.ovtime as overtime, std.setor_map.totalSetoran as totalAngsur, std.ket
> as keterangan "
>                     + "from setoranDetail std "
>                     + "where std.kemudi.kend.noLambung=:lb and
> std.setor_map.tglSPO >=:start and std.setor_map.tglSPO <=:end order by
> std.setor_map.counter_setoran ASC")
>                     .setInteger("lb", lambung)
>                     .setDate("start", dateAwal)
>                     .setDate("end", dateAkhir)
>
> .setResultTransformer(Transformers.aliasToBean(KartuBayarReport.class))
>                     .list();
>
>             InputStream reportClassURL =
> ReportServiceImpl.class.getResourceAsStream("/paperman/report/LaporanKartuPembayaran.jasper");
>             InputStream subReportURL =
> ReportServiceImpl.class.getResourceAsStream("/paperman/report/saldoAwalKartuBayar.jasper");
>             Connection conn =
> sessionFactory.getCurrentSession().connection();
>             try {
>                 System.out.println("Connection : " +
> conn.getMetaData().getURL().toString());
>             } catch (SQLException ex) {
>
> Logger.getLogger(ReportServiceImpl.class.getName()).log(Level.SEVERE, null,
> ex);
>             }
>             Map<String, Object> parameters = new HashMap<String, Object>();
>             parameters.put("lambung", lambung);
>             parameters.put("dateAwal", dateAwal);
>             parameters.put("dateAkhir", dateAkhir);
>             parameters.put("JDBC_CONNECTION", conn);
>             parameters.put("SUBREPORT_DIR", subReportURL);
>             System.out.println("sub report dir = " +subReportURL);
>
>             return JasperFillManager.fillReport(reportClassURL,
> parameters, new JRBeanCollectionDataSource(ListKartuBayarReport));
>         } catch (JRException ex) {
>
> Logger.getLogger(ReportServiceImpl.class.getName()).log(Level.SEVERE, null,
> ex);
>         }
>         return null;
>     }
>
> Pemanggilan Report dengan file LaporanKartuBayar.java :
>
>    private void btnMuatActionPerformed(java.awt.event.ActionEvent evt)
> {
>         JasperPrint getReport = new JasperPrint();
>         getReport = Main.getReportService().getKartuPembayaranReport(new
> Integer(txtLambung.getText()), dateAwal.getDate(), dateAkhir.getDate());
>
> DateTime(st.getIdClosing().getPeriodeBulan()).dayOfMonth().getMinimumValue()).plusMonths(1).toDate());
>
> DateTime(st.getIdClosing().getPeriodeBulan()).dayOfMonth().getMaximumValue()).plusMonths(1).toDate());
>
>         JRViewer reportInstance = new JRViewer(getReport);
>         reportInstance.setFitWidthZoomRatio();
>         reportInstance.setBounds(this.getBounds());
>         reportInstance.setSize(pnlReport.getSize());
>         reportInstance.setVisible(true);
>         pnlReport.removeAll();
>         pnlReport.add(reportInstance, BorderLayout.CENTER);
>         pnlReport.updateUI();
>
> Report yang di tuju = LaporanKartuPembayaran.jasper, di dalamnya ada sub
> report =  saldoAwalKartuBayar.jasper,
> parameter yang di gunakan :
>
> LaporanKartuBayar.jasper :
> ~ dateAwal    java.util.Date
> ~ dateAkhir   java.util.Date
> ~ lambung    java.lang.Integer
> ~ SUBREPORT_DIR  java.lang.String
> ~ JDBC_CONNECTION   java.sql.Connection
>
> saldoAwalKartuBayar.jasper :
> ~ dateAwal    java.util.Date
> ~ lambung    java.lang.Integer
> ~ SUBREPORT_DIR  java.lang.String
>
> Saya bingung, mengambil absolute path untuk sub report yang dilempar
> dengan parameter SUBREPORT_DIR, bagaimana caranya agar path yang dibaca
> berada dalam folder "{nama-project}/src"
>
> Terima kasih atas bantuan para master.
>
> Muhammad Taufik
> [hidden email]
> [hidden email]
>
>  
>