Jump to content

asejas

Members
  • Posts

    37
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by asejas

  1. I was reviewing the changes log, and I see the JasperReports 4.1.1 Change Log:

    - pattern expression added to text fields elements to allow for more flexible
    dates and numbers formatting;

    But I notice that no one tag or property "patternExpression"  was added to the template xsd, the "patternExpression" field was only added in the JasperReports API.

    So, ¿can I use the patternExpression through the API only?

     

    Regards.

    Alvaro

  2.  Can you post a piece of your report template in order to explain your problem?

    I think you can be missing the pattern for the date.

    Code:
    <textField isBlankWhenNull="true" isStretchWithOverflow="true" pattern="dd/MM/yyyy">                        <reportElement x="400" y="0" width="150" height="12" style="detailStyle"                                       stretchType="RelativeToTallestObject" mode="Opaque"/>                        <box padding="1">                            <pen lineColor="#000000" lineStyle="Solid"/>                        </box>                        <textElement textAlignment="Left"/>                        <textFieldExpression class="java.util.Date">                            <![CDATA[$F{purchaseDate}]]></textFieldExpression>                    </textField>
  3.  Hi, I have a textBox in order to show the page number (e.g. 1 / 10 pages). In this textBox I show the PAGE_NUMBER variable, with a "Report" time evaluation. But when I add a box for the field padding, then the number is not rendered at all, but if I remove the box tag or I remove the evaluationTime, then the number is rendered in the report.

    I am using JasperReports3.7.0 in a JEE web application.

    Code:


    Post Edited by asejas at 05/19/2010 13:33
  4. All the content you put in a band is a line, regardless of its "y" position, i.e. If you put three elements in the detail band:

    A: x=0, y=0

    B: x=20, y=0

    C: x=50, y=20

    The three elements are a line in the report, the "C" element is not another line.

    If you want to have more control over the layout, you can put the elements in frames (see frame element documentation), If you put the Journal element in a frame, then it will not stretch when another element outside the frame overflows.



    Post Edited by asejas at 02/09/2010 20:32



    Post Edited by asejas at 02/09/2010 20:32
  5.  I have a variable when I store the value of the records processed in a subreport.

    The subreport is into a group header, and I need to get the value of the variable in the same group header, I try to evaluate the variable value with evaluationTime="Group" but I only gets an empty textfield.

    Is feasible to get the value of the variable in the group header? or should I move the textfield to another band?

    (In the code, the problem is with the 'pollPersonCountVar' variable).

    Code:
    ...<variable name="pollPersonCountVar" class="java.lang.Integer" calculation="System"/>...<group name="teacherGroup">        <groupExpression><![CDATA[$F{personId}]]></groupExpression>        <groupHeader>            <band height="114">                <subreport isUsingCache="true">                    <reportElement key="subreportpollByPersonSubReport" positionType="Float" x="0" y="0" width="562"                                   height="54"/>                    <parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression>                    <subreportParameter name="personIdParam">                        <subreportParameterExpression><![CDATA[$F{personId}]]></subreportParameterExpression>                    </subreportParameter>                    <subreportParameter name="JPA_ENTITY_MANAGER">                        <subreportParameterExpression><![CDATA[$P{JPA_ENTITY_MANAGER}]]></subreportParameterExpression>                    </subreportParameter>                    <returnValue subreportVariable="personGroup_COUNT" toVariable="pollPersonCountVar"/>                    <subreportExpression class="net.sf.jasperreports.engine.JasperReport">                        <![CDATA[$P{pollByPersonHeaderSubReport}]]></subreportExpression>                </subreport>                .....                 <textField isStretchWithOverflow="true" evaluationTime="Group" evaluationGroup="teacherGroup"                               isBlankWhenNull="true">                        <reportElement style="detailStyle" positionType="Float" mode="Opaque" x="450" y="30" width="112"                                       height="12"/>                        <box padding="1">                            <pen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>                        </box>                        <textElement textAlignment="Right"/>                        <textFieldExpression class="java.lang.Integer">                            <![CDATA[$V{pollPersonCountVar}]]></textFieldExpression>                    </textField>            </band>        </groupHeader>        <groupFooter>.....
  6.  I think you forgot to set the 'stretchType' and 'positionType' properties. See sample code.

    Code:
    <textField isStretchWithOverflow="true" isBlankWhenNull="true">    <reportElement style="headerStyle" positionType="Float" stretchType="RelativeToTallestObject" mode="Opaque" x="0" y="0" width="256" height="12"/>     <box padding="1">        <pen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>     </box>     <textElement textAlignment="Left"/>     <textFieldExpression class="java.lang.String">        <![CDATA[$R{SomeResource}]]></textFieldExpression></textField>
  7.  You can see the datasource sample in the demo directory of the JasperReports projects.

    Also, I am using JR with JPA queries, some queries return an objects List, then I add the fields to the reports using a prefix and a column number, the number is the position of the field in the JPA Query (see sample code).

    "COLUMN_1" maps to "someEntity.person.id" in the JPA Query, and has an alias: "person.id"

    "COLUMN_2" maps to "someEntity.person.name" in the JPA Query, and has an alias: "person.name"

    Hope this helps you.

    Code:
    QuerySELECT DISTINCT someEntity.person.id, someEntity.person.name, someEntity.person.name2 ....Fields               <field name="person.id" class="java.lang.Long">        <fieldDescription><![CDATA[COLUMN_1]]></fieldDescription>    </field>    <field name="person.name" class="java.lang.String">        <fieldDescription><![CDATA[COLUMN_2]]></fieldDescription>    </field>    <field name="person.lastName" class="java.lang.String">        <fieldDescription><![CDATA[COLUMN_3]]></fieldDescription>    </field>
  8.  IReport 3.6.2 for design. But I am setting some properties in an exporter helper class (for some reason that I don't remember now).  Should I remove this properties?

     

    Code:
    exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,Boolean.TRUE);exporter.setParameter(JRXlsExporterParameter.IS_AUTO_DETECT_CELL_TYPE,Boolean.FALSE);

    Post Edited by asejas at 01/20/2010 16:17
×
×
  • Create New...