Hi, Is there a decent tutorial on the use of Styles anywhere ? These seem to be a very powerful way of controlling the look and feel of your output but they hardly seem to get mentioned. TIA, Andy
OK, I think the problem is that you are running the chart on the main dataset. From the Jasper Studio User Guide : The Detail band will repeat for every row in the query results .. If you create a subDataset and base the chart on that you should get the result you're after . Right click at the top of the Outline, select 'Create Dataset' then follow the bouncing ball ..
Actually, this does work. Drop the quotes around your numbers and make sure the data type of the field is set to 'Integer' .. IF($F{TRANSPORTMODE} == 8,"FreeZone",IF(($F{TRANSPORTMODE} == 7),"CARGO TERMINAL",""))
Hi, I think I have tried this before and had a similar problem. Jasper doesn't seem to cope with nested IF's. I'm just trying to find the report I had the issue in and how I worked around it.
Hi 'Winnie'. I thought this would be easy so I gave it a try ! Turns out it's not so obvious. Try this : 1. Create your Text field using the appropriate database items. 2. Then go into the 'Hyperlink' tab in the Properties panel, set 'Link Type' to 'RemotePage' and populate the 'Hyperlink Reference Expression' with the field name - e.g. $F{EBAY} in my example 3. At this point your field will BE a URL but won't LOOK like one .. 4. Go into 'Appearance' and set the colour. 5. Go into 'Text Field' and set underline. There is some JRXML below that may help - you'll obviously need to add your own data adaptor/source Keep trying with Jasper - there is always a way but it often takes some finding. Let me know if this works for you. Happy Christmas ! Andy <?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 7.1.0.final using JasperReports Library version 6.4.3 --> <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="WEBSITES" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="92b25204-06b5-4ca7-805c-0c7ec9d3620b"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="SITES"/> <queryString language="XLS"> <![CDATA[]]> </queryString> <field name="AMAZON" class="java.lang.String"/> <field name="EBAY" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <detail> <band height="125" splitType="Stretch"> <textField hyperlinkType="RemotePage"> <reportElement x="167" y="36" width="100" height="30" forecolor="#221FED" uuid="f6531fbd-b60e-454b-a542-dd8a531f43ac"/> <textElement> <font isUnderline="true"/> </textElement> <textFieldExpression><![CDATA[$F{AMAZON}]]></textFieldExpression> <hyperlinkReferenceExpression><![CDATA[$F{AMAZON}]]></hyperlinkReferenceExpression> </textField> <staticText> <reportElement x="67" y="36" width="100" height="30" uuid="084face9-54dd-4293-923e-7499b9776cde"/> <text><![CDATA[AMAZON]]></text> </staticText> <textField hyperlinkType="RemotePage"> <reportElement x="167" y="66" width="100" height="30" forecolor="#221FED" uuid="0886b981-1752-4117-a147-51bff4947414"/> <textElement> <font isUnderline="true"/> </textElement> <textFieldExpression><![CDATA[$F{EBAY}]]></textFieldExpression> <hyperlinkReferenceExpression><![CDATA[$F{EBAY}]]></hyperlinkReferenceExpression> </textField> <staticText> <reportElement x="67" y="66" width="100" height="30" uuid="6b00bf6b-5931-4538-905e-5b13c6014883"/> <text><![CDATA[EBAY]]></text> </staticText> </band> </detail> </jasperReport>
James, I feel your pain. Looking at my crib notes, I always have to right click on the subdata set (i.e. ProductOrders in your case) and click 'Connect to Main dataset'. I don't think that is your exact problem but I do think it's someting to do with the data connection. If you add the 'dataSourceExpression' tag into your 'datasetRun' statement (see below) the table starts to fire (i.e. the headings start to appear). <datasetRun subDataset="ProductOrder" uuid="f5c23ded-3385-4dca-b61a-2fc9c51fa814"> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource() ]]></dataSourceExpression> </datasetRun> Sorry I can't be more help but hopefully nudging you in the right direction.
Michael, I'm no expert and am fairly new to Jasper as well but I think the short answer to this would be no. That said, I did do a screen mock-up a few weeks back where I put some backdrop images into the 'Background' section and then positioned other report elements over the top in the 'Details 1' section. This worked OK for a simple screen but even then lining things up was fiddly. I think for a delivery/contract note you would be better off persevering with creating all the page elements in 'Details 1' and getting easier maintenance in the future. Just my 2c and other may have other views. All best, Andy
Michael, I'm no expert and am fairly new to Jasper as well but I think the short answer to this would be no. That said, I did do a screen mock-up a few weeks back where I put some backdrop images into the 'Background' section and then positioned other report elements over the top in the 'Details 1' section. This worked OK for a simple screen but even then lining things up was fiddly. I think for a delivery/contract note you would be better off persevering with creating all the page elements in 'Details 1' and getting easier maintenance in the future. Just my 2c and other may have other views. All best, Andy
An answer to a post from a few years back (https://community.jaspersoft.com/questions/517154/creating-subdataset-application) gave a steer that you can programatically create subdatasets by making the appropriate entries to the source JRXML. Does anyone have more recent experience of doing this ? Are there guidelines published anywhere ? Please advise .