Jump to content
Changes to the Jaspersoft community edition download ×

fsaa

Members
  • Posts

    16
  • Joined

  • Last visited

fsaa's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Hi, I could not understand well what is the problem you're dealing. How many reports do you have and how do you want to pass the datasource for your reports: by parameter or by a connection? If you detail better the situation, I can try to help you. fsaa.
  2. Hi! It seems as if in the right begin of your report, there's a javabean to be printed, but when the report reaches the footer band, there's no more javabean to print. I usually make use of group fields, variables or external parameters in order to put them on page header or page footer bands. I suggest you try one of these ways. good luck!
  3. Hi! As I could see, it is well possible to meet your needs by using iReport. I would like to help you but I got confused what are your doubts. What have you already done? What type of datasource you'll be using? regards fsaa.
  4. Hi! As you didn't mention about the datasource of achild report, it seems as if there is not any definition regarding this item. As I said in the last post, you must specify the datasource of Achild from the A report file, and more specifically, under subreport item properties window. You can pass a parameter as datasource (look my last post) or you can specify a constructor with a field as argument. That's it. I hope it runs. fsaa.
  5. Hi, There are some ways of doing what you want. I will suggest one of them: 1. In the master report: create a parameter, say achildDataSource, in the master report. 2. In A report: you must acess properties of the Achild subreport and specify in the field "Connection/Data Source expression" in the folder "Subreport", the following: - Select "use datasource expression" - Fill in the value as $P{achildDataSource} good luck! fsaa.
  6. Hi, you can create a new connection under menu option "Data - Connection/Data Sources" choosing "Empty data source". It will be asked the name and the number of (imaginary) records. After this, you go on the "connection datasource expression" and put the internal parameter that corresponds to the master report's datasource. Well, this may works. Good luck! fsaa.
  7. Did you try to run your subreport independently of your master report? Did it work?
  8. Lucian, one more thing. I realized that I gave you a wrong information. I tried again to run the report with checking the field "use field description" box and keeping the field just as "descricao" and I got surprised because it simply worked! I really thought that I had already tried and got error when running with/without checking the aforementioned field, but, as I can see, I missed something. Regards
  9. Lucian, that's great. You really solved my problem. Well, by now, the only thing I can do to show my satisfaction is to say thank you very much and increase you karma counting. my best, fsaa.
  10. 1. The answer is no. In fact, as you've wondered, it suffices the field (that I want to use as sorting field) be in the list of fields for the report to undergoe the error. 2. Even though, I think the reason of the problem is not related to the constructor of dataSource. I say this because my test is being run inside iReport environment, i.e., I am using a connection under iReport environment. The problem happens with/without checking the "use field description" check box within the "connection properties" window. 3. I really think the reason is related to the fact that the property I am trying to use in my report is not a field of the class that is being used as the element of the collection (I will reference this class as class-A). The field is from another class (I will call this one as class-C) with which class-A has a indirect relationship, i.e, be using encapsulation concepts. Give a look to the example below: class-A (a1<class-B>, ... other fields) class-B (b1<class-C>, ... other fields) class-C (c1<String>, ... other fields) Note: a1 is of class-B type, b1 is of class-B type and c1 of String type. Class-A is the type of the element in the collection that is being used as datasource. I am trying to use field "c1" as a sort field. I want to stress that if I try to retrieve any field from class-A the report runs without problems. If I try to use any field from other than class-A, the report doesn't run. my best fsaa.
  11. lucianc wrote: I think an example (relevant JRXML fragments, etc) would make the issue easier to understand. Please post the full stacktrace as well. Does the report work if you remove the sort fields? Regards, Lucian Yes, the report runs ok if I remove that field I mentioned. Concerning the example, here we go! I am attaching a zip file containing two JRXML files, one that runs (without the sorting field) and another (with the sorting field) that is getting the error showed in the end of this message. You must know some things about the classes I am working with: 1- The javaBeanCollection object that's being given to the report as its DataSource has elements of the type "MovimentacaoProcesso". One field of this class is of the type "Processo". Inside Processo, there is a field of the type ClasseProcessual. Inside ClasseProcessual there is a field of the type String and its name is "Descricao". This latter field is just the field that when used as sorting field, makes the report to get the error we are talking about. 2- When I try to use any field of MovimentacaoProcesso class, everything goes allright. So, I conclude that the problem just happens when I use as sorting fields those fields that are not directly in the class which is an element of the DataSource, i.e., fields that are being retrieved through the tree of encapsulation. Thank for your help. Best regards! fsaa. THE ERROR LISTING ----------------- Error filling print... Error retrieving field value from bean : descricao net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : descricao at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:116) at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue (JRAbstractBeanDataSource.java:93) at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue (JRBeanCollectionDataSource.java:104) at net.sf.jasperreports.engine.data.JRSortableDataSource.<init> (JRSortableDataSource.java:123) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource (JRFillDataset.java:621) at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters (JRBaseFiller.java:892) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:716) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:688) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:517) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:968) at java.lang.Thread.run (Thread.java:595) Caused by: java.lang.NoSuchMethodException: Unknown property 'descricao' at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122) at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686) at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290) at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:104) ... 12 more Print was not filled. Try using an EmptyDataSource... [file name=reports-ff8969cdbe276f15dcedfb4559e794f8.zip size=2991]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/reports-ff8969cdbe276f15dcedfb4559e794f8.zip[/file]
  12. lucianc wrote: fsaa wrote: When I try to sort by a field that comes with java (String, int, etc) everything works fine. But if I try to put a custom field so an error occur. If you use a field for sorting, its type/class needs to implement java.util.Comparable so that the engine is able to compare and sort field values. HTH, Lucian Lucianc, thank you. It worked. Well, I still have a problem. When I try to put as sort fields those fields that are retrieved from objects references that are encapsulated in the object references inserted in the JavaBeanCollection, then I get the following error: CausedÂby:Âjava.lang.NoSuchMethodException:ÂUnknownÂproperty Bye.
  13. I have a similar problem that also generates a ClassCastException. When I try to sort by a field that comes with java (String, int, etc) everything works fine. But if I try to put a custom field so an error occur. What may it be?
  14. Hi! First, the createBeanCollection method must return a collection of references of objects from the class you want to retrieve fields. So, you must do as follows: ... list.add(object-reference-of-the-class-you-want) ... Second, you must specify in the report query window the path of the class form where you want to retrieve fields. In your example, you used the same class as that you used for the data source factory class. I wish it works!
×
×
  • Create New...