Jump to content
JasperReports Library 7.0 is now available ×

lucianc

Members
  • Posts

    5,619
  • Joined

  • Last visited

  • Days Won

    6

lucianc last won the day on July 16

lucianc had the most liked content!

2 Followers

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

lucianc's Achievements

  1. The proper solution is to create several detail bands. You can place each subreport in a separate detail band and you won't need break elements. Regards, Lucian
  2. JasperReports 6.21.3 uses OpenPDF 1.3.32 as replacement for iText. Regards, Lucian
  3. Try including a jasperreports-jdt dependency in your project instead of jdt-compiler: <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports-jdt</artifactId> <version>7.0.0</version> </dependency> Regards, Lucian
  4. Hello You seem to have very old JRXML files that still reference a DTD. Please correct me if my assumption is wrong. You need to convert your JRXML files to 7.0 syntax. You'll need to do that in two steps: first convert them to 6.x syntax (that uses an XSD schema instead of the DTD) using Jaspersoft Studio 6.x, and then convert the 6.x JRXMLs to the 7.0 syntax using Studio 7.0. Also see the discussion at https://github.com/TIBCOSoftware/jasperreports/issues/454 Regards, Lucian
  5. There are two ways to prevent such cases. The first is to set the net.sf.jasperreports.report.class.filter.enabled property to true. That restricts the classes that are allowed to be used in report expressions. You can see the classes allowed by default (note that some are required internally) here, and you can add further classes if required. The second solution is to run Java with a security manager (as in -Djava.security.manager -Djava.security.policy=..) and then use net.sf.jasperreports.engine.util.JRClassLoader.setProtectionDomain() or setProtectionDomainFactory() to specify a protection domain to be used for the code compiled from report expressions. Regards, Lucian
  6. There's a builtin method net.sf.jasperreports.engine.JasperPrintManager.printPageToImage(JasperPrint jasperPrint, int pageIndex, float zoom) that does the same thing as your code If you want to keep your own code you'll need something like this JRGraphics2DExporter exporter = new JRGraphics2DExporter(); exporter.setExporterInput(new SimpleExporterInput(this.jasperPrint)); SimpleGraphics2DReportConfiguration reportConfiguration = new SimpleGraphics2DReportConfiguration(); reportConfiguration.setPageIndex(pageIndex); reportConfiguration.setZoomRatio(zoom); exporter.setConfiguration(reportConfiguration); SimpleGraphics2DExporterOutput output = new SimpleGraphics2DExporterOutput(); output.setGraphics2D(pageImage.getGraphics()); exporter.setExporterOutput(output); exporter.exportReport(); Regards, Lucian
  7. You can try https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/com/lowagie/itext
  8. JsonQueryExecuterFactory has been moved to a separate artifact called jasperreports-json. See at https://central.sonatype.com/artifact/net.sf.jasperreports/jasperreports-json/overview Regards, Lucian
  9. You need to add a dependency to jasperreports-pdf 7.0.0 in your project, see at https://central.sonatype.com/artifact/net.sf.jasperreports/jasperreports-pdf/overview Regards, Lucian
  10. The easiest solution is to change the method to return something (e.g. Object) and add a return null; statement at the end of the method. Regards, Lucian
  11. JasperReports relies on the JavaBeans standard to resolve object properties (via Commons Beanutils), so you can use the mechanisms defined in the standard to register property names to be resolved from reports. For instance you can create a BeanInfo class and define the customer_name property: public class CustomerBeanInfo extends SimpleBeanInfo { @Override public PropertyDescriptor[] getPropertyDescriptors() { try { return new PropertyDescriptor[] {new PropertyDescriptor("customer_name", Customer.class, "getCustomerName", null)}; } catch (IntrospectionException e) { throw new RuntimeException(e); } }}[/code]
  12. You can specify the mapping of a report field to a property name in the Java class using the net.sf.jasperreports.javabean.field.property property. For instance <field name="customer_name" class="java.lang.String"> <property name="net.sf.jasperreports.javabean.field.property" value="customerName"/> </field>[/code]Regards, Lucian
  13. marionunes1997 I don't think we'll be able to retrace the target of the link posted above. But there are good chances that it wouldn't actually be relevant to your problem, I recommend posting your question in a new thread. Regards, Lucian
  14. One solution to allow the text element to stretch is to place in a different band than the element that runs the subdataset. For instance if you currently use the detail band, you can create two detail bands, have the subdataset in the first band and the text that displays the returned value in the second band. Regards, Lucian
  15. Crosstabs display aggregated data and one cell can correspond to several records in the data source. For that reason field values cannot be used directly in crosstabs, you need to pass field values as crosstab groups and use the group variables to display the values. You can also use crosstab parameters but only when there is a single value to be passed, that is when the value does not change from one row/column to another. Regards, Lucian
×
×
  • Create New...