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

som15129

Members
  • Posts

    1
  • Joined

  • Last visited

som15129'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. Hi, I a new user in iReport dont know how to run *.jasper (generated by iReport) reporting files from Swing/Java . Hve U any sample code plzz give me the code. ====================================== I execute a prog. At compile time its okey but at runtime it gives too errors... ====MY CODE====== import net.sf.jasperreports.engine.*; import net.sf.jasperreports.engine.export.*; import java.util.*; public class JasperTest { public static void main(String[] args) { String fileName = "test.jasper"; String outFileName = "test.pdf"; HashMap hm = new HashMap(); hm.put("name","Som15129"); try { JasperPrint print = JasperFillManager.fillReport( fileName, hm, new JREmptyDataSource()); JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter(); exporter.setParameter( JRExporterParameter.OUTPUT_FILE_NAME, outFileName); exporter.setParameter( JRExporterParameter.JASPER_PRINT,print); exporter.exportReport(); System.out.println("Created file: " + outFileName); } catch (JRException e) { e.printStackTrace(); System.exit(1); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }} ...........Exceptions.......... Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lo gging/LogFactory at net.sf.jasperreports.engine.fill.JRFillTextElement.<clinit>(Unknown Source) at net.sf.jasperreports.engine.fill.JRFillObjectFactory.getTextField(Unk nown Source) at net.sf.jasperreports.engine.base.JRBaseTextField.getCopy(Unknown Source) at net.sf.jasperreports.engine.fill.JRFillElementGroup.<init>(Unknown Source) at net.sf.jasperreports.engine.fill.JRFillElementContainer.<init>(Unknow n Source) at net.sf.jasperreports.engine.fill.JRFillBand.<init>(Unknown Source) at net.sf.jasperreports.engine.fill.JRFillObjectFactory.getBand(Unknown Source) at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(Unknown Source) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(Unknown Source) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(Unknown Source) at net.sf.jasperreports.engine.fill.JRFiller.createFiller(Unknown Source ) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(Unknown Source) at net.sf.jasperreports.engine.JasperFillManager.fillReport(Unknown Source) at net.sf.jasperreports.engine.JasperFillManager.fillReport(Unknown Source) at JasperTest.main(JasperTest.java:14) Press any key to continue . . . Post edited by: som15129, at: 2006/10/31 07:41
×
×
  • Create New...