Jump to content
Changes to the Jaspersoft community edition download ×

vattembhaskar

Members
  • Posts

    22
  • Joined

  • Last visited

vattembhaskar's Achievements

Explorer

Explorer (4/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Hello, i too want this...let me know whether it is working or not?...and is there any solution?
  2. Hello mdahlman , thanx for ur reply but do you know the difference between Series and Category expressions exactly?..let me know that at first...i am newer for this that's why i am asking this .. Thanx in advance, vijay
  3. 1.For connection as well as for DataSource ....... write an Java bean class and you must have a factory method in that Bean class and this static method should return a Collection of Beans/Array of Beans of type of Current Java Bean[i think you know about Factory class] ... and set this bean .class file path under CLASSPATH in your iReport tool and create a connection and follow below 2nd point to get fields.. 2.For Datasource only ...... set this bean .class file path under CLASSPATH in your iReport tool and -> select ReportQuery under Data option ->click JavaBeanDataSource button give the complete pakaged path for your class and select your needed fields... ..... *I am also new to this and I did like this way only..and let me know whether it is okay or not and is there any alternative?
  4. File file = new File("C:/VijayReport/SampWithPara.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(file); JRTextExporter pdfExporter = new JRTextExporter(); pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); pdfExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,"C:/VijayReport/SampWithPara.txt"); pdfExporter.setParameter(JRTextExporterParameter.CHARACTER_WIDTH,new Integer(10)); pdfExporter.setParameter(JRTextExporterParameter.CHARACTER_HEIGHT, new Integer(10)); System.out.println("Exporting report..."); pdfExporter.exportReport(); System.out.println("Done!"); Go through the above code will be helpful.....
  5. I added the following jar files...but i am getting one more error: C:Program FilesJasperSoftiReport-3.0.0libjasperreports-3.0.0.jar; C:Program FilesJasperSoftiReport-3.0.0libcommons-digester-1.7.jar; C:Program FilesJasperSoftiReport-3.0.0libcommons-collections-3.1.jar; C:Program FilesJasperSoftiReport-3.0.0libcommons-logging-1.0.2.jar; C:Program FilesJasperSoftiReport-3.0.0libcommons-beanutils-1.7.jar; C:Program FilesJasperSoftiReport-3.0.0libitext-1.3.1.jar; C:VijayReportmysql-connector-java-5.0.4.jar; C:Program FilesJavajdk1.6.0_06libservlet-api-2.3.jar; C:Program FilesJasperSoftiReport-3.0.0libjfreechart-1.0.3.jar; C:Program FilesJasperSoftiReport-3.0.0libcommons-codec-1.3.jar; C:VijayReportThroughDataSourcesjcommon.jar ERROR IS: NoSuchMethod error..at org.jfree.ui.RectangleInsets.<init><DDDD>V why it is?...let me know...thanx for ur reply Post Edited by VijayaBhaskar.Vatte Reddy at 03/20/09 13:17 Post Edited by VijayaBhaskar.Vatte Reddy at 03/20/09 13:18
  6. My source is... import net.sf.jasperreports.engine.JRDataSource; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; import net.sf.jasperreports.engine.JREmptyDataSource; import java.util.HashMap; import java.io.*; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.export.JRTextExporter; import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.engine.export.JRTextExporter; import net.sf.jasperreports.engine.export.JRTextExporterParameter; import net.sf.jasperreports.engine.export.JRPdfExporter; import net.sf.jasperreports.engine.export.JRPdfExporterParameter; import java.util.ArrayList; import java.util.List; import java.sql.*; import org.jfree.util.PublicCloneable; import java.io.File; class ChartDeliver implements Cloneable,Serializable { Connection conn; public void withParams(String id){ try{ //System.out.println("Compiling report..."); JasperCompileManager.compileReportToFile("C:/VijayReport/ThroughDataSources/ReportHeader.jrxml"); JasperCompileManager.compileReportToFile("C:/VijayReport/ThroughDataSources/ChartsSubReport.jrxml"); JasperCompileManager.compileReportToFile("C:/VijayReport/ThroughDataSources/Charts3.jrxml"); JasperCompileManager.compileReportToFile("C:/VijayReport/ThroughDataSources/BarChartsSubReport.jrxml"); JasperCompileManager.compileReportToFile("C:/VijayReport/ThroughDataSources/ChartsJB.jrxml"); System.out.println("Compilation is Done!"); Long myId=Long.parseLong(id); AgreementInfo obj=new AgreementInfo(); obj.setVarId(myId); List<AgreementInfo> obj2=new AgreementInfo().testGetAgreementList(); JRDataSource jrd=new JRBeanCollectionDataSource(obj2); JasperFillManager.fillReportToFile("C:/VijayReport/ThroughDataSources/ChartsJB.jasper","C:/VijayReport/ThroughDataSources/ChartsJB.jrprint", new HashMap(), jrd); System.out.println("Filling the report is Done!"); System.out.println("Started to exprot!"); File file = new File("C:/VijayReport/ThroughDataSources/ChartsJB.jrprint"); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(file); JRPdfExporter pdfExporter=new JRPdfExporter(); pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); pdfExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,"C:/VijayReport/ThroughDataSources/ChartsJB.pdf"); System.out.println("Exporting report..."); pdfExporter.exportReport(); System.out.println("Done!"); } catch (Exception e){ System.out.println(e); } } public static void main(String atr[]) throws JRException,FileNotFoundException,SQLException,ClassNotFoundException,IOException{ new ChartDeliver().withParams(atr[0]); } } Exception is........ NoSuchMoethod exception of like this....at org.jfreeui.RectangleInsets.<init><DDDD>v Post Edited by VijayaBhaskar.Vatte Reddy at 03/20/09 13:20
  7. Exception in thread "main" java.lang.NoClassDefFoundError: org/jfree/util/Public Cloneable at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12 4) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at net.sf.jasperreports.engine.fill.JRFillObjectFactory.visitChart(JRFil lObjectFactory.java:715) at net.sf.jasperreports.engine.base.JRBaseChart.visit(JRBaseChart.java:6 05) at net.sf.jasperreports.engine.JRAbstractObjectFactory.getVisitResult(JR AbstractObjectFactory.java:91) at net.sf.jasperreports.engine.fill.JRFillElementGroup.<init>(JRFillElem entGroup.java:86) at net.sf.jasperreports.engine.fill.JRFillElementContainer.<init>(JRFill ElementContainer.java:91) at net.sf.jasperreports.engine.fill.JRFillBand.<init>(JRFillBand.java:87 ) at net.sf.jasperreports.engine.fill.JRFillObjectFactory.getBand(JRFillOb jectFactory.java:518) at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.jav a:528) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFi ller.java:77) at net.sf.jasperreports.engine.fill.JRFillSubreport.initSubreportFiller( JRFillSubreport.java:384) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JR FillSubreport.java:358) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubre port.java:259) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFi llElementContainer.java:275) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java: 426) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVe rticalFiller.java:1380) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVertic alFiller.java:692) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRV erticalFiller.java:255) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVertic alFiller.java:113) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java: 879) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java: 801) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89 ) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa nager.java:601) at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(Jasper FillManager.java:492) at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(Jasper FillManager.java:472) at ChartDeliver.withParams(ChartDeliver.java:42) at ChartDeliver.main(ChartDeliver.java:63) Caused by: java.lang.ClassNotFoundException: org.jfree.util.PublicCloneable at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) ... 38 more
  8. Hi ,i am new to this...i don't know about this expression $P!{TABLE_NAME}..what it will do??..can you explain me about that..?? Thanx in advance, vijay
  9. Ya! i too did recently this..but i did this one as taking that chart as subreport and gave DataSource as JRBeanCollection(Chart bean field List from Main report bean datasource)...
  10. i am not sure about ur question perfectly...but if u want to print some information of main report in first page[i think ur's main report data also in detail band] and subreport's information in second page try to increase your detail band height and place your subreport at bottom in detail band according to ur's wish to place....i think this will helpful even litle bit...
  11. Sorry, it was already solved...question is wrong.. Post Edited by VijayaBhaskar.Vatte Reddy at 03/18/09 14:30 Post Edited by VijayaBhaskar.Vatte Reddy at 03/18/09 14:36
  12. Hi friends, i am using a Bean object as my DataSource in that Bean class i took one ArrayList(which refers the result of detail entity i.e other java bean class's result) and i am giving my main BEAN as my DataSource while creating connection in iReport and upto this is okay...I provided factory method and all to get connection...and inside that factory method i filled the detail entity bean data through setters and added that result to the main BEAN ArrayList ...upto this is okay.....but the actual problem is here..i am setting the data as static data to the details fields through setters but i want to set the data DYNAMICALLY ...how is it possible?....i.e mainly i want to fill the detail bean's fields with DYNAMICALLY in Main BEAN how is it possible??? please let me know any possible ways ....it's an urgent requirement to me plzzzzz help me in this...any idea will be welcome... ex code: i set the data as MainJavaClass info = new MainJavaClass(); SubJavaClass detail = new SubJavaClass();// detail entity detail.setScheduleSerial(1);// FROM HERE I WANT TO SET THE DATA AS DYNAMICALLY HOW??????? detail.setDueDate(new Date()); detail.setInstallmentAmount(null); detail.setReceivedAmount(7031d); detail.setPrincipalAmount(2031d); detail.setPrincipalAmountReceived(2031d); detail.setInterestAmount(5000d); detail.setInterestAmountReceived(5000d); detail.setBalancePrincipal(1000000d); info.getScheduleDetails().add(detail); Thanx in advance, Vijay
  13. Yes boss! i tried even this also by increasing width and removing label rotation value and all...but not...but how can we get this exactly[with out depend on your specified parameters]...?
  14. Thanx to ur reply i tried but it is not coming...can u give me another way to try?
  15. Hi to all, while i am generating BAR chart the category axis lables are not in well form i.e they are not directly under the series ...slightly thay are beside to them...plz resolve this,how can i get label as correctly under the figure... Thanx in advance, Vijay.. Code:<?xml version="1.0" encoding="UTF-8" ?><!-- Created with iReport - A designer for JasperReports --><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="BarChartsSubReport" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <field name="accountsOpened" class="java.lang.Long"> <fieldDescription><![CDATA[accountsOpened]]></fieldDescription> </field> <field name="month" class="java.lang.String"> <fieldDescription><![CDATA[month]]></fieldDescription> </field> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="0" isSplitAllowed="true" > </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="411" isSplitAllowed="true" > <barChart> <chart hyperlinkTarget="Self" > <reportElement x="0" y="97" width="535" height="253" key="element-1" positionType="Float"/> <box></box> <chartLegend textColor="#000000" backgroundColor="#FFFFFF" > </chartLegend> </chart> <categoryDataset> <dataset > </dataset> <categorySeries> <seriesExpression><![CDATA[$F{month}]]></seriesExpression> <categoryExpression><![CDATA[$F{month}]]></categoryExpression> <valueExpression><![CDATA[$F{accountsOpened}]]></valueExpression> <itemHyperlink > </itemHyperlink> </categorySeries> </categoryDataset> <barPlot isShowTickMarks="false" > <plot labelRotation="100.0" /> <categoryAxisFormat> <axisFormat tickLabelColor="#009999" > </axisFormat> </categoryAxisFormat> <valueAxisFormat> <axisFormat > </axisFormat> </valueAxisFormat> </barPlot> </barChart> <staticText> <reportElement x="0" y="50" width="358" height="30" key="staticText-1"/> <box></box> <textElement> <font pdfFontName="Helvetica-Bold" size="14" isBold="true" isUnderline="true"/> </textElement> <text><![CDATA[bar Charts:]]></text> </staticText> </band> </summary></jasperReport>
×
×
  • Create New...