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

mferretti

Members
  • Posts

    26
  • 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 mferretti

  1. Hi all, I am trying to figure out if it was possible to have, using jasperreports/iReport, a cell colored based on a database value. I tried <style name="test" mode="Opaque" fill="Solid" backcolor="$F{MY_COLOR_FIELD}" /> but it didn't work so I am asking : is there a solution to a problem like this ?
  2. Hi, in practice, what you have to do is add <property name="net.sf.jasperreports.export.html.class" value="YOURVALUE"/> to the report element that you want, in HTML, to be of class="YOURVALUE". Eg. <reportElement x="157" y="0" width="15" height="78"> <property name="net.sf.jasperreports.export.html.class" value="verticaltext"/> ...
  3. Hi all, I have a webapp that produces reports ( jasperreports 4.0.1 ) ... so far so good. Now, some brilliant manager around here wanted to use this application as a service and call the reports via AJAX from a portlet. In Liferay. This works ... until they came up with sensitive data and associated security constraint thus the need of validating the session. Liferay provides a filter for validating access and actuallyt suggests it as a best practice if a CAS or LDAP is missing to authenticate a servlet sesison ... so I tried the filter. As soon as the filter is up a whole mess with commons-logging comes out : the classloader complains about differen versions of commons logging being loaded. If I use Liferay's version of comons-logging the reports don't compile ( groovy problems ? ) unzipping comons-logging.jar and looking into the manifest shows Implementation-Title: Commons Logging Implementation-Vendor: Apache Software Foundation Implementation-Vendor-Id: org.apache Implementation-Version: 1.1.1 Specification-Title: Commons Logging Specification-Vendor: Apache Software Foundation Specification-Version: 1.0 while version shipped with jasper 4.0.1 shows Specification-Vendor: Apache Software Foundation Specification-Version: 1.0 Implementation-Vendor: Apache Software Foundation Implementation-Version: 1.0.4 Is there any chance I can find a combination of jars that will make jasper work having to have commons-logging Implementation-Version: 1.1.1 ? TIA Marco
  4. @bradc : not really. My problem is that of passing different variables to the same conditional expression condition @giulio : sure, but the basics wouldn't change since I would have to move the 20 conditions from the conditional expression in the style to the print when conditions
  5. did you find any solution to it ? was actually looking for something like that ( set class element in HTML exported element )
  6. Hi mdahlman, I hate to jump into this topic like this but there actually is a way to have vertical text in modern browsers, and it looks like working . Please have a look at http://scottgale.com/blog/css-vertical-text/2010/03/01/ where he has a single CSS that prevents from having browser checking in javascript and so on. Now, in order to make use of this css, is there a way I can specify a class in the generated html, using Jasper 4.0, so that I can overwrite the default Jasper css while wating for version 4.1 ( in which I am sure they'll take this into account :D :D :D ) ? TIA Marco
  7. Sure ! Attached, please find a pdf. The content is a test content. The purpose is to let user see at a glance where missing ( red ) data is. So far, I have reached the goal by creating a style for each column and setting the conditional style based on the column name. Since the style and conditional style is always the same, I was wondering if there was a way of passing the colum (variable) to the style that is applied to that column ( actually to the conditional style/the condition ) so that , in the future, I did not have to "code" the same conditional statement all the times . Another, minor, problem is that since the data in the cell ( when present ) does not fit the cell itself, I have set the "stretch with overflow" property to false ; nonetheless, when exporting the report in html, the green cell is bigger than the others, while it looks ok if exported to pdf or xls . Post Edited by mferretti at 02/17/2011 12:26 Post Edited by mferretti at 02/17/2011 12:28
  8. Hi all I am working with iReport/JasperReports version 4 I have a 20 columns report. The columns need to be styled according to their content. I can create the styles and the conditions on a per column basis : <style name="colA" ... > ... <conditionalStyle> <conditionExpression><![CDATA[$F{A}.isEmpty()]]></conditionExpression> </style> </conditionalStyle> </style> This means that I have to create a style/conditional style for each column I have . I was wondering if there was a way of testing the column the style is applied to so that I could create one style and apply it to each column of my report.... something like <conditionExpression><![CDATA[$CURR_COLUMN.isEmpty()]]></conditionExpression> I tried googling and checking the "ultimate guide" ( I have access to a version 3 of the guide ) but couldn't find anything that resembles my problem . Do you have any tip or can point me to some documentation ? TIA Marco
  9. Solved. The problem was with the field overlapping ( actually "underlapping" ) on the right ... resized the field and worked.
  10. Hello, I am using iReport/JasperReport v.4. The attached report has a weired behavior : when exporting as HTML the report is missing data on column "Data Type" . If I try to export the same report as pdf everything looks normal . I checked the content of the html in order to make sure it was not a visualization problem but instead of the data I get an empty cell (image) : <td colspan="3"><img style="width: 119px; height: 12px;" src="../../ReportServices/image?jrprint=net.sf.jasperreports.j2ee.jasper_print1297856303724&image=px" alt=""></td> Am I doing something wrong ? TIA Marco Code:<?xml version="1.0" encoding="UTF-8"?><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="economic_coverage_report" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.5"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <style name="2008"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2008}.isEmpty() && !$F{2008}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2008}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <style name="2009"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2009}.isEmpty() && !$F{2009}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2009}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <style name="2010"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2010}.isEmpty() && !$F{2010}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2010}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <style name="2011"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2011}.isEmpty() && !$F{2011}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2011}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <parameter name="Title" class="java.lang.String" isForPrompting="false"/> <queryString> <![CDATA[select "Country name" as label,"Data type" as data_type, "Variable group" as variable_group,"Variable" as variable, "2008", "2009", "2010", "2011"from "v_CoverageReport_dcf"]]> </queryString> <field name="label" class="java.lang.String"/> <field name="data_type" class="java.lang.String"/> <field name="variable_group" class="java.lang.String"/> <field name="variable" class="java.lang.String"/> <field name="2008" class="java.lang.String"/> <field name="2009" class="java.lang.String"/> <field name="2010" class="java.lang.String"/> <field name="2011" class="java.lang.String"/> <group name="Country"> <groupExpression><![CDATA[$F{label}]]></groupExpression> <groupHeader> <band height="15"> <textField> <reportElement x="47" y="0" width="100" height="15"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{label}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="0" width="47" height="15"/> <textElement/> <text><![CDATA[Country :]]></text> </staticText> </band> </groupHeader> </group> <group name="variable_group"> <groupExpression><![CDATA[$F{variable_group}]]></groupExpression> <groupHeader> <band height="1"> <line> <reportElement x="100" y="0" width="452" height="1"/> </line> </band> </groupHeader> </group> <background> <band splitType="Stretch"/> </background> <title> <band height="47" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="555" height="47"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="16" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{Title}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band height="15" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="100" height="15"/> <textElement/> <text><![CDATA[Data Type]]></text> </staticText> <staticText> <reportElement x="100" y="0" width="100" height="15"/> <textElement/> <text><![CDATA[variable group]]></text> </staticText> <staticText> <reportElement x="200" y="0" width="229" height="15"/> <textElement/> <text><![CDATA[Variable]]></text> </staticText> <staticText> <reportElement x="427" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2008]]></text> </staticText> <staticText> <reportElement x="458" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2009]]></text> </staticText> <staticText> <reportElement x="489" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2010]]></text> </staticText> <staticText> <reportElement x="520" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2011]]></text> </staticText> </band> </columnHeader> <detail> <band height="12" splitType="Stretch"> <textField> <reportElement positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="0" width="100" height="12"/> <box> <topPen lineWidth="1.0"/> </box> <textElement> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{data_type}]]></textFieldExpression> </textField> <textField> <reportElement isPrintRepeatedValues="false" x="100" y="0" width="100" height="12" isPrintInFirstWholeBand="true"/> <textElement> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{variable_group}]]></textFieldExpression> </textField> <textField> <reportElement x="200" y="0" width="229" height="12"/> <textElement> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{variable}]]></textFieldExpression> </textField> <textField> <reportElement style="2008" x="427" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2008}]]></textFieldExpression> </textField> <textField> <reportElement style="2009" x="458" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2009}]]></textFieldExpression> </textField> <textField> <reportElement style="2010" x="489" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2010}]]></textFieldExpression> </textField> <textField> <reportElement style="2011" x="520" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2011}]]></textFieldExpression> </textField> <line> <reportElement x="99" y="0" width="1" height="12"/> </line> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band height="23" splitType="Stretch"> <textField> <reportElement x="435" y="0" width="80" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="515" y="0" width="40" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band splitType="Stretch"/> </summary></jasperReport>
  11. Hello, I am using iReport/JasperReport v.4. The attached report has a weired behavior : when exporting as HTML the report is missing data on column "Data Type" . If I try to export the same report as pdf everything looks normal . I checked the content of the html in order to make sure it was not a visualization problem but instead of the data I get an empty cell (image) : <td colspan="3"><img style="width: 119px; height: 12px;" src="../../ReportServices/image?jrprint=net.sf.jasperreports.j2ee.jasper_print1297856303724&image=px" alt=""></td> Am I doing something wrong ? TIA Marco Code:<?xml version="1.0" encoding="UTF-8"?><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="economic_coverage_report" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.5"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <style name="2008"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2008}.isEmpty() && !$F{2008}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2008}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <style name="2009"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2009}.isEmpty() && !$F{2009}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2009}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <style name="2010"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2010}.isEmpty() && !$F{2010}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2010}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <style name="2011"> <conditionalStyle> <conditionExpression><![CDATA[!$F{2011}.isEmpty() && !$F{2011}.matches( "na" )]]></conditionExpression> <style mode="Opaque" forecolor="#00FF00" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$F{2011}.isEmpty()]]></conditionExpression> <style mode="Opaque" forecolor="#FF0000" backcolor="#FF0000"/> </conditionalStyle> </style> <parameter name="Title" class="java.lang.String" isForPrompting="false"/> <queryString> <![CDATA[select "Country name" as label,"Data type" as data_type, "Variable group" as variable_group,"Variable" as variable, "2008", "2009", "2010", "2011"from "v_CoverageReport_dcf"]]> </queryString> <field name="label" class="java.lang.String"/> <field name="data_type" class="java.lang.String"/> <field name="variable_group" class="java.lang.String"/> <field name="variable" class="java.lang.String"/> <field name="2008" class="java.lang.String"/> <field name="2009" class="java.lang.String"/> <field name="2010" class="java.lang.String"/> <field name="2011" class="java.lang.String"/> <group name="Country"> <groupExpression><![CDATA[$F{label}]]></groupExpression> <groupHeader> <band height="15"> <textField> <reportElement x="47" y="0" width="100" height="15"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{label}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="0" width="47" height="15"/> <textElement/> <text><![CDATA[Country :]]></text> </staticText> </band> </groupHeader> </group> <group name="variable_group"> <groupExpression><![CDATA[$F{variable_group}]]></groupExpression> <groupHeader> <band height="1"> <line> <reportElement x="100" y="0" width="452" height="1"/> </line> </band> </groupHeader> </group> <background> <band splitType="Stretch"/> </background> <title> <band height="47" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="555" height="47"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="16" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{Title}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band height="15" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="100" height="15"/> <textElement/> <text><![CDATA[Data Type]]></text> </staticText> <staticText> <reportElement x="100" y="0" width="100" height="15"/> <textElement/> <text><![CDATA[variable group]]></text> </staticText> <staticText> <reportElement x="200" y="0" width="229" height="15"/> <textElement/> <text><![CDATA[Variable]]></text> </staticText> <staticText> <reportElement x="427" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2008]]></text> </staticText> <staticText> <reportElement x="458" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2009]]></text> </staticText> <staticText> <reportElement x="489" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2010]]></text> </staticText> <staticText> <reportElement x="520" y="0" width="31" height="15"/> <textElement/> <text><![CDATA[2011]]></text> </staticText> </band> </columnHeader> <detail> <band height="12" splitType="Stretch"> <textField> <reportElement positionType="Float" stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="0" width="100" height="12"/> <box> <topPen lineWidth="1.0"/> </box> <textElement> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{data_type}]]></textFieldExpression> </textField> <textField> <reportElement isPrintRepeatedValues="false" x="100" y="0" width="100" height="12" isPrintInFirstWholeBand="true"/> <textElement> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{variable_group}]]></textFieldExpression> </textField> <textField> <reportElement x="200" y="0" width="229" height="12"/> <textElement> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{variable}]]></textFieldExpression> </textField> <textField> <reportElement style="2008" x="427" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2008}]]></textFieldExpression> </textField> <textField> <reportElement style="2009" x="458" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2009}]]></textFieldExpression> </textField> <textField> <reportElement style="2010" x="489" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2010}]]></textFieldExpression> </textField> <textField> <reportElement style="2011" x="520" y="0" width="31" height="12"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement textAlignment="Center"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{2011}]]></textFieldExpression> </textField> <line> <reportElement x="99" y="0" width="1" height="12"/> </line> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band height="23" splitType="Stretch"> <textField> <reportElement x="435" y="0" width="80" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="515" y="0" width="40" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band splitType="Stretch"/> </summary></jasperReport>
  12. Hi Carl, thanks for the wonderful tip !! I will certainly use it in long reports ! Unfortunately, this particular report is not that long ... unless my "customers" want to have all the groups ( can be up to 20 pages ) . The average customer will be interested in one or two groups which shall fit into one single page...
  13. Matt, you're right. Sorry . Must have deleted when reformatted the tables in html in a rush of frustration. The right question was : is there any chance I can achieve something like that using iReport/JasperReport ? The first table is an example of what I have in the database. The second table is what I would like to print. I have achieved what you suggest but was struggling to make the report look better : the people I am doing it for come from excell and they are used to seeing merged cells. Is there any chance I can get to something similar to that ? What I was able to do so far is : a group for country and a group for variable. the values are all in the detail band. in group header for "group" a line that starts from the rightmost top angle of the table (value of 2011) and goes to the top left corner of group value. country value has the top and right border set so that I can somehow mimic the result of the second table I proposed here. two conditional styles for value of 2009,2010,2011 so that it paints red for !ok, green for ok, and leaves NA as is .As you say in your reply, the "group titlle" stays at the top ( or at the bottom if placed in the group footer ) ... I am trying to "move" the group title in the middle of the group. Thanks for any help/comments you may provide. Marco Post Edited by mferretti at 02/15/2011 09:05 Post Edited by mferretti at 02/15/2011 09:07 Post Edited by mferretti at 02/15/2011 09:08
  14. Hi I have been banging my head on the wall for quite some time now ... with the only result of a headache. I have a table like this country group variable 2009 2010 2011 acountry Group 1 variable 1 ok not ok na acountry Group 1 variable 2 ok not ok na acountry Group 1 variable 3 ok not ok na acountry Group 1 variable 4 ok not ok na acountry Group 1 variable 5 ok not ok na acountry Group 1 variable 6 ok not ok na acountry Group 2 variable 1 ok not ok na acountry Group 2 variable 2 ok not ok na acountry Group 2 variable 3 ok not ok na acountry Group 2 variable 4 ok not ok na acountry Group 2 variable 5 ok not ok na acountry Group 2 variable 6 ok not ok na country group variable 2009 2010 2011 acountry Group 1 variable 1 ok not ok na variable 1 ok not ok na variable 2 ok not ok na variable 3 ok not ok na variable 4 ok not ok na variable 5 ok not ok na Group 2 variable 1 ok not ok na variable 1 ok not ok na variable 2 ok not ok na variable 3 ok not ok na variable 4 ok not ok na variable 5 ok not ok na At all ??? Basically I would like some fields to span through the rows until they change value. Any clue ?? TIA Marco
  15. Hi after posting I kept on reading the forum and found this thread ( http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=26406 ) that rang a bell . The solution to my problem was storing the prints in different session objects and it works like a pie. I will need to implement a method that clears the current session or I will risk of filling it with useless garbage ... but that's another story. Code: Post Edited by mferretti at 02/03/2011 14:36
  16. Hi I have a slightly similar problem . My images are displayed but it looks like they are not up to date. Let me explain a little bit . I have a portlet that sends parameters to a servlet that serves the report as an html. So far so good. The problem is that if I change the restriction ( where clause in the SQL ) I do not get the correct chart reported. The "funny" thing is that if I copy the source of the chart and open it in another tab THAT image is correct. Once this is done, simply requesting the report again shows the correct chart. I am using the built in ImageServlet (see code) : Is there anything I am missing ? Some parameter to force reloading of images maybe ? Attaching a screenshot of what I see. Using jasper reports 4 Any help would really be appreciated. TIA Marco Code: <servlet> <description>built in servlet needed for serving images in html reports</description> <servlet-name>ImageServlet</servlet-name> <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class> </servlet>
  17. Hi, I think this is a bug. If not, then it should be documented. Here's what's happening. I have an expression that verifies a date . This expression is used in two conditional styles. The first style is used to paint the crosstab details, the second one is used for the crosstab headers. While the crosstab details paints fine ( green or red if the value of the content of the cell header is "less than or equal" or "greater than" than a parameter ) the crosstab header don't. Attached, please find the jrxml and what comes out in a pdf. Anyone has any idea ?? TIA --marco
  18. Hi, I would like to understand if it is possible to apply a conditional style to a crosstab cell grid. In my report, I would like to draw a, say, red thick line on the left of a column that matches a condition. So far I have been able to pain cells that meet the conditions. I tried using the pad but if the cell is empty the border is not drawn ( no matter if I enable or disable the property "blank when null" ) . Since I can see that the grid is painted anyways , I was wondering if there was a way of operating onto that . <crosstabCell width="10" height="10"> <cellContents backcolor="#8E8989" mode="Opaque" style="Crosstab Data Text"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField isBlankWhenNull="false"> <reportElement style="CrosstabCell" x="0" y="0" width="10" height="10"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.Long"><![CDATA[$V{countMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> As you can see I have styled both the reportElement ( inner ) and the cellContents element ( outer ). What I want to end up with is, in case the condition is met, the box element to be painted like it was <box><rightPen lineWidth="3.0" lineColor="#C80000"/></box>.In the code box I added the two styles I am using Code: <style name="Crosstab Data Text" mode="Opaque" forecolor="#000000" backcolor="#FFFFFF" hAlign="Center" vAlign="Middle" rotation="Left"> <conditionalStyle> <conditionExpression><![CDATA[$V{upload_date}.equals( $V{endDateMeasure} )]]></conditionExpression> <style mode="Opaque" forecolor="#000000" backcolor="#FFFFFF"> <pen lineColor="#FFFFFF"/> <box> <rightPen lineWidth="3.0" lineColor="#C80000"/> </box> </style> </conditionalStyle> </style> <style name="CrosstabCell" mode="Opaque" forecolor="#FFFFFF" backcolor="#FFFFFF" fill="Solid" hAlign="Center" vAlign="Middle" isBlankWhenNull="true"> <conditionalStyle> <conditionExpression><![CDATA[$V{upload_date}.before( $V{endDateMeasure} )]]></conditionExpression> <style mode="Opaque" forecolor="#00A000" backcolor="#00A000" isBlankWhenNull="false"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$V{upload_date}.after( $V{endDateMeasure} )]]></conditionExpression> <style mode="Opaque" forecolor="#C80000" backcolor="#C80000" isBlankWhenNull="false"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$V{upload_date}.equals( $V{endDateMeasure} )]]></conditionExpression> <style mode="Opaque" forecolor="#00A000" backcolor="#00A000" isBlankWhenNull="false"> <box> <rightPen lineWidth="0.0" lineColor="#FFFFFF"/> </box> </style> </conditionalStyle> </style>
  19. Ok solved. Maybe I should have mentioned that the style was to be applied to a crosstab ... since that's the problem !! As far as I have understood, crosstabs do not have access to report's parameters thus I had to create a measure and assign the parameter value to it. Then it was a matter of changing the style evaluation function and there u go !! : parameter : <parameter name="endDate" class="java.util.Date"> <defaultValueExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy").parse("06/06/2010")]]></defaultValueExpression> </parameter> measure : <measure name="endDateMeasure" class="java.util.Date"> <measureExpression><![CDATA[$P{endDate}]]></measureExpression></measure> style : <style name="CrosstabCell" mode="Opaque" forecolor="#FFFFFF" backcolor="#FFFFFF" hAlign="Center" vAlign="Middle" isBlankWhenNull="false"> <conditionalStyle> <conditionExpression><![CDATA[$V{upload_date}.before( $V{endDateMeasure} )]]></conditionExpression> <style mode="Opaque" forecolor="#000000" backcolor="#00A000" isBlankWhenNull="false"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$V{upload_date}.after( $V{endDateMeasure} )]]></conditionExpression> <style mode="Opaque" forecolor="#000000" backcolor="#C80000" isBlankWhenNull="false"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[$V{upload_date}.equals( $V{endDateMeasure} )]]></conditionExpression> <style mode="Opaque" forecolor="#000000" backcolor="#00A000" isBlankWhenNull="false" /> </conditionalStyle> </style>
  20. Do you know if it was planned to be fixed somewhere in the official iReport ditro ? I am using 3.7.6 and I get your exact same problem : Caused by: java.lang.NullPointerException     at com.jaspersoft.ireport.designer.compiler.prompt.PromptDialog.setParameter(PromptDialog.java:128)
  21. thanks for your reply and the time you took to test this . I did remove the parameter and the style and run the report : succeded then I tried re-inserting : added the parameter : ok added the style : ok this time i worked on the xml directly ...... Then I modified the style and re-run the preview ... and got the error again. if I do the remove/add described above it starts working again ... Could this be an iReport problem (some kind of unexpected state ) ? Post Edited by mferretti at 12/15/2010 10:08 Post Edited by mferretti at 12/15/2010 10:11
  22. I have created a parameter ( java.util.Date ) and used it in a conditional style : $V{upload_date}.equals( $P{endDate} ) When I try to preview the report I get the following : Compiling to file... /home/ferrema/Liferay-Portal/workspace/Plugins SDK/portlets/jasper-portlet/docroot/reports/Upload_Activity.jasper net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 1. Parameter not found : endDate at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:258) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:140) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:215) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:131) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:514) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Is there a way to use external parameters with conditional styles ? TIA Marco
  23. Hi I am using iReport 3.7.6 and am playing with conditional styles and applying it to a crosstab detail . When the condition is met I would like to set the background color to, say, green ... but the background is not set ( yes, I have played with the opaque option ). I know that the condition is met because, if I set the foreground to a different color than the default this appears. Is this a known bug or am I simply doing something wrong ? TIA marco Post Edited by mferretti at 12/15/2010 09:07
  24. for the time being I solved it with a subreport. I was wondering, though, is there a way to do it without using subreports ? The rationale behind it is that the table can contain millions of records : since the query is already performed on the master report ... is there any chance I can achieve this without having to re-query for each change of (group1,group2) ?
×
×
  • Create New...