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

I am Leo

Members
  • Posts

    98
  • Joined

  • Last visited

  • Days Won

    1

 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 I am Leo

  1. In my experience, the width of the text field can not be changed by the content inside it.

    So, the background color should fit with the width of the text field that you defined. It can not make the text field bigger or something like that.

  2. <textField textAdjust="StretchHeight">    <reportElement x="0" y="0" width="1520" height="15" uuid="6cb61704-2f0a-4b05-b714-f0219175f001">        <property name="com.jaspersoft.studio.element.name" value="content"/>    </reportElement>    <box topPadding="35" leftPadding="35" bottomPadding="35" rightPadding="35"/>    <textFieldExpression><![CDATA[$F{point4}]]></textFieldExpression></textField>[/code]

    Just use textAdjust="StretchHeight" in your text field. It's will be stretch base on the content inside.

  3. Your fontsfamily1586778266566.xml is wrong. Edit follow the following code:

    <?xml version="1.0" encoding="UTF-8"?><fontFamilies>    <fontFamily name="Lobster Two">        <normal>lobstertwo/LobsterTwo-Regular.otf</normal>        <bold>lobstertwo/LobsterTwo-Bold.otf</bold>        <italic>lobstertwo/LobsterTwo-Italic.otf</italic>        <boldItalic>lobstertwo/LobsterTwo-BoldItalic.otf</boldItalic>        <pdfEncoding>Identity-H</pdfEncoding>        <pdfEmbedded>true</pdfEmbedded>    </fontFamily></fontFamilies>[/code]

     

  4. You have to import the font that supports Khmer Unicode to your Java application. 
    You can check the demo project here: https://github.com/TIBCOSoftware/jasperreports/releases

    Download the http://jasperreports-6.12.2-project.zip/, unzip and check the demosamplesfonts.

    Basically, import your font, check the fonts.xml. Then create 2 properties files, jasperreports.properties and jasperreports_extension.properties.

    Bingo, your text display correctly.

  5. In my opinion, just create a Python application, then import your PDF template design using Jasper report, transfer your data using parameters instead of fields and you will get the PDF as the result.

    Firstly, design a template using Jasper Report Studio. You will get the jrxml file.

    Secondly, for the import template to the Python application, I found this: https://pypi.org/project/pyreportjasper/

    Finally, transfer your data using parameters instead of fields. As you can see in the above link, when running the jasper.process(), they pass an object containing a property is parameters. parameters property is a map object with the key is string and value is any type you want. Define a parameter in your PDF template and you can use it in your template. You can receive the data via HTTP request and pass the data to PDF template through parameters.

  6. You don't need to use the Ternary operator in your expression because the first expression returns a boolean.

    To verify your expression, you should put that into the value of one Text field and check the result after it is printed.

    The Print when expression works well. Your expression may have an error.

  7. Maybe it will be complicated here.

    Your value comes from the database is a string. And we can get 2 numbers of that string by the split method

    Example: 

    java.util.Arrays.asList("4999.000000-10000.000000".split("-"))[/code]

    The result of the above line is an array list contains your 2 numbers.

    You can create 2 variables in your report to store that 2 numbers.

        <variable name="number1" class="java.lang.String">        <variableExpression><![CDATA[(java.util.Arrays.asList($F{your_number_field}.split("-"))).get(0)]]></variableExpression>    </variable>[/code]

    Then format the string as your request.

×
×
  • Create New...