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

daseparo

Members
  • Posts

    8
  • Joined

  • Last visited

daseparo's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. thanks, that works very well. I used to put subreport in footer bands but that didn't work. Post Edited by daseparo at 09/04/2009 11:21
  2. Hy, I'm beginner in JasperReports, maybe this problem is trivial. I don't know. I have master reposrt and subreport. Datasource is XML. In master report in Detail1 band i have 3 fields that represent one parent node from XML. That fields repeats many times. But in Detail2 band i have subreport that takes some other data from other node in that XML file. Problem is that if i have 4-5 nodes in master report that subreport is also printed 4-5 times. I want that first all data from Masterreport is printed, and after that i want subreport only once. (I can put subreport to page footer but it is also dynamic and i don't know how height will be.) sorry for bad english Post Edited by daseparo at 09/04/2009 10:46
  3. Hi, i create report with some calculations in scriplet. When i run report in iReport 2.0.4 everything is ok, variable calculation is perfect. But, when i run report from java application it shows me only variable initial value. It looks like my calculation in scriplet is not working, (or app only shows initial value of variable) but my return value is showing in some other field where is required. Please if anyone knows what can be problem. I even try first to compile report in java application, and compiler, and execution of application didn't throw any warning,exception or error. Here is example of my scriplet code. Code: public class kupovinaScriptlet extends JRAbstractScriptlet { /** Creates a new instance of JRIreportDefaultScriptlet */ public kupovinaScriptlet() { } public String popuni() throws JRScriptletException { java.lang.Long tr=(java.lang.Long)getFieldValue("transbaza_RBRKupca"«»); java.lang.Long br=(java.lang.Long)getParameterValue("parametar"«»); java.lang.Long stanje=(java.lang.Long)getVariableValue("temp"«»); java.lang.Long iznos=(java.lang.Long)getFieldValue("transbaza_IznosTransakcije"«»); if(tr==br) { //java.lang.Long rez=stanje+iznos; this.setVariableValue(temp,stanje+iznos); return "+" ; } else { //java.lang.Long rez=stanje-iznos; this.setVariableValue(temp,stanje-iznos); return "-"; } }
  4. I used scriplet and solve everything with few lines of code. I surprised to see how easy is writing scriplets. for reports.
  5. Hi, I need advice from experience users (I am still newbie). Is it better(for app performance) to create report with his own query, or make query in application, then pass results of query in hash map when calling report from application. I think that it is better that report has own query, but i don't know if "engine" in jasperreport for working with databases is good enough. Thanks in advance for your answers.
  6. Hi, My problem is more about sql logic and working with result of query. I am new in using this report engine so i still don't know many advantages. Please help me. First, i want to say that my english writing is bad, so forgive me about mistakes made in this text. Problem: It is about stock trading in one firm. I have 2 tables in Mysql base. One is all peoples and companies who bought stocks of that firm. In the second table I have transaction history. Id of seller an buyer(from first table) and how many stocks (amount) were included in that transaction(3 fields). Other fields are not necessary at this moment. I make report where you choose one person, and you can see history of all transaction order by date and name of the second side in that transaction. I use: SELECT * FROM tabletrans , tablepersons WHERE (tabletrans.IDBuyer=? AND tablepersons.ID=tabletrans.IDSeller) OR (tabletrans.IDSeller=? AND tablepersons.ID=tabletrans.IDBuyer) But my problem is that in that report you cannot easy see what transaction was. Did you bought or sold stock. I'm interested if there is way that i inspect my results and depend on where is id of person (you want to see history for, if is in the seller or buyer id column) add aditional field where i explain nature of transaction for that person, or just make amount negative or positive depend on seling or buying. I kind solve this problem with two kind of report, but my boss doesn't like them. :-). He wants the way i explain before. First report i make is with 2 lists. First when you(means person you choose) buying and second is when you selling. And second report is where i make list off all transactions and put seller and buyer id in that list, second side name,surname and id. I also put in report title person name and id. So when you reading report you have to see what is person id, and in the list of transaction find it in idbuyer or idseller column.
  7. Hi, My problem is more about sql logic and working with result of query. I am new in using this report engine so i still don't know many advantages. Please help me. First, i want to say that my english writing is bad, so forgive me about mistakes made in this text. Problem: It is about stock trading in one firm. I have 2 tables in Mysql base. One is all peoples and companies who bought stocks of that firm. In the second table I have transaction history. Id of seller an buyer(from first table) and how many stocks (amount) were included in that transaction(3 fields). Other fields are not necessary at this moment. I make report where you choose one person, and you can see history of all transaction order by date and name of the second side in that transaction. I use: SELECT * FROM tabletrans , tablepersons WHERE (tabletrans.IDBuyer=? AND tablepersons.ID=tabletrans.IDSeller) OR (tabletrans.IDSeller=? AND tablepersons.ID=tabletrans.IDBuyer) But my problem is that in that report you cannot easy see what transaction was. Did you bought or sold stock. I'm interested if there is way that i inspect my results and depend on where is id of person (you want to see history for, if is in the seller or buyer id column) add aditional field where i explain nature of transaction for that person, or just make amount negative or positive depend on seling or buying. I kind solve this problem with two kind of report, but my boss doesn't like them. :-). He wants the way i explain before. First report i make is with 2 lists. First when you(means person you choose) buying and second is when you selling. And second report is where i make list off all transactions and put seller and buyer id in that list, second side name,surname and id. I also put in report title person name and id. So when you reading report you have to see what is person id, and in the list of transaction find it in idbuyer or idseller column.
  8. Hi, I'm new in JasperReports. I install Ireport 2.0.4, and move tools.jar from jdk in home/lib of ireport, and try to compile new blank report. I got this error: Exception in thread "Thread-9" java.lang.NoClassDefFoundError: org/apache/log4j/ Layout at org.apache.commons.logging.impl.Log4jFactory.getInstance(Log4jFactory .java:153) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory Impl.java:285) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409) at org.apache.commons.digester.Digester.<init>(Digester.java:304) at net.sf.jasperreports.engine.xml.JRXmlDigester.<init>(JRXmlDigester.ja va:62) at it.businesslogic.ireport.compiler.xml.SourceTraceDigester.<init>(Sour ceTraceDigester.java:114) at it.businesslogic.ireport.IReportCompiler.createDigester(IReportCompil er.java:2131) at it.businesslogic.ireport.DesignVerifyerThread.verifyDesign(DesignVeri fyerThread.java:141) at it.businesslogic.ireport.DesignVerifyerThread.run(DesignVerifyerThrea d.java:92) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 10 more i have jdk1.6.0_04 ,i report 2.0.4 install, log4j-1.2.9.jar, log4j-1.2.8.jar in my lib file. I even try delete one of log4j.
×
×
  • Create New...