Jump to content
Changes to the Jaspersoft community edition download ×


  • Posts

  • Joined

  • Last visited

ckgupta's Achievements


Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges



  1. Thanks frankhassanabad for your response. I do not feel the need of sliding other colums to the left automatically, its ok if that column appears blank. What my concern is that the column header should not be visible if there is no data for that field in any row. for example for data in dataBase as ------------------------------- Name Classs RollNo ------- ---------- ----------- John <null> 102 Mark <null> 103 Robert <null> 104 Report should look like ---------------------------------- Name RollNo ------- ----------- John 102 Mark 103 Robert 104
  2. 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="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="13"/> <property name="ireport.y" value="0"/> <field name="name" class="java.lang.String"/> <field name="class" class="java.lang.String"/> <field name="rollNo" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band height="20" splitType="Stretch"> <staticText> <reportElement x="0" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[Name]]></text> </staticText> <staticText> <reportElement x="72" y="0" width="62" height="20"> <printWhenExpression><![CDATA[$F{class} != null]]></printWhenExpression> </reportElement> <textElement textAlignment="Center"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[Class]]></text> </staticText> <staticText> <reportElement x="147" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12" isBold="true"/> </textElement> <text><![CDATA[Roll No]]></text> </staticText> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band splitType="Stretch"/> </columnHeader> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression> </textField> <textField> <reportElement x="72" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{class}]]></textFieldExpression> </textField> <textField> <reportElement x="147" y="0" width="62" height="20"/> <textElement textAlignment="Center"> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{rollNo}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band splitType="Stretch"/> </pageFooter> <summary> <band splitType="Stretch"/> </summary> </jasperReport>
  3. PFA jrxml . I would like to give a brief explanation on it . Consider there is a table Student which has 3 columns Name, Class, RollNo Name Classs RollNo ------- ---------- ----------- John <null> 102 Mark XI 103 Robert XII 104 So when I want to display it in report I want to write a printWhenExpression for Class i.e., column header which will be displayed only if there is any non null value available , so in the previous case Class should be displayed ================================================= Now, if we consider an example as written below Name Classs RollNo ------- ---------- ----------- John <null> 102 Mark <null> 103 Robert <null> 104 Then Class should not even be displayed in report as none of the tuples has non null field in it.
  4. Hi , I want to put a printWhenExpression on a static text based on a condition which says that print the label only if there is atleast a non null textField in a particular column in detail band. Its like print the column header only if there is a non null field in that column. I tried putting this expression ( $F{textfield} != null ) but it works only for first record, if first record has null and second record has not null value then the label will be hidden, where as we want it to be displayed. Please reply if you need any more info. Regards, ckgupta
  5. Can this method that you suggested be applied if it dataSource is og type JRResultSetDataSource. I tried passing JRResultSetDataSource as a parameter to subreports , but when I ran it says resultSet is closed. Can you please help me on this . Thanks, ckgupta
  6. luv2eat Wrote: Hi, thanks for the reply. i managed to work out passing the datasources to the all the reports, master and sub. however, that worked fine as long as the datasources only have one record. when there are multiple records i get a "unable to get next record" error from jasperreport (the reports are called by a java application-not from iReport). i did a little research and it seemed that the resultset was closed so the next() of JRResultSetDataSource object could not get to it. would you be able to offer any suggestion regarding that? thanks. m also getting this same kind of error , Can anybody please help on this ?
  7. Hi, I m using dataSourceExpression to pass data to a subreport , it works perfectly fine for a subreport , but while calling a subreport within another subreport using dataSourceExpression it is not working . Can anybody help me on this as I m in urgent need of it. I have attached a zip file containing the 3 reports MainReport -> subreport1 -> subreport2 . and a java class for generating the reports. Thanks & Best Regards, Chandrakant
  • Create New...