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

anwarzamal25

Members
  • Posts

    5
  • 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 anwarzamal25

  1. iReport i create 4 fields;- EmployeeId $F{EmployeeId} EmployeeFirstName $F{EmployeeFrstName} EmployeeSecondName $F{EmployeeSecondName} EmployeeEmployeeAddress $F{EmployeeEmployeeAddress} EmployeeAge $F{EmployeeAge} In MYSQL Database i have 4 column,But in EmployeeAddress no values is there ok............. EmployeeId EmployeeFirstName EmployeeSecondName EmployeeAddress EmployeeAge 102 Peter K 34 103 Joy N 45 104 william K 38 105 Sanny V 24 when i execute query:-- select * from Employee where EmployeeId=102 then it generate the report its comming like that, space is comming between EmployeeSecondName and EmployeeAge i want to reduce that space............... EmployeeId 102 EmployeeFirstName Peter EmployeeSecondName K EmployeeAge 34 I want to generate report like this as i shown below....i want to reduce my space EmployeeId 102 EmployeeFirstName Peter EmployeeSecondName k EmployeeAge 34 in text fields properties i do this things;- I make all fields as isRemoveLinewhenblank ='true' position Type='float' stretch type='Relative to tallest object' Blank when null='true' how can i accomplised this pls help any body. thanks in Advanced
  2. How to hide Column Header if particular column does not contains any value Hi, I would like to hide the column header when there is no data available in a particular column fields .How do I implement this? can we do this using fields name Properties object ie(windows----------------->properties) OR we Have to change int the XML CODE Suppose i create one Table(Employee)which is having 4 fields EmpId EmpFirstName EmpLastName EmpAge 1 William 22 2 Hengry Kerly 24 3 Robert Berly 34 output: if i select select * from Employee where EmpId=1; then my ireport will be generated like this which column not having any details its not display in the report EmpId EmpFirstName Emp 1 William 22 am news with ireport tools i dont know where we have to go change in the code my Xml code is here <?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="sample" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="0" uuid="e6f67a14-570a-4046-9ab3-52cbb2cb9d36"> <property name="ireport.zoom" value="2.0"/> <property name="ireport.x" value="450"/> <property name="ireport.y" value="528"/> <style name="Title" fontName="Serif" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/> <style name="SubTitle" forecolor="#666666" fontName="Serif" fontSize="18"/> <style name="Column header" forecolor="#FFFFFF" fontName="Serif" fontSize="12" isBold="true"/> <style name="Detail" fontName="Serif" fontSize="12"/> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["/home/biztime/"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[sELECT * FROM Employee;]]> </queryString> <field name="EmployeeId" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="EmployeeFirstName" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="EmployeeSecondName" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="EmployeeAge" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="EmployeeAddress" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <variable name="EmployeeSecondName_1" class="java.lang.String" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeSecondName}]]></variableExpression> </variable> <variable name="EmployeeId_1" class="java.lang.Integer" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_2" class="java.lang.Integer" resetType="Column" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_3" class="java.lang.Integer" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_4" class="java.lang.Integer" calculation="System"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_5" class="java.lang.Integer" resetType="Column" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeFirstName_1" class="java.lang.String" resetType="Column" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeFirstName}]]></variableExpression> </variable> <variable name="EmployeeAddress" class="java.lang.String" calculation="Count"/> <group name="Group1"> <groupExpression><![CDATA[(int)($V{REPORT_COUNT}/15)]]></groupExpression> <groupHeader> <band height="40"> <staticText> <reportElement mode="Transparent" x="12" y="13" width="100" height="20" isRemoveLineWhenBlank="true" uuid="3aeea084-6d27-457c-bb0e-5d455609fcde"/> <textElement> <font fontName="Serif" size="12" isBold="true"/> </textElement> <text><![CDATA[EmployeeId]]></text> </staticText> <staticText> <reportElement x="146" y="10" width="177" height="20" isRemoveLineWhenBlank="true" uuid="664c98ba-24b9-4c87-8e86-eac17066a4e3"/> <textElement markup="none"> <font fontName="Serif" size="12" isBold="true" isUnderline="false"/> </textElement> <text><![CDATA[EmployeeFirstName]]></text> </staticText> <staticText> <reportElement x="323" y="13" width="154" height="20" isRemoveLineWhenBlank="true" uuid="f461036a-e9a0-4c21-9d7d-2a307e83a6d5"/> <textElement> <font fontName="Serif" size="12" isBold="true"/> </textElement> <text><![CDATA[EmployeeSecondName]]></text> </staticText> <staticText> <reportElement x="699" y="13" width="103" height="20" uuid="959acc83-336f-4941-98c6-6b860f628bd7"/> <textElement> <font fontName="Serif" size="12" isBold="true"/> </textElement> <text><![CDATA[EmployeeAge]]></text> </staticText> <staticText> <reportElement isPrintRepeatedValues="false" x="526" y="13" width="125" height="20" uuid="eff6e799-5902-444e-b586-15feb8a84ad7"/> <textElement> <font isBold="true"/> </textElement> <text><![CDATA[EmployeeAddress]]></text> </staticText> </band> </groupHeader> <groupFooter> <band height="30"> <frame> <reportElement mode="Opaque" x="652" y="0" width="150" height="30" forecolor="#CCCCCC" backcolor="#CCCCCC" uuid="9bcd5cd2-f3ed-41fc-9d6c-4702a5eb2d0a"/> </frame> </band> </groupFooter> </group> <group name="Group2"> <groupExpression><![CDATA[(int)($V{REPORT_COUNT}/5)]]></groupExpression> <groupHeader> <band height="30"/> </groupHeader> </group> <background> <band height="575" splitType="Stretch"> <frame> <reportElement mode="Opaque" x="-20" y="475" width="105" height="100" backcolor="#666666" uuid="622f9467-c399-4189-9d30-50ff7d9c52a5"/> <textField> <reportElement style="Column header" x="0" y="0" width="104" height="73" forecolor="#000000" uuid="f2a4aeb9-ff2e-44a5-9db2-bb5b0590e03a"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="54" isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement style="Column header" x="0" y="77" width="104" height="20" forecolor="#000000" uuid="96f7b50c-6c9d-441c-b9ec-e60299eac1ba"/> <box leftPadding="4" rightPadding="4"/> <textElement textAlignment="Center"> <font size="16" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <line> <reportElement mode="Transparent" x="42" y="73" width="20" height="1" backcolor="#FFFFFF" uuid="2117cc39-0ba0-44ad-be80-98daa5324bc6"/> </line> </frame> </band> </background> <title> <band height="105" splitType="Stretch"> <staticText> <reportElement x="222" y="35" width="280" height="36" uuid="48f86f36-c575-421a-ba54-797ace4f0917"/> <textElement textAlignment="Justified"> <font fontName="Serif" size="24"/> </textElement> <text><![CDATA[ EMPLOYEE REPORT]]></text> </staticText> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band height="156" splitType="Stretch"/> </columnHeader> <detail> <band height="31" splitType="Stretch"> <textField pattern="#,##0.00" isBlankWhenNull="true"> <reportElement x="0" y="5" width="98" height="20" isRemoveLineWhenBlank="true" uuid="c623e57a-404e-4820-91f4-a7808b3d316d"/> <textElement> <font fontName="Serif" isItalic="false" isUnderline="false"/> </textElement> <textFieldExpression><![CDATA[$F{EmployeeId}]]></textFieldExpression> </textField> <textField> <reportElement x="163" y="5" width="128" height="23" uuid="73bc515a-8af9-4ef0-aca5-35bb41a30892"/> <textFieldExpression><![CDATA[$F{EmployeeFirstName}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="true"> <reportElement x="323" y="5" width="154" height="23" isRemoveLineWhenBlank="true" uuid="94e1ec36-478a-4761-b49a-8502057c2a08"/> <textFieldExpression><![CDATA[$F{EmployeeSecondName}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement x="699" y="5" width="103" height="23" isRemoveLineWhenBlank="true" uuid="2d6f40ac-098a-4c11-a3cd-e432b1f12bb5"/> <textFieldExpression><![CDATA[$F{EmployeeAge}]]></textFieldExpression> </textField> <textField> <reportElement isPrintRepeatedValues="false" x="526" y="11" width="125" height="20" uuid="a7252ea2-52b4-49ba-8a2a-88517600bdfa"/> <textFieldExpression><![CDATA[$F{EmployeeAddress}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band height="39" splitType="Stretch"> <textField pattern="EEEEE dd MMMMM yyyy"> <reportElement style="Column header" x="671" y="0" width="131" height="20" forecolor="#000000" uuid="1632c120-8789-4389-8a3e-8e68b964393d"/> <textElement textAlignment="Right"> <font size="12" isBold="false"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band splitType="Stretch"/> </summary> </jasperReport> Thanks & Regards
  3. I'm printing a report using ireport tools Consider there is a table Student which having 4 columns Student-Id, Student-First Name, Student-Last Name, and Student-Age. In My Student Table Student-Last Name column not contain any values. i want to generate a report in such a way that if any column name not contains any values then that column name shifted to another column name, in place of previous column name. Student-Id Student-First Name Student-Last Name StudentAge 201 Vinay 24 202 Kishore 26 203 Komal 28 So went I display my report, I want My Student-Age column name come in placed of Student-Last Name . Output: tudent-Id Student-First Name StudentAge 201 Vinay 24 202 Kishore 26 203 Komal 28How can I accomplish this? Please help. Thanks & Regards
  4. Sir suppose my EmployeeSecondName does not contain any value so i compare with my column value with 0(zere)its mean if column value will be zero its return dash(-). can you plesae post the correct code. Thanks & Regards Anwar
  5. i want to display dash ("-") from database those column value will be Zero. Consider there is a table Employee which has 4 columns EmpId , EmpFirstName , EmpSecondName, EmpAge EmpId EmpFirstName EmpSecondName EmpAge 101 Jackson Bilson 45 102 Willson 25103 Barley 23 output: EmpId EmpFirstName EmpSecondName EmpAge 101 Jackson Bilson 45 102 Willson -- 25103 Barley -- 23 my XML source code is here <?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="sample" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="0" uuid="e6f67a14-570a-4046-9ab3- 52cbb2cb9d36"> <property name="ireport.zoom" value="2.0"/> <property name="ireport.x" value="8"/> <property name="ireport.y" value="626"/> <style name="Title" fontName="Serif" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/> <style name="SubTitle" forecolor="#666666" fontName="Serif" fontSize="18"/> <style name="Column header" forecolor="#FFFFFF" fontName="Serif" fontSize="12" isBold="true"/> <style name="Detail" fontName="Serif" fontSize="12"/> <queryString> <![CDATA[sELECT * FROM Employee;]]> </queryString> <field name="EmployeeId" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="EmployeeFirstName" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="EmployeeSecondName" class="java.lang.String"> <fieldDescription><![CDATA["$F{EmployeeSecondName}.equals("0") ? "--" : $F{EmployeeSecondName}"]]></fieldDescription> </field> <field name="EmployeeAge" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <variable name="EmployeeSecondName_1" class="java.lang.Integer" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeSecondName}]]></variableExpression> </variable> <variable name="EmployeeId_1" class="java.lang.Integer" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_2" class="java.lang.Integer" resetType="Column" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_3" class="java.lang.Integer" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_4" class="java.lang.Integer" calculation="System"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeId_5" class="java.lang.Integer" resetType="Column" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeId}]]></variableExpression> </variable> <variable name="EmployeeFirstName_1" class="java.lang.Integer" resetType="Column" calculation="Count"> <variableExpression><![CDATA[$F{EmployeeFirstName}]]></variableExpression> </variable> <group name="Group1"> <groupExpression><![CDATA[(int)($V{REPORT_COUNT}/15)]]></groupExpression> <groupHeader> <band height="40"> <staticText> <reportElement x="12" y="13" width="100" height="20" uuid="3aeea084-6d27-457c-bb0e-5d455609fcde"/> <textElement> <font fontName="Serif" size="12" isBold="true"/> </textElement> <text><![CDATA["EmployeeId"]]></text> </staticText> <staticText> <reportElement x="146" y="10" width="177" height="20" uuid="664c98ba-24b9-4c87-8e86-eac17066a4e3"/> <textElement> <font fontName="Serif" size="12" isBold="true"/> </textElement> <text><![CDATA["EmployeeFirstName"]]></text> </staticText> <staticText> <reportElement x="426" y="13" width="168" height="20" uuid="f461036a-e9a0-4c21-9d7d-2a307e83a6d5"/> <textElement> <font fontName="Serif" size="12" isBold="true"/> </textElement> <text><![CDATA["EmployeeSecondName""]]></text> </staticText> <staticText> <reportElement x="671" y="13" width="106" height="20" uuid="959acc83-336f-4941-98c6-6b860f628bd7"/> <textElement> <font fontName="Serif" size="12" isBold="true"/> </textElement> <text><![CDATA["EmployeeAge"]]></text> </staticText> </band> </groupHeader> <groupFooter> <band height="30"> <frame> <reportElement mode="Opaque" x="652" y="0" width="150" height="30" forecolor="#CCCCCC" backcolor="#CCCCCC" uuid="9bcd5cd2-f3ed-41fc-9d6c-4702a5eb2d0a"/> </frame> </band> </groupFooter> </group> <group name="Group2"> <groupExpression><![CDATA[(int)($V{REPORT_COUNT}/5)]]></groupExpression> <groupHeader> <band height="30"/> </groupHeader> </group> <background> <band height="575" splitType="Stretch"> <frame> <reportElement mode="Opaque" x="-20" y="475" width="105" height="100" backcolor="#666666" uuid="622f9467-c399-4189-9d30-50ff7d9c52a5"/> <textField> <reportElement style="Column header" x="0" y="0" width="104" height="73" forecolor="#000000" uuid="f2a4aeb9-ff2e-44a5-9db2-bb5b0590e03a"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="54" isBold="true" pdfFontName="Helvetica-Bold"/> </textElement> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement style="Column header" x="0" y="77" width="104" height="20" forecolor="#000000" uuid="96f7b50c-6c9d-441c-b9ec-e60299eac1ba"/> <box leftPadding="4" rightPadding="4"/> <textElement textAlignment="Center"> <font size="16" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <line> <reportElement mode="Transparent" x="42" y="73" width="20" height="1" backcolor="#FFFFFF" uuid="2117cc39-0ba0-44ad-be80-98daa5324bc6"/> </line> </frame> </band> </background> <title> <band height="105" splitType="Stretch"> <staticText> <reportElement x="222" y="35" width="280" height="36" uuid="48f86f36-c575-421a-ba54-797ace4f0917"/> <textElement textAlignment="Justified"> <font fontName="Serif" size="24"/> </textElement> <text><![CDATA[ EMPLOYEE REPORT]]></text> </staticText> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band height="156" splitType="Stretch"/> </columnHeader> <detail> <band height="47" splitType="Stretch"> <textField pattern="#,##0.00"> <reportElement x="0" y="5" width="98" height="20" uuid="c623e57a-404e-4820-91f4-a7808b3d316d"/> <textElement> <font fontName="Serif"/> </textElement> <textFieldExpression><![CDATA[$F{EmployeeId}]]></textFieldExpression> </textField> <textField> <reportElement x="163" y="5" width="128" height="23" uuid="73bc515a-8af9-4ef0-aca5-35bb41a30892"/> <textFieldExpression><![CDATA[$F{EmployeeFirstName}]]></textFieldExpression> </textField> <textField> <reportElement x="426" y="5" width="151" height="23" uuid="94e1ec36-478a-4761-b49a-8502057c2a08"/> <textFieldExpression><![CDATA[$F{EmployeeSecondName}]]></textFieldExpression> </textField> <textField> <reportElement x="642" y="5" width="108" height="23" uuid="2d6f40ac-098a-4c11-a3cd-e432b1f12bb5"/> <textFieldExpression><![CDATA[$F{EmployeeAge}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band splitType="Stretch"/> </columnFooter> <pageFooter> <band height="39" splitType="Stretch"> <textField pattern="EEEEE dd MMMMM yyyy"> <reportElement style="Column header" x="671" y="0" width="131" height="20" forecolor="#000000" uuid="1632c120-8789-4389-8a3e-8e68b964393d"/> <textElement textAlignment="Right"> <font size="12" isBold="false"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band splitType="Stretch"/> </summary> </jasperReport> am using this syntax in Xml code but not working please help me "$F{EmployeeSecondName}.equals("0") ? "--" : $F{EmployeeSecondName
×
×
  • Create New...