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

doublep

Members
  • Posts

    22
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by doublep

  1. Here is a simple JRXML that I created following your suggestion. As I understand it, at least. It is supposed to create output with value of "person" field per line, last line should also contain its own number. However, I get no numbers at all.

     

    <?xml version="1.0" encoding="UTF-8"?>

    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test" language="groovy" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">

    <field name="person" class="java.lang.String"/>

    <variable name="numRecords" class="java.lang.Integer" incrementType="Report">

    <variableExpression><![CDATA[$V{REPORT_COUNT}]]></variableExpression>

    </variable>

    <detail>

    <band height="15" splitType="Stretch">

    <textField>

    <reportElement x="0" y="0" width="200" height="15"/>

    <textFieldExpression><![CDATA[$F{person}]]></textFieldExpression>

    </textField>

    <textField>

    <reportElement x="300" y="0" width="200" height="15">

    <printWhenExpression><![CDATA[$V{REPORT_COUNT} + 1 == $V{numRecords}]]></printWhenExpression>

    </reportElement>

    <textFieldExpression><![CDATA[string.valueOf ($V{REPORT_COUNT})]]></textFieldExpression>

    </textField>

    </band>

    </detail>

    </jasperReport>

     

  2. Is it possible to find if the given record is the last one? I could probably compare $V{RECORD_COUNT} with something, but with what? Given that there is <sortField>, JR can re-sort input data on the fly, so it knows total number of records. But how do I find it?

  3. I have an image element that is used to display user-uploaded images. I.e. I have no idea what the image would be like in advance. No matter how I try to scale the element, it looks ugly in some cases.

     

    * If I use e.g. 200x200 and default scaling mode (retain shape), there is a lot of unused whitespace above and below landscape fotos, as they are downscaled to something like 200x130. Panorama fotos would be even worse.

     

    * If I set dimensions to 200x1 and scaling mode to "real size", it becomes great for landscape. But then portrait fotos take too much space, as they are downscaled to e.g. 200x340 (way too high). If someone uploads a vertical comic strip, it will be even worse.

     

    Is there a way to achieve something in between? I.e. so that there is no unused vertical space, yet images are limited in height?

     

×
×
  • Create New...