john.wendt Posted April 5, 2016 Share Posted April 5, 2016 Hello,I am trying to combine multiple stand-alone sub-reports into one main report. I was following this one as an example http://community.jaspersoft.com/questions/847522/how-create-one-master-report-multiple-independent-subreports. The only difference between the two subreports is the filter expression. They both run fine stand alone. I am using Jaspersoft Studio 6.1.1 with a csv datasetI can only get one of my subreports to show any data. What am I missing?Thanks in advance,John**MAIN REPORT**<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1 --><!-- 2016-04-04T23:55:24 --><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_2" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c1e5ddac-833a-4068-b4ec-9a05d1faa7e0"><property name="com.jaspersoft.studio.data.sql.tables" value="RFVBTCAsMTUsMTUsZDFhMmU4MWQtZDhmYS00MzNiLTg4ZWItMGJjYjgxZjg0YTUzOw=="/><property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter (2)"/><queryString language="CSV"><![CDATA[sELECT top 1 AS DUMMYFROM DUAL]]></queryString><field name="LOTFLOWTRACKING_quantity" class="java.lang.String"/><field name="LOT_bin_number" class="java.lang.String"/><field name="LOT_lot_name" class="java.lang.String"/><field name="LOT_slot_number" class="java.lang.String"/><field name="ORDLOT_batch_number" class="java.lang.String"/><field name="ORDPART_category" class="java.lang.String"/><field name="ORDPART_product_line" class="java.lang.String"/><field name="ORD_dist_due_dt" class="java.lang.String"/><field name="ORD_schedule_ID" class="java.lang.String"/><field name="ORD_schedule_SEQ" class="java.lang.String"/><field name="TBOMPART_addlDesc" class="java.lang.String"/><field name="TBOMPART_category" class="java.lang.String"/><field name="TBOMPART_colorExt" class="java.lang.String"/><field name="TBOMPART_colorInt" class="java.lang.String"/><field name="TBOMPART_description" class="java.lang.String"/><field name="TBOMPART_handing" class="java.lang.String"/><field name="TBOMPART_height" class="java.lang.String"/><field name="TBOMPART_length" class="java.lang.String"/><field name="TBOMPART_locPosition" class="java.lang.String"/><field name="TBOMPART_locRack" class="java.lang.String"/><field name="TBOMPART_locRow" class="java.lang.String"/><field name="TBOMPART_locShelf" class="java.lang.String"/><field name="TBOMPART_locSupermarket" class="java.lang.String"/><field name="TBOMPART_part_number" class="java.lang.String"/><field name="TBOMPART_pkgType" class="java.lang.String"/><field name="TBOMPART_prod_size" class="java.lang.String"/><field name="TBOMPART_quantity" class="java.lang.String"/><field name="TBOMPART_width_F" class="java.lang.String"/><field name="WF_work_flow_name" class="java.lang.String"/><field name="categorySeq" class="java.lang.String"/><field name="Global_Picklist_Report" class="java.lang.String"/><field name="Global_UnitQty" class="java.lang.String"/><field name="Global_empID_cart" class="java.lang.String"/><field name="Global_username" class="java.lang.String"/><background><band splitType="Stretch"/></background><title><band height="15" splitType="Stretch"/></title><pageHeader><band splitType="Stretch"/></pageHeader><columnHeader><band splitType="Stretch"/></columnHeader><detail><band height="75" splitType="Stretch"><subreport runToBottom="true"><reportElement stretchType="RelativeToBandHeight" x="0" y="10" width="200" height="57" uuid="b0f517fd-860d-47ba-81df-71fd9820e285"/><parametersMapExpression><![CDATA[$P{REPORT_CONNECTION}]]></parametersMapExpression><dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression><subreportExpression><![CDATA["OFM Report2.jasper"]]></subreportExpression></subreport></band><band height="90" splitType="Stretch"><subreport runToBottom="true"><reportElement x="0" y="10" width="200" height="64" uuid="5a5c7a85-c4c3-422a-9817-c3ca9ea6c334"/><parametersMapExpression><![CDATA[$P{REPORT_CONNECTION}]]></parametersMapExpression><dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression><subreportExpression><![CDATA["OFM Report.jasper"]]></subreportExpression></subreport></band></detail><columnFooter><band splitType="Stretch"/></columnFooter><pageFooter><band splitType="Stretch"/></pageFooter><summary><band height="10" splitType="Stretch"/></summary></jasperReport> *SUB 1 Report** ?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1 --><!-- 2016-04-04T23:56:19 --><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_1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7db543a9-f440-4131-b7da-afe6969e6611"><queryString language="CSV"><![CDATA[]]></queryString><field name="LOTFLOWTRACKING_quantity" class="java.lang.String"/><field name="LOT_bin_number" class="java.lang.String"/><field name="LOT_lot_name" class="java.lang.String"/><field name="LOT_slot_number" class="java.lang.String"/><field name="ORDLOT_batch_number" class="java.lang.String"/><field name="ORDPART_category" class="java.lang.String"/><field name="ORDPART_product_line" class="java.lang.String"/><field name="ORD_dist_due_dt" class="java.lang.String"/><field name="ORD_schedule_ID" class="java.lang.String"/><field name="ORD_schedule_SEQ" class="java.lang.String"/><field name="TBOMPART_addlDesc" class="java.lang.String"/><field name="TBOMPART_category" class="java.lang.String"/><field name="TBOMPART_colorExt" class="java.lang.String"/><field name="TBOMPART_colorInt" class="java.lang.String"/><field name="TBOMPART_description" class="java.lang.String"/><field name="TBOMPART_handing" class="java.lang.String"/><field name="TBOMPART_height" class="java.lang.String"/><field name="TBOMPART_length" class="java.lang.String"/><field name="TBOMPART_locPosition" class="java.lang.String"/><field name="TBOMPART_locRack" class="java.lang.String"/><field name="TBOMPART_locRow" class="java.lang.String"/><field name="TBOMPART_locShelf" class="java.lang.String"/><field name="TBOMPART_locSupermarket" class="java.lang.String"/><field name="TBOMPART_part_number" class="java.lang.String"/><field name="TBOMPART_pkgType" class="java.lang.String"/><field name="TBOMPART_prod_size" class="java.lang.String"/><field name="TBOMPART_quantity" class="java.lang.String"/><field name="TBOMPART_width_F" class="java.lang.String"/><field name="WF_work_flow_name" class="java.lang.String"/><field name="categorySeq" class="java.lang.String"/><field name="Global_Picklist_Report" class="java.lang.String"/><field name="Global_UnitQty" class="java.lang.String"/><field name="Global_empID_cart" class="java.lang.String"/><field name="Global_username" class="java.lang.String"/><sortField name="ORD_schedule_SEQ"/><sortField name="TBOMPART_handing"/><variable name="TBOMPART_quantity1" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="Count"><variableExpression><![CDATA[$F{TBOMPART_quantity}]]></variableExpression></variable><variable name="TBOMPART_part_number1" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="DistinctCount"><variableExpression><![CDATA[$F{TBOMPART_part_number}]]></variableExpression></variable><variable name="LOTFLOWTRACKING_quantity1" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="Count"><variableExpression><![CDATA[$F{LOTFLOWTRACKING_quantity}]]></variableExpression></variable><filterExpression><![CDATA[$F{TBOMPART_handing}.equalsIgnoreCase("RHSD")]]></filterExpression><group name="Group1"><groupExpression><![CDATA[$F{TBOMPART_part_number}+$F{TBOMPART_handing}]]></groupExpression></group><group name="Group2"><groupExpression><![CDATA[$F{TBOMPART_part_number}]]></groupExpression><groupHeader><band height="46"><textField><reportElement x="-20" y="10" width="100" height="30" uuid="1fd90e50-eea3-47d9-90f7-b54dc293c956"/><textFieldExpression><![CDATA[$F{TBOMPART_part_number}]]></textFieldExpression></textField><textField><reportElement x="90" y="10" width="100" height="30" uuid="ac658cee-860c-4384-acdb-c241b5452138"/><textFieldExpression><![CDATA[$F{TBOMPART_handing}]]></textFieldExpression></textField><textField><reportElement x="200" y="10" width="100" height="30" uuid="5bd5f86c-96bd-46aa-951a-dc062c64a805"/><textFieldExpression><![CDATA[$F{TBOMPART_quantity}]]></textFieldExpression></textField></band></groupHeader><groupFooter><band height="15"/></groupFooter></group><background><band splitType="Stretch"/></background><title><band height="17" splitType="Stretch"/></title><pageHeader><band height="23" splitType="Stretch"/></pageHeader><columnHeader><band height="18" splitType="Stretch"/></columnHeader><detail><band splitType="Stretch"/></detail><columnFooter><band height="18" splitType="Stretch"/></columnFooter><pageFooter><band height="25" splitType="Stretch"/></pageFooter><summary><band height="16" splitType="Stretch"/></summary></jasperReport> **SUB 2 Report** ?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1 --><!-- 2016-04-04T23:56:43 --><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_1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7db543a9-f440-4131-b7da-afe6969e6611"><queryString language="CSV"><![CDATA[]]></queryString><field name="LOTFLOWTRACKING_quantity" class="java.lang.String"/><field name="LOT_bin_number" class="java.lang.String"/><field name="LOT_lot_name" class="java.lang.String"/><field name="LOT_slot_number" class="java.lang.String"/><field name="ORDLOT_batch_number" class="java.lang.String"/><field name="ORDPART_category" class="java.lang.String"/><field name="ORDPART_product_line" class="java.lang.String"/><field name="ORD_dist_due_dt" class="java.lang.String"/><field name="ORD_schedule_ID" class="java.lang.String"/><field name="ORD_schedule_SEQ" class="java.lang.String"/><field name="TBOMPART_addlDesc" class="java.lang.String"/><field name="TBOMPART_category" class="java.lang.String"/><field name="TBOMPART_colorExt" class="java.lang.String"/><field name="TBOMPART_colorInt" class="java.lang.String"/><field name="TBOMPART_description" class="java.lang.String"/><field name="TBOMPART_handing" class="java.lang.String"/><field name="TBOMPART_height" class="java.lang.String"/><field name="TBOMPART_length" class="java.lang.String"/><field name="TBOMPART_locPosition" class="java.lang.String"/><field name="TBOMPART_locRack" class="java.lang.String"/><field name="TBOMPART_locRow" class="java.lang.String"/><field name="TBOMPART_locShelf" class="java.lang.String"/><field name="TBOMPART_locSupermarket" class="java.lang.String"/><field name="TBOMPART_part_number" class="java.lang.String"/><field name="TBOMPART_pkgType" class="java.lang.String"/><field name="TBOMPART_prod_size" class="java.lang.String"/><field name="TBOMPART_quantity" class="java.lang.String"/><field name="TBOMPART_width_F" class="java.lang.String"/><field name="WF_work_flow_name" class="java.lang.String"/><field name="categorySeq" class="java.lang.String"/><field name="Global_Picklist_Report" class="java.lang.String"/><field name="Global_UnitQty" class="java.lang.String"/><field name="Global_empID_cart" class="java.lang.String"/><field name="Global_username" class="java.lang.String"/><sortField name="ORD_schedule_SEQ"/><sortField name="TBOMPART_handing"/><variable name="TBOMPART_quantity1" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="Count"><variableExpression><![CDATA[$F{TBOMPART_quantity}]]></variableExpression></variable><variable name="TBOMPART_part_number1" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="DistinctCount"><variableExpression><![CDATA[$F{TBOMPART_part_number}]]></variableExpression></variable><variable name="LOTFLOWTRACKING_quantity1" class="java.lang.Integer" resetType="Group" resetGroup="Group1" calculation="Count"><variableExpression><![CDATA[$F{LOTFLOWTRACKING_quantity}]]></variableExpression></variable><filterExpression><![CDATA[$F{TBOMPART_handing}.equalsIgnoreCase("LHSD")]]></filterExpression><group name="Group1"><groupExpression><![CDATA[$F{TBOMPART_part_number}+$F{TBOMPART_handing}]]></groupExpression></group><group name="Group2"><groupExpression><![CDATA[$F{TBOMPART_part_number}]]></groupExpression><groupHeader><band height="46"><textField><reportElement x="-20" y="10" width="100" height="30" uuid="1fd90e50-eea3-47d9-90f7-b54dc293c956"/><textFieldExpression><![CDATA[$F{TBOMPART_part_number}]]></textFieldExpression></textField><textField><reportElement x="90" y="10" width="100" height="30" uuid="ac658cee-860c-4384-acdb-c241b5452138"/><textFieldExpression><![CDATA[$F{TBOMPART_handing}]]></textFieldExpression></textField><textField><reportElement x="200" y="10" width="100" height="30" uuid="5bd5f86c-96bd-46aa-951a-dc062c64a805"/><textFieldExpression><![CDATA[$F{TBOMPART_quantity}]]></textFieldExpression></textField></band></groupHeader><groupFooter><band height="15"/></groupFooter></group><background><band splitType="Stretch"/></background><title><band height="17" splitType="Stretch"/></title><pageHeader><band height="23" splitType="Stretch"/></pageHeader><columnHeader><band height="18" splitType="Stretch"/></columnHeader><detail><band splitType="Stretch"/></detail><columnFooter><band height="18" splitType="Stretch"/></columnFooter><pageFooter><band height="25" splitType="Stretch"/></pageFooter><summary><band height="16" splitType="Stretch"/></summary></jasperReport> Link to comment Share on other sites More sharing options...
MiditecReportDev Posted April 5, 2016 Share Posted April 5, 2016 I can only guess at the moment (as I'm at work and can't check the tutorial to compare it to what you have) but can you check the following points?- If you use SQL in your subreports make sure that needed parameters are set to be forwarded by the master report.- If you don't need any data besides parameters inside your subreports make sure to put an "SELECT *" statement in your subreports query (doesn't do anything but is needed to fill the subreport - don't ask me why).- Please look up the error messages the Studio is giving to you - they may not look like much but some times there is actually helpful information in there.- In your master report select the subreports and go to "Appearance" Tab, set a back color and set transparency off (if it already is off, turn it on and off again, sometimes it does not work otherwise). When you did this print the report again and look if both colored areas are visible or just one of them - that way you can see if they are both generated but empty or not even generated at all (which you would see because there will be no colored area for that report).- In your master report select the subreports and go to "Dataset" Tab and make sure "When no Data Type" is set to "All Sections No Detail" - that way you should get a subreport generated even without any data - see if that changes anything. Link to comment Share on other sites More sharing options...
javier.ggi90 Posted April 5, 2016 Share Posted April 5, 2016 The way Jasper handles data sources in reports makes it so that it is used and consumed so you have to "rewind" it to use it again.You can look at it as a table (lets assume it has 5 lines):The first subreport runs and uses the datasource's information up to the fifth line.The second subreport tries to access the the data source and reads it but it is already on the fifth line so it assumes the source is empty.I do not really remember how to solve this (specific instructions) but I do remember passing some instructions into the "Data Source Expression" property of the subreport.An example of something I did for a JSON datasource is passing this value into the previously mentioned property: "$P{REPORT_DATA_SOURCE}.subDataSource()".Hope I at least point you into the right direction. Cheers,Javier Link to comment Share on other sites More sharing options...
john.wendt Posted April 7, 2016 Author Share Posted April 7, 2016 Thanks this at least help me understand why it works the way it does. I gave up on this idea and tried posting my exact problem to see if there is a simpler way. If you have a second, would you mind taking in look at my actual use case posted here? Thanks again!http://community.jaspersoft.com/questions/989111/skipping-row-grouping-functionality Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now