Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 21
Braincode mempunyai hidup yang Normal
Default [AskHelp] (JSP) Help Jasper export PDF detail ngk keluar?

Hi Semuanya,



saya baru di forum ini, kebetulan saya baru dgn Ireport / Jasper...mohon pencerahannya senior".



Begini nih..saya ada buat JSP dgn servlet buat export jaspert ke pdf....semua berjalan dengan lancar...kecuali detilnya kok ngk keluar ya? datasource sudah benar...ngk ada error di console jg....dan anehnya...kalo field di detailnya saya pindah ke Column header atau summary (diluar section detail) Keluar recordnya yg terakhir..



codenya seperti ini :




Code:

String filename = request.getParameter("report");
PreparedStatement stm = null;
ResultSet rs = null;
String fileconfig = getServletConfig().getServletContext().getRealPath ("WEB-INF/rho.tcs.pusat.cfg");
DataTable dtb;

ReportConnection RC = new ReportConnection();
RC.createConnection(fileconfig);
try{
Session s = RC.getSessionFactory().openSession();
// dtb = s.executeDataTable("SELECT NAMA FROM SISWA");
//dsListMateri ds = new dsListMateri(dtb);
stm = s.prepareStatement("SELECT NAMA FROM SISWA");
rs = stm.executeQuery();


InputStream inputStream = getServletConfig().getServletContext().getResource AsStream("/reports/" + filename);
ServletOutputStream servletOutPutStream = response.getOutputStream();


Map parameters = new HashMap();
parameters.put("NO_POKOK", "002");

JRResultSetDataSource oDs = new JRResultSetDataSource(rs);
//JRPdfExporter exporter = new JRPdfExporter();
// exporter.setParameter(JRPdfExporterParameter.FORCE _LINEBREAK_POLICY,Boolean.TRUE);

JasperRunManager.runReportToPdfStream(inputStream, servletOutPutStream,parameters,oDs);
response.setContentType("application/pdf");
servletOutPutStream.flush();
servletOutPutStream.close();
rs.close();
stm.close();
s.close();

}catch(SQLException e)
{
System.out.println(e.getMessage());
}catch(JRException e){
System.out.println("[ERROR]-[REPORT-JASPER] " + e.getMessage());
}

Mohon pencerahannya semua...saya sudah 3 hari puter" coba" dan belum ketemu solusinya..saya juga sertakan imagenya...sebelumnya saya ucapkan banyak terimakasih.



Harris









</div>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Terkait
Thread Thread Starter Forum Replies Last Post
detail KLX 150 Motorplus Motor 0 20th October 2012 06:33 PM
JUAL Id GETA Detail 60,+ Playstation4 Permainan & Games 0 29th September 2012 12:49 PM
JUAL Miniatur Alat Musik (More Detail n Bigger Size) EXPORT QUALITY MLTR-fans Alat Musik 0 26th September 2012 02:04 AM
Jual Baju Sisa Export Branded Murah Untuk Anak dan Dewasa Kualitas Export arigat0 Baju Anak 0 16th September 2012 12:03 PM

 


All times are GMT +7. The time now is 06:52 PM.