Jump to content
We've recently updated our Privacy Statement, available here ×

wfgst

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by wfgst

  1. Hi, i'm new to Jasper Reports (and Java in general) and i'm VERY lost in the procedure of populating the report with data, not from a SQL query but from java variables. My report has only the 'title' and 'content' fields, both strings. The report contains two fields, "$F{title}" and "$F{content}". I'm trying to populate them with the following code: URL urlToFile = getClass().getResource("/jrSingleReport.jrxml"); InputStream reportXml = new FileInputStream(urlToFile.getFile()); JREmptyDataSource S = new JREmptyDataSource(); JasperDesign D = JRXmlLoader.load(reportXml); Map paramsReport = new HashMap(); paramsReport.put("title", "example title"); paramsReport.put("content", "dummy content"); JasperReport R = JasperCompileManager.compileReport(D); JasperPrint P = JasperFillManager.fillReport(R, paramsReport, S); JasperViewer V = new JasperViewer(P); V.setVisible(true); What i'm trying to get is a report with the words "example title" and "dummy content" and view it with the built-in viewer. But this code reports that it can't find "title" and "content" Please, can anyone give me some light in this issue? I'm having a very hard time trying to understand how JR works in this case. Post Edited by wladimir_f at 06/18/2012 22:04
×
×
  • Create New...