3

I am new to OrientDB and Jasper reports. I have successfully connected the Jasper-soft studio with OrientDB using jdbc driver

enter image description here

But when I query the sample OrientDB Grateful Dead Concerts in Jasper reports, it returns some fields and their class type is com.orientechnologies.orient.core.record.impl.ODocument but I am unable to read those fields' values and getting an error that it can not find this class. I think I am not writing a proper query.

Please it will be great help if someone can provide me the solution. Thank you

Alex K
  • 22,315
  • 19
  • 108
  • 236
Farrukh Cheema
  • 85
  • 1
  • 2
  • 7
  • Can you write the query? Which version of orientDb? thx – Roberto Franchini Dec 30 '15 at 10:13
  • Hi, Thank you . I am using 2.1.7 community edition of orient db and query is simple and basic. SELECT FROM E, Where E is a class of edge. – Farrukh Cheema Dec 30 '15 at 10:38
  • Actually when i use the same query in orientdb it shows results in this format( Please see the screen-shot link). Thee are 3 properties. One is just integer type and i can access it,s data in jaspersoft but other two fields are some kind of rids to other vertices. I can not access these two fields data. I want to get these two vertices data too with edges. Hee is the link to screen-shot (http://i.stack.imgur.com/0HHg8.png) – Farrukh Cheema Dec 30 '15 at 10:48

1 Answers1

1

If the fields are of class com.orientechnologies.orient.core.record.impl.ODocument, you need to declare them as so

<field name="out" class="com.orientechnologies.orient.core.record.impl.ODocument"></field>

To avoid "class not found" you need to included the library (.jar) holding this class orientdb-core-2.2-SNAPSHOT.jar and all other jar's that it is referencing (see distribution).

To include a jar in jaspersoft-studio

Each report is supposed to be part of a project. The project has a classpath, and here is where you should add the jars you need.

To add jar open the projects view and right click the project folder with which you are working on. By default, new reports are created in the project My Reports.

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
  • Thank you for your help. I have resolved the error by following your instructions. But now when i add the out field to a report page to show the data is is giving another error. Here is the error. Caused by: java.lang.ClassCastException: com.orientechnologies.orient.core.record.impl.ODocument cannot be cast to com.orientechnologies.orient.core.record.impl.ODocument at Blank_A4_1451541292746_568150.evaluate(Blank_A4_1451541292746_568150:182) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:277) – Farrukh Cheema Dec 31 '15 at 06:01
  • Show the (jr)xml of you textElement – Petter Friberg Dec 31 '15 at 11:22
  • The report you are generating is a jrxml file.... if you look it is actually an xml file (textfile), try to past some relevant parts of it in the question (edit your question adding the content of your jrxml file) – Petter Friberg Dec 31 '15 at 11:47
  • Here is the jrxml of a text element. <![CDATA[$F{out}]]> – Farrukh Cheema Dec 31 '15 at 11:47
  • I think you have it now. – Farrukh Cheema Dec 31 '15 at 11:49
  • Please help me, I am really stuck here. – Farrukh Cheema Dec 31 '15 at 11:56
  • I have never worked with OrientDB but if your field is of class ODocument and not null, you should try to output something that can be a String..., from http://orientdb.com/javadoc/latest/com/orientechnologies/orient/core/record/impl/ODocument.html, I found different metods... I have edit the question to included one. Try the code above and tell me what happens... – Petter Friberg Dec 31 '15 at 11:59
  • It is still generating error. Error Evaluating expression for source text: $F{out} – Farrukh Cheema Dec 31 '15 at 12:21
  • Anyways thank you for you effort. I will do some search and will try myself. Thank a lot again. – Farrukh Cheema Dec 31 '15 at 12:22
  • @FarrukhCheema have you tried my edit... pass the stacktrace – Petter Friberg Dec 31 '15 at 13:14
  • Yes i tried your edit. But it is not the issue. Issue is in my query. – Farrukh Cheema Jan 01 '16 at 06:15
  • It was generating error again. But i got to know that my query was not correct and i need to know the orientdb query – Farrukh Cheema Jan 01 '16 at 06:16
  • I have solved the issue as i was not writing a proper query. – Farrukh Cheema Jan 01 '16 at 07:09