ajay_1311
Members-
Posts
15 -
Joined
-
Last visited
ajay_1311's Achievements
-
Hi, For Parent data -: Main report Datasource (xpath) = /riders/rider in Main report Group= $F{riderCode} For Child data-: You can use "List" Component in details band, creating one more dataset inside report which will be SubCategory of XML data. Below is the sample working fine-: (Create/use xml data adapter, same as XML mentioned in question) Output-: Jrxml Code -: <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.1.0.final using JasperReports Library version 6.0.2 --><!-- 2016-09-21T16:55:21 --><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="SampleXMLsource" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4959202e-c791-4e25-83cc-e1199cff9a69"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="SampleXML"/><import value="net.sf.jasperreports.engine.data.JRXmlDataSource"/><import value="net.sf.jasperreports.engine.JRDataSource"/><subDataset name="Grp1" uuid="9c262504-1bbe-4430-9bdb-633382643914"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="SampleXML"/><queryString language="xPath"><![CDATA[/riders/rider/benefits/benefit]]></queryString><field name="code_1" class="java.lang.String"><fieldDescription><![CDATA]></fieldDescription></field><field name="label_1" class="java.lang.String"><fieldDescription><![CDATA[label]]></fieldDescription></field><field name="price_1" class="java.lang.String"><fieldDescription><![CDATA[price]]></fieldDescription></field></subDataset><queryString language="xPath"><![CDATA[/riders/rider]]></queryString><field name="riderCode_1" class="java.lang.String"><fieldDescription><![CDATA[riderCode]]></fieldDescription></field><field name="riderName_1" class="java.lang.String"><fieldDescription><![CDATA[riderName]]></fieldDescription></field><field name="riderDescription_1" class="java.lang.String"><fieldDescription><![CDATA[riderDescription]]></fieldDescription></field><group name="rider"><groupExpression><![CDATA[$F{riderCode_1}]]></groupExpression><groupHeader><band height="15"><textField><reportElement mode="Opaque" x="0" y="0" width="215" height="15" backcolor="#F0E6E6" uuid="d5ea8186-2f14-494b-9629-dcdacaabf2bd"/><box leftPadding="10"/><textElement textAlignment="Left" verticalAlignment="Middle"><font fontName="Calibri" isBold="true"/></textElement><textFieldExpression><![CDATA[$F{riderName_1}]]></textFieldExpression></textField></band></groupHeader><groupFooter><band height="21"/></groupFooter></group><background><band splitType="Stretch"/></background><detail><band height="25" splitType="Stretch"><componentElement><reportElement x="35" y="0" width="315" height="25" uuid="d76b1167-69d3-47fa-8526-9ba5e849818c"/><jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"><datasetRun subDataset="Grp1" uuid="f4054377-5bba-4959-a926-0d75181db891"><dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/rider/benefits/benefit")]]></dataSourceExpression></datasetRun><jr:listContents height="25" width="315"><textField><reportElement x="5" y="1" width="100" height="20" uuid="78f03b07-07ab-4f1a-9795-9eee4293a433"/><textElement verticalAlignment="Middle"><font fontName="Calibri" size="11"/></textElement><textFieldExpression><![CDATA[$F{code_1}]]></textFieldExpression></textField><textField><reportElement x="110" y="1" width="100" height="20" uuid="77c5486e-e2d8-4bc2-ab04-10d00e34a83f"/><textElement verticalAlignment="Middle"><font fontName="Calibri" size="11" isBold="true" isUnderline="true"/></textElement><textFieldExpression><![CDATA[$F{label_1}]]></textFieldExpression></textField><textField><reportElement x="215" y="1" width="100" height="20" uuid="3b2ccadc-aa7c-4445-90ce-7fe660d2e1d7"/><textElement verticalAlignment="Middle"><font fontName="Calibri" size="11"/></textElement><textFieldExpression><![CDATA[$F{price_1}]]></textFieldExpression></textField></jr:listContents></jr:list></componentElement></band></detail></jasperReport> RegardsAjay
- 1 reply
-
- xml
- sub report
-
(and 1 more)
Tagged with:
-
Have you tried "Input control" ? help link below http://community.jaspersoft.com/documentation/jasperreports-server-user-guide/adding-input-controls Regards Ajay
- 1 reply
-
- report
- jaspersoft
-
(and 1 more)
Tagged with:
-
call procedure name only with parameter-: In dataset and queries <prcedure_name><parameter1>,<parametter2> e.g 1) dbo.SP_Report $P{date_from}, $P{date_to} OR 2) dbo.SP_Report @p1=$P{date_from}, @p2=$P{date_to} 3) call dbo.SP_Report $P{date_from}, $P{date_to} Regards Ajay
-
whats the Error?
-
Hello, Check Sample below - is working fine Changes in advanced properties=> PDF => <textElement markup="none"><font fontName="Arial Unicode MS" size="24" pdfFontName="C:/WINDOWS/fonts/ARIALUNI.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/></textElement><text><![CDATA[गंगासदन सोसायटी समोर आकाश जनरल स्टोअर्स]]></text> <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.0.2 --><!-- 2016-09-06T15:44:57 --><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="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a7252b9b-b7ba-46a4-a796-1a93d6093d59"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/><queryString><![CDATA[]]></queryString><background><band splitType="Stretch"/></background><title><band height="79" splitType="Stretch"/></title><pageHeader><band height="35" splitType="Stretch"/></pageHeader><columnHeader><band height="302" splitType="Stretch"><staticText><reportElement x="20" y="10" width="510" height="60" uuid="793f8b25-606b-4305-911f-499aec1f1e05"><property name="local_mesure_unitheight" value="pixel"/><property name="com.jaspersoft.studio.unit.height" value="px"/></reportElement><textElement markup="none"><font fontName="Arial Unicode MS" size="24" pdfFontName="C:/WINDOWS/fonts/ARIALUNI.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/></textElement><text><![CDATA[गंगासदन सोसायटी समोर आकाश जनरल स्टोअर्स]]></text></staticText><textField><reportElement x="20" y="90" width="540" height="60" forecolor="#002AFC" uuid="58e99388-7e5b-4f5e-b724-c5e56861fdd4"/><textElement markup="html"><font fontName="Arial Unicode MS" size="24" pdfFontName="C:/WINDOWS/fonts/ARIALUNI.TTF" pdfEncoding="Identity-H" isPdfEmbedded="true"/></textElement><textFieldExpression><![CDATA["<b>गंगासदन सोसायटी समोर आकाश जनरल स्टोअर्स</b>"]]></textFieldExpression></textField><textField><reportElement x="20" y="150" width="100" height="30" uuid="be1ab8d6-254f-4978-b800-ef24642bd0f3"/><textElement><font fontName="Arial Unicode MS" size="20" pdfFontName="C:/WINDOWS/fonts/ARIALUNI.TTF" pdfEncoding="Identity-V" isPdfEmbedded="true"/></textElement><textFieldExpression><![CDATA["अजय"]]></textFieldExpression></textField></band></columnHeader><detail><band height="125" splitType="Stretch"/></detail><columnFooter><band height="45" splitType="Stretch"/></columnFooter><pageFooter><band height="54" splitType="Stretch"/></pageFooter><summary><band height="42" splitType="Stretch"/></summary></jasperReport> Nahi zal tar sang..
-
Check If you can use UNION Query E.g. Select year, month, day, hour, someValue_1 from Table1 Union Select 0, 0, 0,hour,0 from TableStaticHour --Ajay Patil
-
Hello, Please check sample below its working fine. USE Sample DB to run the report. <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.0.final using JasperReports Library version 6.0.2 --><!-- 2016-09-06T10:50:31 --><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="CrossTab" language="groovy" pageWidth="2000" pageHeight="800" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="1960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Key" uuid="e16b8ea9-0c78-4688-9968-aa0bf612aa76"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/><property name="com.jaspersoft.studio.data.sql.tables" value="Ik9SREVSUyIgQVMgLDE2Miw0NCwwOTlhNjRlYS00NWE5LTRmMTUtOWNmOS1mOTg1YWM2NjUwZGQ7"/><property name="com.jaspersoft.studio.unit." value="pixel"/><style name="Crosstab_CH" mode="Opaque" backcolor="#F0F8FF"><box><pen lineWidth="0.5" lineColor="#000000"/><topPen lineWidth="0.5" lineColor="#000000"/><leftPen lineWidth="0.5" lineColor="#000000"/><bottomPen lineWidth="0.5" lineColor="#000000"/><rightPen lineWidth="0.5" lineColor="#000000"/></box></style><style name="Crosstab_CG" mode="Opaque" backcolor="#BFE1FF"><box><pen lineWidth="0.5" lineColor="#000000"/><topPen lineWidth="0.5" lineColor="#000000"/><leftPen lineWidth="0.5" lineColor="#000000"/><bottomPen lineWidth="0.5" lineColor="#000000"/><rightPen lineWidth="0.5" lineColor="#000000"/></box></style><style name="Crosstab 1_CH" mode="Opaque" backcolor="#F0F8FF"><box><pen lineWidth="0.5" lineColor="#000000"/><topPen lineWidth="0.5" lineColor="#000000"/><leftPen lineWidth="0.5" lineColor="#000000"/><bottomPen lineWidth="0.5" lineColor="#000000"/><rightPen lineWidth="0.5" lineColor="#000000"/></box></style><style name="Crosstab 1_CG" mode="Opaque" backcolor="#BFE1FF"><box><pen lineWidth="0.5" lineColor="#000000"/><topPen lineWidth="0.5" lineColor="#000000"/><leftPen lineWidth="0.5" lineColor="#000000"/><bottomPen lineWidth="0.5" lineColor="#000000"/><rightPen lineWidth="0.5" lineColor="#000000"/></box></style><style name="Crosstab 1_CT" mode="Opaque" backcolor="#005FB3"><box><pen lineWidth="0.5" lineColor="#000000"/><topPen lineWidth="0.5" lineColor="#000000"/><leftPen lineWidth="0.5" lineColor="#000000"/><bottomPen lineWidth="0.5" lineColor="#000000"/><rightPen lineWidth="0.5" lineColor="#000000"/></box></style><style name="Crosstab 1_CD" mode="Opaque" backcolor="#FFFFFF"><box><pen lineWidth="0.5" lineColor="#000000"/><topPen lineWidth="0.5" lineColor="#000000"/><leftPen lineWidth="0.5" lineColor="#000000"/><bottomPen lineWidth="0.5" lineColor="#000000"/><rightPen lineWidth="0.5" lineColor="#000000"/></box></style><style name="Style1"><conditionalStyle><conditionExpression><![CDATA[$V{SHIPCOUNTRY}==USA]]></conditionExpression><style mode="Opaque" forecolor="#FF1814" backcolor="#FFFD80"/></conditionalStyle><conditionalStyle><conditionExpression><![CDATA[$V{cn1}>=1]]></conditionExpression><style mode="Opaque" forecolor="#E30400" backcolor="#F7EB39"><box><topPen lineWidth="1.0"/><leftPen lineWidth="1.0"/><bottomPen lineWidth="1.0"/><rightPen lineWidth="1.0"/></box></style></conditionalStyle></style><queryString><![CDATA[sELECT top 20"ORDERS"."ORDERID","ORDERS"."CUSTOMERID","ORDERS"."EMPLOYEEID","ORDERS"."ORDERDATE","ORDERS"."REQUIREDDATE","ORDERS"."SHIPPEDDATE","ORDERS"."FREIGHT","ORDERS"."SHIPCITY","ORDERS"."SHIPREGION","ORDERS"."SHIPCOUNTRY"FROM "ORDERS"]]></queryString><field name="ORDERID" class="java.lang.Integer"/><field name="CUSTOMERID" class="java.lang.String"/><field name="EMPLOYEEID" class="java.lang.Integer"/><field name="ORDERDATE" class="java.sql.Timestamp"/><field name="REQUIREDDATE" class="java.sql.Timestamp"/><field name="SHIPPEDDATE" class="java.sql.Timestamp"/><field name="FREIGHT" class="java.math.BigDecimal"/><field name="SHIPCITY" class="java.lang.String"/><field name="SHIPREGION" class="java.lang.String"/><field name="SHIPCOUNTRY" class="java.lang.String"/><variable name="mon" class="java.util.Date"><variableExpression><![CDATA[$F{ORDERDATE}.getMonth()]]></variableExpression></variable><variable name="Contry" class="java.lang.String"><variableExpression><![CDATA[$F{SHIPCOUNTRY}]]></variableExpression><initialValueExpression><![CDATA[$F{SHIPCOUNTRY}]]></initialValueExpression></variable><variable name="cn" class="java.lang.Integer" calculation="Count"><variableExpression><![CDATA[$F{SHIPCOUNTRY}]]></variableExpression><initialValueExpression><![CDATA[$F{SHIPCOUNTRY}]]></initialValueExpression></variable><background><band splitType="Stretch"/></background><summary><band height="239" splitType="Stretch"><crosstab ignoreWidth="true"><reportElement x="20" y="10" width="280" height="200" uuid="fda36794-60a2-4032-8a72-67a0e34adfdd"><property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/></reportElement><rowGroup name="SHIPCOUNTRY" width="60" totalPosition="End"><bucket class="java.lang.String"><bucketExpression><![CDATA[$F{SHIPCOUNTRY}]]></bucketExpression></bucket><crosstabRowHeader><cellContents mode="Opaque" style="Crosstab 1_CH"><box><rightPen lineWidth="1.0"/></box><textField><reportElement x="0" y="0" width="60" height="20" uuid="04c8b2ff-df6b-4b2c-bdd1-d78bf94c5874"/><box><rightPen lineWidth="2.0"/></box><textElement textAlignment="Center"><font fontName="Calibri" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{SHIPCOUNTRY}]]></textFieldExpression></textField></cellContents></crosstabRowHeader><crosstabTotalRowHeader><cellContents mode="Opaque" style="Crosstab 1_CT"><staticText><reportElement x="0" y="0" width="60" height="20" uuid="382fc795-c4e4-4b7c-a635-ca2edafb288e"/><textElement textAlignment="Center"><font fontName="Calibri" isBold="true"/></textElement><text><![CDATA[Total SHIPCOUNTRY]]></text></staticText></cellContents></crosstabTotalRowHeader></rowGroup><columnGroup name="SHIPCITY" height="20" totalPosition="End"><bucket class="java.lang.String"><bucketExpression><![CDATA[$F{SHIPCITY}]]></bucketExpression></bucket><crosstabColumnHeader><cellContents mode="Opaque" style="Crosstab 1_CH"><textField><reportElement x="0" y="0" width="120" height="20" uuid="ff64c904-b50e-445f-8cbc-54a18fea816a"/><textElement textAlignment="Center"><font isBold="true"/></textElement><textFieldExpression><![CDATA[$V{SHIPCITY}]]></textFieldExpression></textField></cellContents></crosstabColumnHeader><crosstabTotalColumnHeader><cellContents mode="Opaque" style="Crosstab 1_CT"><staticText><reportElement x="0" y="0" width="60" height="40" forecolor="#FFFFFF" uuid="472873f3-f486-41fc-afbc-6343ea90f124"/><textElement textAlignment="Center"><font fontName="Calibri" isBold="true"/></textElement><text><![CDATA[Total SHIPCITY]]></text></staticText></cellContents></crosstabTotalColumnHeader></columnGroup><columnGroup name="SHIPREGION" height="20" totalPosition="End"><bucket class="java.lang.String"><bucketExpression><![CDATA[$F{SHIPREGION}]]></bucketExpression></bucket><crosstabColumnHeader><cellContents mode="Opaque" style="Crosstab 1_CH"><textField isBlankWhenNull="true"><reportElement x="0" y="0" width="120" height="20" uuid="c1fe7e4a-bce7-4fa5-ab5c-9ef4aad320de"/><textElement textAlignment="Center"/><textFieldExpression><![CDATA[$V{SHIPREGION}]]></textFieldExpression></textField></cellContents></crosstabColumnHeader><crosstabTotalColumnHeader><cellContents mode="Opaque" style="Crosstab 1_CG"/></crosstabTotalColumnHeader></columnGroup><measure name="FREIGHT_MEASURE" class="java.math.BigDecimal" calculation="Sum"><measureExpression><![CDATA[$F{FREIGHT}]]></measureExpression></measure><measure name="cn1" class="java.lang.Integer" calculation="Count"><measureExpression><![CDATA[$V{cn}]]></measureExpression></measure><crosstabCell width="120" height="20"><cellContents mode="Opaque" style="Style1"><property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/><textField pattern="#,##0.###" isBlankWhenNull="false"><reportElement x="0" y="0" width="50" height="20" uuid="0ce944e5-4df8-49ad-8686-120da34bd8b1"/><textElement textAlignment="Center"><font fontName="Calibri"/></textElement><textFieldExpression><![CDATA[$V{FREIGHT_MEASURE}==0?" ":$V{FREIGHT_MEASURE}]]></textFieldExpression></textField><textField><reportElement style="Style1" x="60" y="0" width="60" height="20" uuid="f8f27ca2-311d-4626-8dcd-feae5e022bd3"><printWhenExpression><![CDATA[$V{cn1}!=0]]></printWhenExpression></reportElement><textElement textAlignment="Center"><font fontName="Calibri"/></textElement><textFieldExpression><![CDATA[$V{cn1}]]></textFieldExpression></textField></cellContents></crosstabCell><crosstabCell width="60" height="20" columnTotalGroup="SHIPCITY"><cellContents mode="Opaque" style="Crosstab 1_CT"><property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/><textField><reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="3ef9d9f8-618b-4597-a2aa-105fcf24e266"/><textElement textAlignment="Center"><font fontName="Calibri" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{FREIGHT_MEASURE}]]></textFieldExpression></textField></cellContents></crosstabCell><crosstabCell width="0" height="20" columnTotalGroup="SHIPREGION"><cellContents mode="Opaque" style="Crosstab 1_CG"><property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/></cellContents></crosstabCell><crosstabCell width="120" height="20" rowTotalGroup="SHIPCOUNTRY"><cellContents mode="Opaque" style="Crosstab 1_CT"><property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/><textField pattern="#,##0.###"><reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="75454bbb-8e1f-4469-8c2c-164296c50330"/><textElement textAlignment="Center"><font fontName="Calibri" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{FREIGHT_MEASURE}]]></textFieldExpression></textField></cellContents></crosstabCell><crosstabCell width="60" height="20" rowTotalGroup="SHIPCOUNTRY" columnTotalGroup="SHIPCITY"><cellContents mode="Opaque" style="Crosstab 1_CT"><property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/><textField><reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="ed2981d7-1447-4946-a12c-255ddd7472df"/><textElement textAlignment="Center"><font fontName="Calibri" isBold="true"/></textElement><textFieldExpression><![CDATA[$V{FREIGHT_MEASURE}]]></textFieldExpression></textField></cellContents></crosstabCell><crosstabCell width="0" height="20" rowTotalGroup="SHIPCOUNTRY" columnTotalGroup="SHIPREGION"><cellContents mode="Opaque" style="Crosstab 1_CT"><property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/><property name="com.jaspersoft.studio.unit.width" value="pixel"/></cellContents></crosstabCell></crosstab></band></summary></jasperReport>
-
You can copy of domain in another folder and modify the same. When you editing your report / ad hoc views - just change the datasource.
-
Please check, There might be measure value is mismatched calculation type.
-
Hi, First create that variable in Cross tab-> measure and then use the same in conditional style. To apply style for whole row, you can check it Cell properties => Parent Style. Let me know still if you face the issue.
-
Hi, First create that variable in Cross tab-> measure and then use the same in conditional style. To apply style for whole row, you can check it Cell properties => Parent Style. Let me know still if you face the issue.