Jump to content

andber

Members
  • Posts

    1
  • Joined

  • Last visited

andber's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I am needing print only a attributes from a object without DB connection and dataset. I have for example the object "Student" and I need print the following attributes: Name Last Name Year I am using the following source code: try { String strFile; Map Data= new HashMap(); Data.put("Name", "Pepe"); Data.put("Lastname", "Perez"); Data.put("Year", "2010"); strFile = "StudentReport.jasper"; JasperReport masterReport = null; masterReport = (JasperReport) JRLoader.loadObject(strFile); JasperPrint jp = JasperFillManager.fillReport(masterReport, Data, new JREmptyDataSource()); JasperViewer view = new JasperViewer(jp,false); view.setTitle("title"); view.setVisible(true); } catch (JRException ex) { Logger.getLogger(ImpApp.class.getName()).log(Level.SEVERE, null, ex); } This code print a withe paper, why? I need this print the data: Pepe Perez 2010 How I can do that? Thanks in advance, Andrés.
×
×
  • Create New...