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

Everything posted by I am Leo

  1. <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.
  2. I have a file named some-image.png I put in src/main/resources/static/images And in my jasper template: <image onErrorType="Blank"> <reportElement style="some-row" mode="Opaque" x="0" y="0" width="3116" height="843" forecolor="#FFFFFF" uuid="33d8b7cf-29f9-45ee-9397-4090f1e648a2"> <property name="com.jaspersoft.studio.element.name" value="someImg"/> <property name="com.jaspersoft.studio.unit.width" value="px"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <box> <pen lineWidth="0.0" lineColor="#FFFFFF"/> </box> <imageExpression><![CDATA["static/images/some-image.png"]]></imageExpression></image>[/code]You can point to your subreport use the above way. Hope this can help you.
  3. I found this: https://stackoverflow.com/questions/57006941/justified-property-of-textfield-and-statictext-is-not-working-in-jaspersoft-re Hope this can help you;
  4. I believe that display an image inside a table is normal as you display it in other place in the report. Use the <printWhenExpression><![CDATA[Your_condition]]></printWhenExpression> to display your image base on one condition. $F{detected} "static/pdf-components/caution.png"[/code]
  5. Use English and screenshot to describe, please.
  6. Hi. I am working with a lot of List of String in my project. I pass that List into jasper as a parameter. HashMap<String, Object> parameters = new HashMap<>();// List string parameterparameters.put("myList", listString);[/code]Then I define a subDataset ]]> </queryString> <field name="_THIS" class="java.lang.String"/></subDataset>[/code]<p>And use it in template:</p><pre language="xml"> <jr:list printOrder="Vertical"> <datasetRun subDataset="stringArray" uuid="97f0b91c-e67f-436b-bdd3-8e064de6f366"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{myList}) $F{_THIS} [/code]Hope this can help you
  7. Are you working with a Java application and using Jasper report to make a template for your application?
  8. How about try with capitalize letter ($P) not lower case ($p)
  9. https://www.stackextend.com/java/generate-pdf-document-using-jasperreports-and-spring-boot/ I follow this TUT and it is very helpful to me.
  10. Does "create the reports" means to export to report under type like PDF, HTML?
  11. I am working with a Java application to create PDF. In my application, I use i18n as ResourceBundle to get the text base on Locale. And in my method, I return a string from i18n bundle resource I want. java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/i18n", Locale.JAPAN);return bundle.getString("id");[/code]Hope this can help you.
  12. In my opinion, Because your list is on page #1 so that It will print the page number is 1. So for the workaround solution, you can calculate the page number base on the total record you have, total record on one page and current index ($V{REPORT_COUNT})
  13. One more thing, $p1{parms_date} is wrong. just $p{parms_date} (without 1)
  14. In your <![CDATA[call SalesRegisterReport (2,'2017-07-17')]]> I see that first param is not a String. But your parms_Id is defined as a String. Is that a problem?
  15. Define your subDataset and use it in datasetRun of table. <subDataset name="Packlist_detail" uuid="bc2619a3-a304-4ce0-b488-b8ed5c8c9dbc"> <queryString> <![CDATA[]]> </queryString> <field name="data1" class="java.lang.String"/> <field name="data2" class="java.lang.String"/> <field name="data3" class="java.lang.String"/> <field name="EAN" class="java.util.List"/> </subDataset>[/code]And in your table: <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> <datasetRun subDataset="Packlist_detail" uuid="3abab8d1-8df5-45f3-b2fa-84543646af58"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{yourPacklistParam})]]></dataSourceExpression> </datasetRun> ...</jr:table>[/code]And if you want to use EAN in your table, just define another subDataset and then use that subDataset to display. <subDataset name="listEAN" uuid="bc2619a3-a304-4ce0-b488-b8ed5c8c9dbc"> <queryString> <![CDATA[]]> </queryString> <field name="code" class="java.lang.String"/> </subDataset>[/code]
  16. Add one more property "Print When Expression" to your text field. <printWhenExpression><![CDATA[YourCondition]]></printWhenExpression>[/code]YourCondition to display your text field if it matches the condition. YourCondition will be: java.util.Arrays.asList("Value A", "Value B", "Value C").contains($F{field_you_want_to_check})[/code]
  17. Set positionType="Float" for the text field.
  18. Thanks for the downvote. And for sure in Jasper there is no way can you can pass the authenticate param to get the image. But you can get the image by your application before you create the report and pass it into your template under the InputStream.
  19. Really not understand your question. When you pass different parameters set into your report template, it will generate different reports for you.
  20. The HTML component in Jasper Report does not support fully CSS style when you exporting to PDF as normal. When you export to HTML, it can understand all the style because the browser will parse CSS and display for you. But when you export to PDF, there is the limitation in the HTML component and not all styles will be applied to your PDF.
  21. 1st way: java.lang.Double.valueOf($F{field_name}) > java.lang.Double.valueOf("0")[/code]2nd way: java.lang.Double.compare(java.lang.Double.valueOf($F{field_name}), java.lang.Double.valueOf("0")) > 0[/code]
×
×
  • Create New...