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

narcism

Members
  • Posts

    319
  • 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

Everything posted by narcism

  1. 1. Once sorted, you cannot retrieve your custom data source, unless you clone it and add it to the report as a parameter and get it from there. Other options might be: 2. Presort your records in your custom datasource and avoid using sortFields 3. Use subreports or dataSet-based components like lists/table and use sortFields there.
  2. You no longer need that jar from @m.kamran's answer. Those classes have made it into the core JasperReports library for several releases. It is just a matter of configuration. I have also replied to you on stackoverflow: https://stackoverflow.com/a/49817393/5882963
  3. It is possible that your InputStream is already "consumed" when it reaches the subreport. Depending on its implementation, the InputStream might be "reset"-able. But if you are in hold of its creation mechanism maybe you could use a different approach.
  4. Your initial query, $.dafs.id(@val == "3434343")[0].name, does not yield any results because you are trying to advance the 'name' key into an 'id' value: $.dafs.id(@val == "3434343")[0] produces "3434343" and "3434343".name does not make any sense. As @SuperDave pointed out, you need to go one level up(to the object holding the id property that you filtered) and get the 'name' property: $.dafs.id(@val == "3434343")[0]^{1}.name If your IDs are unique you don't need to select the first one with [0] and if you are going up one level you could just use ^ instead of ^{1} and have a simpler query like so: $.dafs.id(@val == "3434343")^.name If your query is the mainDataset's query, you can skip the $ sign as it has no influence there, but only when used on field expression properties. Your mainDataset's query could eventually looks like so: dafs.id(@val == "3434343")^.name Other queries that might produce the same result could be: dafs.*(id == "3434343").name, meaning: get all the 'dafs' children(.*) with an id of "3434343", then get the name ..name(^.id == "3434343"), meaning: get the name from everywhere(..name), whose parent has an id of "3434343" ..*(id == "3434343").name, meaning: get everything with an id of "3434343" then select its name Now, for a sample JSON file like this one: { "dafs": [{ "id": "3434343", "name": "TEST" }, { "id": "7777777", "name": "TEST2" } ], "details": [{ "dafId": "3434343", "value": "foo" }, { "dafId": "3434343", "value": "bar" }, { "dafId": "7777777", "value": "foo2" } ] } you could achieve what you want like so:
  5. Also, your data adapter configuration should come in handy.
  6. Please post some JRXML and JSON sample files in order to reproduce the issue.
  7. You cannot operate on the keys of the "_attachments" object. Had it been an array, you could have. Future versions of JasperReports may address this issue. In this case: you could filter by a fixed key like "digest". You could do that with an expression like: _attachments.*(digest != "md5-VJaOsR0z8+RUMYCSSSvf2A==")[/code] or, if you know that the key you are trying to leave out is always the first one in the list, you could skip it with this expression:_attachments.*[1:][/code]
  8. With such complex queries and without an environment to reproduce/test the modifications it seems almost impossible to provide a solution. You could try and reverse engineer from the report that has what youd want and add the missing pieces.
  9. Please post some sample jrxml to illustrate the issue.
  10. Please note that support/development for iReport has been discontinued since the end of 2015. Jaspersoft Studio (https://community.jaspersoft.com/project/jaspersoft-studio) is now the official design client for JasperReports However, if you are tied to using iReport, you could check out the Ultimate Guide here: https://community.jaspersoft.com/documentation/ireport-ultimate-guide. The section of interest is: 10.6.6 Using CSV Data Sources. If you are interested in using Jaspersoft Studio, you could find the relevant information here: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v640/using-csv-data-sources
  11. You simply cannot do that right now. Follow this post's answer: https://community.jaspersoft.com//questions/1073171/table-object-data-starts-2nd-page
  12. Altering the SQL alone may not solve your issue completely. Ideally, we would need some sample JRXML files and sample data to work on.
  13. What is the actual problem with your initial/original SQL? Post some screen shots or screen recordings. Note that you have already opened up a similar question(https://community.jaspersoft.com//questions/1073256/generating-fields-sql-query) that you could have edited and added this SQL code. Please stick to only one.
  14. It seems that you forgot the last ELSE expression( : "") Here's how I would write it(aimed more at readability, you don't have to use parenthesis at all): ($F{CP} == 1 && $F{TP} == 1) ? "CT" : ($F{CP} == 1 ? "C" : ($F{TP} == 1 ? "T" : ""))
  15. Maybe you are getting an error on the Dataset and Query Dialog that prevents you from reading the fields. You need to check the top left corner of the dialog for errors after pressing the "Read Fields" button.
  16. Fishbowl is not a Jaspersoft product. However, it seems to be based on JasperReports and that is where we could help, if possible.
  17. This is a known issue with the Table Component. I have also recently replied here on a similar issue: https://stackoverflow.com/a/47221390/5882963
  18. This could be a starting point: https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v640/registration-fields-sql-query The documentation also provides information about parameters/variables.
  19. Please disregard my last answer, I have deleted it. Did you try setting a Print When expression on the bands that you do not want to repeat? For example, on the Column Header band, setting a Print When expression like: $V{PAGE_NUMBER} == 1 would display this band only on first page.
  20. If you size your report elements properly, you could get away with: a Page Header, a Summary(you need a band that allows overflow) and a Footer. Some key settings: 1. At report level set: When No Data Type to All Sections No DetailSummary With Page Header And Footer2. You control the pages with the Break element from the Basic Elements inside the Pallete view. A small sample: <?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.4.0.final using JasperReports Library version 6.4.1 --> <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="Report" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryWithPageHeaderAndFooter="true" uuid="81afe112-ee1b-4443-8d1c-cb6d9ab95dd8"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> <queryString> <![CDATA[]]> </queryString> <pageHeader> <band height="48"> <staticText> <reportElement mode="Opaque" x="0" y="10" width="550" height="30" backcolor="#F7C7C6" uuid="d9ec0e23-43d7-4cea-8ee9-2386ec2b8fb6"/> <textElement textAlignment="Center"/> <text><![CDATA[Header]]></text> </staticText> </band> </pageHeader> <pageFooter> <band height="41"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="550" height="30" backcolor="#A2F2F2" uuid="54b3f041-eeb9-4947-887d-7996a85a0fcf"/> <textElement textAlignment="Center"/> <text><![CDATA[Footer]]></text> </staticText> </band> </pageFooter> <summary> <band height="180"> <break> <reportElement x="0" y="90" width="97" height="1" uuid="f21dfd66-d9c5-4d0d-a2d2-abf1c585afb3"/> </break> <staticText> <reportElement mode="Opaque" x="40" y="20" width="460" height="50" backcolor="#F6F7B7" uuid="fba6d6fc-1662-41a3-8d2e-87913fc2ef11"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <text><![CDATA[Page1]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="40" y="110" width="460" height="50" backcolor="#F6F7B7" uuid="e5366d7b-3f8f-4c64-9c75-9dd9c9f1cfbe"/> <textElement textAlignment="Center" verticalAlignment="Middle"/> <text><![CDATA[Page2]]></text> </staticText> </band> </summary> </jasperReport>
  21. You need to describe your input data and your desired output in order for us to be of any help.
  22. I have recently discovered that right-clicking on the actual color box pops up a "Set to Null" menu that helps achieving what you are after. In fact right-clicking on other properties pops up menus with "Reset to Default" option in addition to the one above. Tested in JasperSoft Studio 6.4.0.
×
×
  • Create New...