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

lucianc

Members
  • Posts

    5,609
  • Joined

  • Last visited

  • Days Won

    4

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by lucianc

  1. According to the bug report, it's been fixed in JasperReports 1.2.4. Regards, Lucian
  2. Read this discussion, it might be what you're looking for. Regards, Lucian
  3. It's possible to interrupt the report filling process by calling JRBaseFiller.cancelFill(). This assumes you can access the JRBaseFiller instance, you'd need to create it via JRFiller.createFiller(). You could check out the source of AsynchronousFillHandle, it contains this king of logic. HTH, Lucian
  4. Why would you put all the fields from the detail in the group header? It doesn't make sense, only the group-related fields (i.e. the manager) should be placed there. Consult the JR samples to understand how groups work, trial and error is not necessarily the best way to achieve something. HTH, Lucian
  5. This functionality was implemented after the 1.0.1 release, therefore it will only be available in the next release. In the meantime, you need to use alternative ways of accessing your fonts, e.g. packing them into a jar placed on your application's classpath and referring to them as class loader resources. Regards, Lucian
  6. The cause of the behaviour is probably the fact that you are reusing the same data source to fill a report multiple times. A data source is similar to a java.util.Iterator, it exhausts its data when used. To reuse it, you have to either rewind it (if it's a JRRewindableDataSource), or recreate it. Read this discussion, it's about the same thing: http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=421 HTH, Lucian Post edited by: lucianc, at: 2006/08/30 14:32
  7. To use the fix, you simply have to include the fix jar in your web application, i.e. copy it to $TOMCAT/webapps/jasperserver/WEB-INF/lib. Possible workarounds: Use Javaflow continuations for subreport instead of threads. To do this, you need to include the Javaflow in your web app and set this property in jasperreports.properties: Code:net.sf.jasperreports.subreport.runner.factory=net.sf.jasperreports.engine.fill.JRContinuationSubreportRunnerFactory(jasperreports.properties should be placed somewhere on the application classpath, e.g. under WEB-INF/classes). You might also need to replace the JasperReports jar from the JasperIntelligence with one downloaded from the JR web site, I'm not sure whether the one included with JasperIntelligence is Javaflow-enabled. Load the second subreport in the master and pass as a parameter to the first subreport: Code:[code] //in the master <subreport> .. <subreportParameter name="SubreportB"> <subreportParameterExpression> net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation("repo:«»SubreportB"«») </subreportParameterExpression> </subreportParameter> <subreportExpression>"repo:«»SubreportA"</subreportExpression> </subreport> //in the first subreport <parameter name="SubreportB" class="net.sf.jasperreports.engine.JasperReport"/> <subreport> <subreportExpression class="net.sf.jasperreports.engine.JasperReport">$P{SubreportB}</subreportExpression> </subreport> [/ol] Regards, Lucian
  8. Thank you for detecting this :) The fix will, of course, be included in the next release. Regards, Lucian Post edited by: lucianc, at: 2006/08/29 14:39
  9. It's possible by using conditional styles (introduced in JR 1.2.0). What you need to do is: -create a variable which increments by one for each year group -create a style which specifies a grey background when this variable is even -apply this style to a frame inside which you place all the report elements in the detail band (or apply it to a rectangle placed behind the elements in the detail band if you don't want Html or Excel output). You can take a look at the "scriptlet" sample in the JR distribution to see something similar. HTH, Lucian
  10. This behaviour is caused by a bug in the JasperIntellegence code. Some required context information is missing for second level subreports. The bug is fixed now. You can test (and use) the fix by including the attached jar in your web application. There are also a couple of workarounds to the issue. If you can't/don't want to use the fix, I'll post them. Regards, Lucian [file name=jasperserver_api_engine_impl_0_fix.jar size=2085]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/jasperserver_api_engine_impl_0_fix.jar[/file]
  11. If you use JR >= 1.2.0, you can achieve this via the "Auto" evaluation type. The "Auto" evaluation type was introduced to support text field expressions which need to be evaluated at more than one moment (and this is your case). You need to create a helper variable that copies the PAGE_NUMBER value but has Page reset type so that it will get evaluated at page time (the "Auto" evalution type uses the reset type of variables to determine when to evaluate them). This is what you need to do: Code: <variable name="CurrPageNo" class="java.lang.Integer" resetType="Page"> <variableExpression>$V{PAGE_NUMBER}</variableExpression> </variable> .. <textField evaluationTime="Auto"> .. <textFieldExpression><![CDATA["Page " + $V{CurrPageNo} + " / " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> HTH, Lucian
  12. Still not able to replicate this. I don't have MS Word though, but I don't think this is a viewer issue. Could post a simple sample to replicate the behaviour? Or maybe relevant JRXML fragments.. Regards, Lucian
  13. Not sure what could cause this. Could you post a (simplified) sample, or relevant JRXML fragments so that we would be able to replicate the behaviour? Regards, Lucian Post edited by: lucianc, at: 2006/08/29 08:15
  14. The filter expression is an expression like all others in JR reports (see this page for an introduction to JR expressions). The type of this expression is java.lang.Boolean, therefore you can use any Java (/Groovy/etc) expression (with $P{}, $F{}, $V{} placeholders) that evaluates to/can be converted into a java.lang.Boolean value. Some examples: Code: $F{field}.equals($P{parameter}) ? Boolean.TRUE : Boolean.FALSE new Boolean($F{field}.equals($P{parameter})) Boolean.valueOf($F{field}.equals($P{parameter})) ($F{field}.equals($P{parameter}) && $F{field2}.equals($P{parameter2})) ? Boolean.TRUE : Boolean.FALSE The semantics now: for each row in the data source, the expression gets evaluated and: if the expression evaluates to Boolean.TRUE, the row gets processed by the report filling engine if the expression evaluates to Boolean.FALSE or null, the row is skipped and the engine advances to the next row in the data source[/ul] HTH, Lucian
  15. viewReport(JasperPrint, boolean) is a static method of JasperViewer, therefore doing jv.viewReport(..) doesn't make sense and the JasperViewer instance you create is useless. What you should do is JasperViewer.viewReport(jasperPrint, false). HTH, Lucian
  16. Do you have the Commons Javaflow jar on your classpath? HTH, Lucian
  17. Where (on which band) is your subreport placed? What data source/connection expression are you using for the subreport?
  18. Does the subreport have a left margin? This would explain the offset.. HTH, Lucian
  19. The max size arguments represents, according to the Javadocs, the maximum size (in JRVirtualizable objects) of the paged in cache. I.e. the number of report pages which will be kept in memory; when this threshold is reached, the contents of report pages will be written to the file system and only a page stud will be kept in memory. Your assumption is hence true, the max size parameter is directly linked to the amount of physical memory used by the report. You can consult the Javadocs for a reference of existing virtualizer implementations and their configuration arguments. Regarding your last question, the JR engine cannot know a priori whether a report is going to be large (it cannot know how many rows the dataset will returne and how much space will be used by each report element). Also, the current code needs to know from the beginning whether virtualization is used when generating a report, so that it prepares the report pages for it. Bearing this in mind, restricting the use of virtualization to large reports only is not possible. However, if you, for example, define "large" reports as report having more than 500 pages, and set the max size of the virtualizer to 500, the effect is somewhat similar to what you were trying to achieve. If a report would have less than 500 pages, all its data would be kept in memory and no i/o would happen (but the fill would still take a little longer since some operations are performed to insure that the report pages are virtualizable). If a report would have more than 500 pages, only 500 would be kept in memory and the rest would be virtualized to the file system. HTH, Lucian
  20. Have you tried setting evaluationTime="Report" for the text field used to display the total? HTH, Lucian
  21. If you want to use report parameters inside a crosstab, you'd need to pass it as a crosstab parameter: Code: <crosstabParameter name="first_year" class=".."> <parameterValueExpression>$P{first_year}</parameterValueExpression> </crosstabParameter> HTH, Lucian
  22. Why did you create a subdataset in your report? Your crosstab uses data from the subdataset you specified, but you don't pass any datasource to the subdataset and therefore there will be no data for the crosstab. This is what you should do: remove the subdataset remove the dataset run from the crosstab dataset move the crosstab in the summary section[/ul] HTH, Lucian
  23. Are the two subreports placed on the same band? This would explain why the value returned from the first subreport is not sent to the second one. This happens because when a band gets rendered, all the expressions are evaluated (including the expressions of the second subreport), and after this the first gets rendered and the value is returned from it. There are (at least) two ways to work around this: Initialize the list in the master report and send it as a parameter to both subreports. The first would populate it and the second will read from it: Code: //create a variable in the master <variable name="list" class="java.util.List"> <variableExpression>new java.util.ArrayList()</variableExpression> </variable> //pass it to the first subreport so that it can be populated <subreportParameter name="list"> <subreportParameterExpression>$V{list}</subreportParameterExpression> </subreportParameter> //populate it in the scriptlet ((java.util.List) getParameterValue("list"«»)).add(...); //pass it to the second subreport as well Break the band on which the two subreports are placed in two, by creating a dummy group and moving the second subreport to the group footer. [/ol] HTH, Lucian
  24. A subreport can be included in a report unit by uploading the *.jrxml file as a local resource. The subreport should then be referred in the master report using a subreport expression such as Code:<subreportExpression>"repo:LocalSubreport"</subreportExpression>where "LocalSubreport" is the name of the local resource in the report unit. HTH, Lucian
  25. You want to decide whether a report is empty before you load it? I don't think that's possible. If you want to decide whether a report is empty, you first need to set whenNoDataType="NoPages" for the report design and then (when you have the filled report) check jasperPrint.getPages().isEmpty(). Regards, Lucian
×
×
  • Create New...