AThompson_1 Posted November 12, 2015 Share Posted November 12, 2015 Hi, I cannot get subreports to work for even the simplest case. The subreports work/display fine when previewed separately. But with the main reports, it's just blank. I have read all the old posts related to this and tried many things. Still no luck. Please help before I have no more hair to pull out. Using JasperSoft STudio 6.1.1. Sample report below.TIA,AThompson_1<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1 --><!-- 2015-11-12T15:44: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="main" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="299315bd-452e-4955-9170-16dfce9492a2"><property name="com.jaspersoft.studio.data.defaultdataadapter" value="mssql"/><property name="com.jaspersoft.studio.data.sql.tables" value=""/><queryString> <![CDATA[sELECT facility_dim_id FROM dbo.facility_dim ORDER BY 1]]></queryString><field name="facility_dim_id" class="java.lang.Short"/><background> <band splitType="Stretch"/></background><title> <band height="79" splitType="Stretch"/></title><pageHeader> <band height="35" splitType="Stretch"/></pageHeader><columnHeader> <band height="61" splitType="Stretch"> <staticText> <reportElement x="10" y="0" width="100" height="30" uuid="fdbf7169-7054-4539-bfee-dcf25e0e2593"/> <text><![CDATA[facility_dim_id]]></text> </staticText> <staticText> <reportElement x="180" y="0" width="100" height="30" uuid="f806a1d1-33f2-43b3-89d2-82daf956d125"/> <text><![CDATA[Facility_name]]></text> </staticText> </band></columnHeader><detail> <band height="57" splitType="Stretch"> <textField> <reportElement x="10" y="10" width="100" height="30" uuid="4cf2ff2e-6d19-4075-8815-fc174503bdd6"/> <textFieldExpression><![CDATA[$F{facility_dim_id}]]></textFieldExpression> </textField> <subreport> <reportElement x="180" y="-5" width="319" height="45" uuid="6694fc69-bead-41e7-adbc-3122751e29f2"/> <subreportParameter name="in_facility_dim_id"> <subreportParameterExpression><![CDATA[$F{facility_dim_id}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA["Sub.jasper"]]></subreportExpression> </subreport> </band></detail><columnFooter> <band height="45" splitType="Stretch"/></columnFooter><pageFooter> <band height="54" splitType="Stretch"/></pageFooter><summary> <band height="42" splitType="Stretch"/></summary></jasperReport>[/code] <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.1.1.final using JasperReports Library version 6.1.1 --><!-- 2015-11-12T15:48:28 --><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="Sub" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b4dea4e0-7c73-46c4-a7ab-c8d57d6d5e99"><property name="com.jaspersoft.studio.data.sql.tables" value=""/><property name="com.jaspersoft.studio.data.defaultdataadapter" value="mssql"/><parameter name="in_facility_dim_id" class="java.lang.Integer" isForPrompting="false"/><queryString> <![CDATA[sELECT facility_name from dbo.facility_dim WHERE facility_dim_id= $P{in_facility_dim_id}]]></queryString><field name="facility_name" class="java.lang.String"/><detail> <band height="37" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="190" height="30" uuid="7034a369-f097-4e51-9e26-6568457a3d0f"/> <textFieldExpression><![CDATA[$F{facility_name}]]></textFieldExpression> </textField> </band></detail></jasperReport>[/code] Link to comment Share on other sites More sharing options...
Solution zh3ntil Posted November 13, 2015 Solution Share Posted November 13, 2015 Hi,<subreportExpression><![CDATA["repo:Sub.jrxml"]]></subreportExpression> Link to comment Share on other sites More sharing options...
AThompson_1 Posted November 13, 2015 Author Share Posted November 13, 2015 Thanks! That did the trick. I would think it would have filled in the correct value for me. Probably some rookie mistake I made. 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