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

therockita

Members
  • Posts

    8
  • Joined

  • Last visited

therockita's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. Hi Pablodc, Thank you very much for your great advice (I always realize there's always something you don't know about JR). It worked perfectly! (for the people having the same problem, the no data section you have to activate is the one in the subreport). Greetings from Italy (from a peruvian guy...)! Chau!
  2. The samples didn't work neither. All the problem was apparently caused because of a JAVA update. Indeed everything worked again after I rebooted the PC. I hope to help anyone having the same problem.... Bye
  3. Hello, I'm designing a report template made of one MASTER report and one SUBreport, both with xml as datasource. The context is the following: I pass a JRXMLdatasource with initial path of /test/questions/question (the second parameter of the constructor) to the MASTER report . I pass the same xml datasource to the subreport (through the built-in parameter $P{REPORT_DATA_SOURCE}), this time with a different path /test/questions/question[@questionId=$P{questionId}]/selectedChoices The xml datasource represents the answers that a student selects in a multiple choice test. Obviously a student might not select any choice of one question. In this case the XPath test/questions/question[@questionId=$P{questionId}]/selectedChoices will return an empty node set and the subreport won't be "started". This behaviour is ok. Now, this is my problem: I need additionally to this to print the textField "User has not selected any choice". This must happen only when the subreport won't be generated because of the empty node set. I have tryed many strategies, like using variables combined with the printWhenExpression, but it didn't succeed. How can I do!!?!???! I feel like if I'm missing the simple solution. Any help is welcomed.
  4. I'm currently developing a web application that uses a native Xml database in the data layer. I'm using Xindice, but I'm sure that my case applies to any of the implementations of the xml:db (or xapi) specification (eXist, baseX, etc, etc). I'm using Jasperreports to generate some reports. My idea is to extract some content of the database (using XPath) and then transform the ResultSet object in a w3c dom document. Then I use this document object as the parameter of JRXmlDatasource. All this procedure is possible using the Xindice (or xml:db) API. Unfortunately this is not working and I don't really know whether this is a JasperReport bug or not. It seems that it totally dislike my w3c Doc coming from the XML native database. I have tried to manipulate this w3c dom document changing encoding, formatting... no results, blank page again. I'm temporarily bypassing the problem writing the document into the filesystem and then creating and parsing a new w3c document. That makes me think that there's a bug somewhere. Any comment would be appreciated.
  5. Hi Betty, The problem here is that a JasperReport using xml datasource can only work with one node set at a time. Take a look to this:http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/data/JRXmlDataSource.html Practically this means that you can not have "two iterations" in the same report (you have already an iteration for any BBB node). To resolve this inconvenient you just need to create a subreport, pass it the same document as datasource and change the initial XPath.You can use this code to achieve this (to be inserted into your Master report): Code:<subreport><reportElement positionType="Float" x="18" y="72" width="500" height="42"/> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/AAA/BBB/CCC")]]></dataSourceExpression><subreportExpression class="java.lang.String"><![CDATA["path where the subreport is located"]]></subreportExpression></subreport>
  6. Hello everybody: I just did an upgrade from version 3.7.1 to 3.7.2 of JasperReports. Now it comes out that my ant target is not working anymore (from command-line). I tried to find the error in Internet, but I couldn't find anything similar. Any idea would be appreciated. The error is totally weird! It's related with a class org/eclipse/jdt/internal/compiler/problem/ProblemReporter. The funny thing is that if I run the ant target from eclipse, that it's working. My command line ant version is 1.8.0 This is the error I get during the compilation: Code:E:\Documents\UNI\stage\assessment>ant deployBuildfile: E:\Documents\UNI\stage\assessment\build.xmlcompileReports: [jrc] Compiling 4 report design files.File : E:\Documents\UNI\stage\assessment\war\WEB-INF\jrxml\singleStudentExpectedChoicesSubreport.jrxml ...BUILD FAILEDE:\Documents\UNI\stage\assessment\build.xml:72: java.lang.ClassFormatError: Illegal exception table range in class file org/eclipse/jdt/internal/compiler/problem/ProblemReporter at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:616) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) 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:303) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) at org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:260) at org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:101) at net.sf.jasperreports.engine.design.JRJdtCompiler.compileUnits(JRJdtCompiler.java:186) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:188) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:215) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:131) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:113) at net.sf.jasperreports.ant.JRAntCompileTask.compile(JRAntCompileTask.java:411) at net.sf.jasperreports.ant.JRAntCompileTask.execute(JRAntCompileTask.java:254) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360) at org.apache.tools.ant.Project.executeTarget(Project.java:1329) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1212) at org.apache.tools.ant.Main.runBuild(Main.java:801) at org.apache.tools.ant.Main.startAnt(Main.java:218) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)Total time: 3 seconds
  7. I think it's not possible to use that function... I have an xml document with this structure: <form> <questions> <question>...</question> <question>...</question> <question>...</question> ... </form> And I'm giving it to my template with XPath /form/questions/question Then in my template I have a field $F{position} which value is <fieldDescription>position()</fieldDescription> Finally I print that field inside my detail band. It seems that it actually try to use the field $F{posisition}, just that it prints a fix value in every iteration: -1. Can anyone confirm that this is actually a bug?
×
×
  • Create New...