Jump to content
JasperReports 7.0 is now available ×

quacker.2715

Members
  • Posts

    5
  • Joined

  • Last visited

quacker.2715's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Is it a single report with page count reset after group break? May be related to my issue http://community.jaspersoft.com/questions/1051991/page-count-out-sync-when-using-group-keep-together-option
  2. Try to capture/inspect the sql statement sent to oracle server.
  3. I have been unable to figure out how to show/hide a group header based on group distinct count. Here is what I have done so far: create a variable - calculation=distinct count; field=group field; reset=reportput variable on a detail, set evaluation to report and it is showing 2 (correct value).However, I am unable to use the distinct count value on detail in print condition. Is there a way to force the value to be evaluated at the beginning of the report? <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 5.6.1.final using JasperReports Library version 5.6.1 --><!-- 2017-06-06T11:54:27 --><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="Evaluate" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a736ce53-7e76-4194-9086-96d2270a6250"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/><queryString language="SQL"><![CDATA[select Company, Accfrom (values ('abc','Account1'),('abc','Account2'),('abc','Account3'),('abc','Account4'),('abc','Account5'),('abc','Account6'),('xyz','Account7'),('xyz','Account8'),('xyz','Account9'),('xyz','Account10'),('xyz','Account11'),('xyz','Account12'),('xyz','Account13')) as a(Company,Acc)]]></queryString><field name="COMPANY" class="java.lang.String"/><field name="ACC" class="java.lang.String"/><variable name="companyCount" class="java.lang.Integer" calculation="DistinctCount"><variableExpression><![CDATA[$F{COMPANY}]]></variableExpression><initialValueExpression><![CDATA[0]]></initialValueExpression></variable><group name="grpCompany"><groupExpression><![CDATA[$F{COMPANY}]]></groupExpression><groupHeader><band height="32"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/><frame><reportElement mode="Transparent" x="0" y="0" width="800" height="14" uuid="a5fce2e6-5f35-402f-ba08-6f9179391631"><printWhenExpression><![CDATA[$V{companyCount}.compareTo(1) > 0]]></printWhenExpression></reportElement><textField><reportElement x="0" y="0" width="227" height="14" forecolor="#FF0000" uuid="ad19fa74-c16c-4357-8160-94f9e743bd5f"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[msg("{0} Header",$F{COMPANY})]]></textFieldExpression></textField></frame><frame><reportElement mode="Transparent" x="0" y="16" width="800" height="14" uuid="a5fce2e6-5f35-402f-ba08-6f9179391631"><property name="local_mesure_unitx" value="pixel"/><property name="com.jaspersoft.studio.unit.x" value="px"/><property name="local_mesure_unity" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="px"/><printWhenExpression><![CDATA[$V{companyCount}.compareTo(1) == 0]]></printWhenExpression></reportElement><textField><reportElement x="0" y="0" width="227" height="14" uuid="ad19fa74-c16c-4357-8160-94f9e743bd5f"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[msg("{0} Header",$F{COMPANY})]]></textFieldExpression></textField></frame></band></groupHeader><groupFooter><band height="32"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/><frame><reportElement mode="Transparent" x="0" y="0" width="800" height="14" uuid="a5fce2e6-5f35-402f-ba08-6f9179391631"><printWhenExpression><![CDATA[$V{companyCount}.compareTo(1) > 0]]></printWhenExpression></reportElement><textField><reportElement x="0" y="0" width="227" height="14" forecolor="#FF0000" uuid="ad19fa74-c16c-4357-8160-94f9e743bd5f"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[msg("{0} Footer",$F{COMPANY})]]></textFieldExpression></textField></frame><frame><reportElement mode="Transparent" x="0" y="16" width="800" height="14" uuid="a5fce2e6-5f35-402f-ba08-6f9179391631"><property name="local_mesure_unitx" value="pixel"/><property name="com.jaspersoft.studio.unit.x" value="px"/><property name="local_mesure_unity" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="px"/><printWhenExpression><![CDATA[$V{companyCount}.compareTo(1) == 0]]></printWhenExpression></reportElement><textField><reportElement x="0" y="0" width="227" height="14" uuid="ad19fa74-c16c-4357-8160-94f9e743bd5f"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[msg("{0} Footer",$F{COMPANY})]]></textFieldExpression></textField></frame></band></groupFooter></group><detail><band height="15" splitType="Stretch"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/><frame><reportElement key="CSV_EXPORT" mode="Transparent" x="0" y="0" width="800" height="13" uuid="7e787b7d-8fae-466e-9924-e08ade8dffaf"/><textField evaluationTime="Band" pattern=""><reportElement x="20" y="0" width="190" height="12" uuid="71dcc6e8-ebea-4cc5-a3a3-6ba27b17a35b"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textElement><font fontName="SansSerif" size="8"/></textElement><textFieldExpression><![CDATA[$V{companyCount}.compareTo(1) > 0 ? "More than one": "Only One"]]></textFieldExpression></textField><textField evaluationTime="Report"><reportElement x="227" y="0" width="100" height="12" uuid="628df114-8f8b-4059-8f7c-d9a62978b157"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textElement><font size="8"/></textElement><textFieldExpression><![CDATA[$V{companyCount}]]></textFieldExpression></textField><textField evaluationTime="Auto"><reportElement x="350" y="0" width="100" height="12" uuid="c4bf9f14-b316-4067-8e2a-c2cc78d31274"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textElement><font size="8"/></textElement><textFieldExpression><![CDATA[$F{ACC}]]></textFieldExpression></textField></frame></band></detail></jasperReport>
  4. In a report where group keep together option is on, page count does not always start as 1 on a new page. It seems the event is: calculate page countprint page observing keep together, if overflow print to next page, but it does not recalculate the page countHere is a sample report, note on page 3 the page count is out of sync. How can I detect if the row is the first one on the page? <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 5.6.1.final using JasperReports Library version 5.6.1 --><!-- 2017-06-01T08:50:29 --><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="PageCount" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d8c19cca-a276-411e-aa70-cf6409ab99bb"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/><queryString language="SQL"><![CDATA[select *from (values('A','1','Description Grp:A-1'),('A','1','Description Grp:A-2'),('A','1','Description Grp:A-3'),('A','1','Description Grp:A-4'),('A','1','Description Grp:A-5'),('A','1','Description Grp:A-6'),('A','1','Description Grp:A-7'),('A','1','Description Grp:A-8'),('A','1','Description Grp:A-9'),('A','2','Description Grp:A-10'),('A','2','Description Grp:A-11'),('A','2','Description Grp:A-12'),('A','2','Description Grp:A-13'),('A','2','Description Grp:A-14'),('A','2','Description Grp:A-15'),('A','2','Description Grp:A-16'),('A','2','Description Grp:A-17'),('A','2','Description Grp:A-18'),('A','2','Description Grp:A-19'),('A','2','Description Grp:A-20'),('A','2','Description Grp:A-21'),('B','3','Description Grp:B-1'),('B','3','Description Grp:B-2'),('B','3','Description Grp:B-3'),('B','3','Description Grp:B-4'),('B','3','Description Grp:B-5'),('B','3','Description Grp:B-6'),('B','3','Description Grp:B-7'),('B','3','Description Grp:B-8'),('B','3','Description Grp:B-9'),('B','3','Description Grp:B-10'),('B','4','Description Grp:B-11'),('B','4','Description Grp:B-12'),('B','4','Description Grp:B-13'),('B','4','Description Grp:B-14'),('B','4','Description Grp:B-15'),('B','4','Description Grp:B-16'),('B','4','Description Grp:B-17')) as a (col1,col2,col3)]]></queryString><field name="COL1" class="java.lang.String"/><field name="COL2" class="java.lang.String"/><field name="COL3" class="java.lang.String"/><group name="grpCol1" isReprintHeaderOnEachPage="true" keepTogether="true"><groupExpression><![CDATA[$F{COL1}]]></groupExpression><groupHeader><band height="19"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/><textField><reportElement x="0" y="0" width="360" height="14" uuid="e226b658-5b82-4d00-b9e3-7fc25e25b511"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[$F{COL1}]]></textFieldExpression></textField></band></groupHeader></group><group name="grpCol2" isReprintHeaderOnEachPage="true" keepTogether="true"><groupExpression><![CDATA[$F{COL2}]]></groupExpression><groupHeader><band height="19"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/><textField><reportElement x="10" y="0" width="240" height="14" uuid="0ec67ee7-7ca0-4c93-9f63-806e56768d2b"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[$F{COL2}]]></textFieldExpression></textField></band></groupHeader></group><pageHeader><band height="35" splitType="Stretch"/></pageHeader><columnHeader><band height="19" splitType="Stretch"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/><staticText><reportElement x="380" y="0" width="100" height="13" uuid="9fc501f9-78f6-4673-87ca-a00276f25377"><property name="com.jaspersoft.studio.unit.y" value="px"/></reportElement><text><![CDATA[Group Count 1]]></text></staticText><staticText><reportElement x="480" y="0" width="100" height="13" uuid="c1a8dca0-ddc8-4cb2-a5d1-8b4ad520b67c"><property name="com.jaspersoft.studio.unit.y" value="px"/><property name="local_mesure_unity" value="pixel"/></reportElement><text><![CDATA[Group Count 2]]></text></staticText><staticText><reportElement x="580" y="1" width="100" height="13" uuid="5f613aaf-4f3b-4be3-93c6-014187e57f15"><property name="local_mesure_unity" value="pixel"/><property name="com.jaspersoft.studio.unit.y" value="px"/></reportElement><text><![CDATA[Page Count]]></text></staticText></band></columnHeader><detail><band height="20" splitType="Stretch"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/><textField><reportElement x="10" y="0" width="360" height="13" uuid="b0418a70-7176-450a-b25b-90ee665c72d7"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[$F{COL3}]]></textFieldExpression></textField><textField><reportElement x="380" y="0" width="100" height="13" uuid="2d7357ee-4de1-4d66-8d0c-ff67647b3477"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[$V{grpCol1_COUNT}]]></textFieldExpression></textField><textField><reportElement x="480" y="0" width="100" height="13" uuid="2842ef4b-3bed-403c-b00d-836060541013"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textFieldExpression><![CDATA[$V{grpCol2_COUNT}]]></textFieldExpression></textField><textField><reportElement x="580" y="1" width="100" height="13" uuid="6369eec8-4f0f-4b3d-a558-1cb83681711c"/><textFieldExpression><![CDATA[$V{PAGE_COUNT}]]></textFieldExpression></textField></band></detail><pageFooter><band height="54" splitType="Stretch"/></pageFooter></jasperReport>
  5. My report is using a parameter to determine the report title. It is displaying null when there is no data. I've tried changing the variable $V{reportName} Evaluation Time, but no luck. Can anybody help me? Thanks. PS: It is using mssql data adapter and the current querystring does not return any row. To return rows, change 2=1 to 1=1. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 5.6.1.final using JasperReports Library version 5.6.1 --><!-- 2017-05-01T15:39:40 --><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="Evaluate" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a736ce53-7e76-4194-9086-96d2270a6250"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="SQLEXPRESSR2"/> <parameter name="ReportType" class="java.lang.String"> <defaultValueExpression><![CDATA["A"]]></defaultValueExpression> </parameter> <queryString language="SQL"> <![CDATA[select Col1 from (values (1),(2)) as a(Col1) where 2=1]]> </queryString> <field name="Col1" class="java.lang.Integer"/> <variable name="ReportName" class="java.lang.String"> <variableExpression><![CDATA[$P{ReportType}.equals("A")? $V{reportTitleA}:$V{reportTitleB}]]></variableExpression> </variable> <variable name="reportTitleA" class="java.lang.String"> <variableExpression><![CDATA["Report A"]]></variableExpression> </variable> <variable name="reportTitleB" class="java.lang.String"> <variableExpression><![CDATA["Report Other"]]></variableExpression> </variable> <pageHeader> <band height="22" splitType="Stretch"> <textField evaluationTime="Report"> <reportElement x="0" y="0" width="390" height="20" uuid="98c519b9-7350-4cd6-a71e-f2fb1c0e7b80"/> <textFieldExpression><![CDATA[$V{ReportName}]]></textFieldExpression> </textField> </band> </pageHeader> <columnHeader> <band height="14" splitType="Stretch"/> </columnHeader> <detail> <band height="15" splitType="Stretch"> <property name="local_mesure_unitheight" value="pixel"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <textField> <reportElement x="0" y="0" width="100" height="14" uuid="82ab5741-1138-4173-88f5-42ef07a6cb9f"> <property name="local_mesure_unitheight" value="pixel"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> </reportElement> <textFieldExpression><![CDATA[$F{Col1}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]
×
×
  • Create New...