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

shanthusharma

Members
  • Posts

    3
  • Joined

  • Last visited

shanthusharma'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 have a .jrxml file, its got data from .csv file. all are working properly. and also i saved the output into .pdf file. but now i got a problem. when i tried to call my pdf file into java swing using jeditorpane. setpage(). its wont display some times its display the no protocol error at run time. My problem is I want to display the pdf fill, when i click the button in java, it has to display. Can any one guide the correct way this is the coding try{ JRCsvDataSource jcvs; char fieldDelimiter = '~'; String recordDelimiter = "n"; String outFileName ="Drep.pdf"; URL csvurl = getClass().getResource("drep.csv"); String csvpath = csvurl.getPath().replaceAll("%20"," "); File csv = new File(csvpath); jcvs = new JRCsvDataSource(new File(csv.getAbsolutePath())); jcvs.setFieldDelimiter(fieldDelimiter); jcvs.setRecordDelimiter(recordDelimiter); jcvs.setUseFirstRowAsHeader(true); URL jasurl = getClass().getResource("DRep.jasper"); String jaspath = jasurl.getPath().replaceAll("%20"," "); JasperPrint jasperPrint = JasperFillManager.fillReport(jaspath,null,jcvs); JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT,jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outFileName); exporter.exportReport(); URL rurl = getClass().getResource("Dpooja.pdf"); jedPan.setPage(rurl); } Thanks i advance
  2. i have more than one report (.jrxml), each have its own datasource all are CSV files. When i tried to run each file its always takes the default datasource. i want to change the datasource at runtime otherwise it should takes its own datasource at aevery time. thanks in advance
  3. hello, if ur using the mysql database then have to download the folling jar file. and include in ur project. mysql-connector-java-5.0.4-bin.jar its may working. add all the necessary jar file before u compile the .jrxml. its working good in ireport alone, if u use any editor like netbean u have to add the jar files in the libraries.
×
×
  • Create New...