Cann some one help me.
I want to create Report without datasourse. Only parameters should be sent to the report.
hier is Report and the exception.
How can i solve it????
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
name="Scannblatt"
columnCount="1"
printOrder="Vertical"
orientation="Portrait"
pageWidth="595"
pageHeight="842"
columnWidth="563"
columnSpacing="0"
leftMargin="2"
rightMargin="30"
topMargin="144"
bottomMargin="492"
whenNoDataType="NoPages"
isTitleNewPage="false"
isSummaryNewPage="false"
>
<property name="ireport.scriptlethandling" value="0" />
<property name="ireport.encoding" value="UTF-8" />
<import value="java.util.*" />
<import value="net.sf.jasperreports.engine.*" />
<import value="net.sf.jasperreports.engine.data.*" />
<parameter name="PARAM_1" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_2" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_3" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_4" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_5" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_6" isForPrompting="false" class="java.lang.String"/>
<background>
<band height="0" isSplitAllowed="true" >
</band>
</background>
<title>
<band height="0" isSplitAllowed="true" >
</band>
</title>
<pageHeader>
<band height="0" isSplitAllowed="true" >
</band>
</pageHeader>
<columnHeader>
<band height="0" isSplitAllowed="true" >
</band>
</columnHeader>
<detail>
<band height="206" isSplitAllowed="true" >
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="0"
width="495"
height="24"
key="textField-1"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_1}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="186"
width="495"
height="20"
key="textField-3"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement verticalAlignment="Bottom">
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_6}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="38"
width="495"
height="20"
key="textField-4"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_2}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="77"
width="495"
height="20"
key="textField-5"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_3}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="114"
width="495"
height="20"
key="textField-6"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_4}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="152"
width="495"
height="20"
key="textField-7"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_5}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="0" isSplitAllowed="true" >
</band>
</columnFooter>
<pageFooter>
<band height="0" isSplitAllowed="true" >
</band>
</pageFooter>
<summary>
<band height="0" isSplitAllowed="true" >
</band>
</summary>
</jasperReport>
net.sf.jasperreports.engine.JRException: Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET in the Scannblatt dataset.
at net.sf.jasperreports.engine.fill.JRFillDataset.setParameter(JRFillDataset.java:873)
at net.sf.jasperreports.engine.fill.JRFillDataset.setFillParameterValues(JRFillDataset.java:640)
at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:596)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:879)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:708)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:123)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:420)
at de.media.ifa.vw.ProcessReportVWAction.processScanblatt(ProcessReportVWAction.java:65)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
I want to create Report without datasourse. Only parameters should be sent to the report.
hier is Report and the exception.
How can i solve it????
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
name="Scannblatt"
columnCount="1"
printOrder="Vertical"
orientation="Portrait"
pageWidth="595"
pageHeight="842"
columnWidth="563"
columnSpacing="0"
leftMargin="2"
rightMargin="30"
topMargin="144"
bottomMargin="492"
whenNoDataType="NoPages"
isTitleNewPage="false"
isSummaryNewPage="false"
>
<property name="ireport.scriptlethandling" value="0" />
<property name="ireport.encoding" value="UTF-8" />
<import value="java.util.*" />
<import value="net.sf.jasperreports.engine.*" />
<import value="net.sf.jasperreports.engine.data.*" />
<parameter name="PARAM_1" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_2" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_3" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_4" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_5" isForPrompting="false" class="java.lang.String"/>
<parameter name="PARAM_6" isForPrompting="false" class="java.lang.String"/>
<background>
<band height="0" isSplitAllowed="true" >
</band>
</background>
<title>
<band height="0" isSplitAllowed="true" >
</band>
</title>
<pageHeader>
<band height="0" isSplitAllowed="true" >
</band>
</pageHeader>
<columnHeader>
<band height="0" isSplitAllowed="true" >
</band>
</columnHeader>
<detail>
<band height="206" isSplitAllowed="true" >
<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="0"
width="495"
height="24"
key="textField-1"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_1}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="186"
width="495"
height="20"
key="textField-3"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement verticalAlignment="Bottom">
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_6}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="38"
width="495"
height="20"
key="textField-4"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_2}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="77"
width="495"
height="20"
key="textField-5"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_3}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="114"
width="495"
height="20"
key="textField-6"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_4}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="68"
y="152"
width="495"
height="20"
key="textField-7"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font fontName="Courier New" pdfFontName="Courier-Bold" size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{PARAM_5}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="0" isSplitAllowed="true" >
</band>
</columnFooter>
<pageFooter>
<band height="0" isSplitAllowed="true" >
</band>
</pageFooter>
<summary>
<band height="0" isSplitAllowed="true" >
</band>
</summary>
</jasperReport>
net.sf.jasperreports.engine.JRException: Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET in the Scannblatt dataset.
at net.sf.jasperreports.engine.fill.JRFillDataset.setParameter(JRFillDataset.java:873)
at net.sf.jasperreports.engine.fill.JRFillDataset.setFillParameterValues(JRFillDataset.java:640)
at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:596)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:879)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:708)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:123)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:420)
at de.media.ifa.vw.ProcessReportVWAction.processScanblatt(ProcessReportVWAction.java:65)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
15 Answers:
Posted on December 18, 2006 at 1:18am
I'm also having the same problem.
------------
I can't use a Scriptlet in a subreport
--------------------
The exception I get is:
et.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET in the companyDataSheetReport_certifications dataset.
at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:582)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:345)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:311)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:275)
When I specify the scriptlet in a subreport.
Also, I'm already passing $P{REPORT_PARAMETERS_MAP} to the subreport.
------------
I can't use a Scriptlet in a subreport
--------------------
The exception I get is:
et.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET in the companyDataSheetReport_certifications dataset.
at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:582)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:345)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:311)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:275)
When I specify the scriptlet in a subreport.
Also, I'm already passing $P{REPORT_PARAMETERS_MAP} to the subreport.
Posted on March 24, 2007 at 5:34am
Yea I am getting the same error. It only happens when I export multiple reports. One report is using a scriptlet and the other is not. JRException is
Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET
I have been trying to troubleshoot this for a while with no luck. Any help would be excellent. Im using JR 1.3.0.
Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET
I have been trying to troubleshoot this for a while with no luck. Any help would be excellent. Im using JR 1.3.0.
Posted on May 18, 2007 at 1:08pm
Had the same error here for reports with subreports that have scriptlets. The subreports' scriptlets fail to initialize. Here is the 'offending' code:
In net.sf.jasperreports.engine.fill.JRFillDataset, force the creation of a new scriptlet for subreports:
In net.sf.jasperreports.engine.fill.JRFillDataset, force the creation of a new scriptlet for subreports:
Code: |
..........<br /> protected void setParameterValues(Map parameterValues) throws JRException <br /> {<br /> ..........<br /> <br /> // scriptlet = (JRAbstractScriptlet) parameterValues.get(JRParameter.REPORT_SCRIPTLET);<br /> // if (scriptlet == null)<br /> // {<br /> scriptlet = createScriptlet();<br /> parameterValues.put(JRParameter.REPORT_SCRIPTLET, scriptlet);<br /> // }<br /> scriptlet.setData(parametersMap, fieldsMap, variablesMap, groups);<br /> <br /> ........<br /> }<br /> <br /> </td></tr></tbody></table><br /> <br /> <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>createScriptlet()</td></tr></tbody></table> was never called for subreports because <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>scriptlet</td></tr></tbody></table> was initialized to <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>new JRDefaultScriptlet()</td></tr></tbody></table> (!= null) for the parent report. <br /> <br /> I am guessing the intention was to force subreports to use the parent report's scriptlet in more recent versions of jasperreports. |
Posted on May 24, 2007 at 1:58pm
Hi,
I get the similar type of compatibility exception but not exactly what ur problem is:
check ur jar file whether it was properly placed in ear file of ur application.make sure ur jasper jar file should not be there any where ,i mean in war or ..but only in ear..
May ur problem be rectified.
i made the same mistake by keeping the jar in both ear and war file later on i rectified the mistake and its working properly now.
I get the similar type of compatibility exception but not exactly what ur problem is:
check ur jar file whether it was properly placed in ear file of ur application.make sure ur jasper jar file should not be there any where ,i mean in war or ..but only in ear..
May ur problem be rectified.
i made the same mistake by keeping the jar in both ear and war file later on i rectified the mistake and its working properly now.
Posted on May 29, 2007 at 10:09pm
I am looking for a workaround for the following problem, while upgrading from 0.6 to 1.3.3. Please help.
I have a report that contains a subreport. The subreport uses a scriptlet, while the main report does not.
In JRFillDataset, in the setParameterValues() method, 'scriptlet' is never 'null' for a subreport (because it is 'new JRDefaultScriptlet()', as created by the call to 'createScriptlet()' when initializing the scriptlet for the main report).
setParameterValues() {
....................
scriptlet = (JRAbstractScriptlet) parameterValues.get(JRParameter.REPORT_SCRIPTLET);
if (scriptlet == null)
{
scriptlet = createScriptlet();
parameterValues.put(JRParameter.REPORT_SCRIPTLET, scriptlet);
}
....................
Therefore, the subreport can never have its own scriptlet. The "Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET" exception is thrown.
Thank you in advance!
I have a report that contains a subreport. The subreport uses a scriptlet, while the main report does not.
In JRFillDataset, in the setParameterValues() method, 'scriptlet' is never 'null' for a subreport (because it is 'new JRDefaultScriptlet()', as created by the call to 'createScriptlet()' when initializing the scriptlet for the main report).
setParameterValues() {
....................
scriptlet = (JRAbstractScriptlet) parameterValues.get(JRParameter.REPORT_SCRIPTLET);
if (scriptlet == null)
{
scriptlet = createScriptlet();
parameterValues.put(JRParameter.REPORT_SCRIPTLET, scriptlet);
}
....................
Therefore, the subreport can never have its own scriptlet. The "Incompatible net.sf.jasperreports.engine.JRDefaultScriptlet value assigned to parameter REPORT_SCRIPTLET" exception is thrown.
Thank you in advance!
Posted on May 31, 2007 at 7:31am
I can't follow your argumentation. How does the fact that the scriptlet is never null imply that a subreport cannot have its own scriptlet?
Do you have a simple self-contained sample that illustrates this issue?
Are you by any chance using
Do you have a simple self-contained sample that illustrates this issue?
Are you by any chance using
Code: |
<br /> <parametersMapExpression>$P{REPORT_PARAMETERS_MAP}</parametersMapExpression><br /> </td></tr></tbody></table><br /> for the subreport?<br /> <br /> Regards,<br /> Lucian |
Posted on June 6, 2007 at 2:09pm
I had the similar problem with the incompatible for the scrptlet on subreports.
My solution was not using the same data map. In my first version I was using for the main report and the subreport the same data mapping.
But it seems that jasper is doing a lot of changes there. So simply using a new new data map
(as you can see I'm using a parameter for adding the map)
Btw. I nerver was reading that before but adding subreports into the summary is a good place to concatinate reports into one file.
Hope that is helping, best regards
Markus
My solution was not using the same data map. In my first version I was using for the main report and the subreport the same data mapping.
But it seems that jasper is doing a lot of changes there. So simply using a new new data map
Map yourLocalMap = new HashMap(); yourLocalMap .putAll(yourMasterMap); and adding the map for subreports with: <paramteresMapExpression>$P{yourLocalMap }</parametersMapExcepression> |
(as you can see I'm using a parameter for adding the map)
Btw. I nerver was reading that before but adding subreports into the summary is a good place to concatinate reports into one file.
Hope that is helping, best regards
Markus
Posted on June 9, 2007 at 2:45am
After nearly a day tinkering to try to work around
this bug, I found a way, at least for my reports.
Here's a description of the situation:
ReportA is the main report, it includes ReportB as a
subreport, and also has its own scriptlet.
ReportB uses a data source passed in from ReportA, but
does not need any scriptlet, and does not declare one.
In ReportA's <subreport> tag to include ReportB, I
have some simple markup:
this bug, I found a way, at least for my reports.
Here's a description of the situation:
ReportA is the main report, it includes ReportB as a
subreport, and also has its own scriptlet.
ReportB uses a data source passed in from ReportA, but
does not need any scriptlet, and does not declare one.
In ReportA's <subreport> tag to include ReportB, I
have some simple markup:
Code: |
<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression><br /> <subreportParameter name="SUBREPORT_DIR"><br /> <subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression><br /> </subreportParameter><br /> <dataSourceExpression><![CDATA[$P{REPORT_SCRIPTLET}.getMyOutputDataSource()]]></dataSourceExpression><br /> </td></tr></tbody></table><br /> .. and the getMyDataSource() call in there does work.<br /> That wasn't the problem.<br /> <br /> The problem was that somehow, ReportA is passing in<br /> its own definition of REPORT_SCRIPTLET, which ReportB<br /> did not define at all, and the report engine probably<br /> automatically chooses the wrong type for it. When<br /> the automatic type and the type from ReportA do not<br /> match up, the exception is thrown.<br /> <br /> To fix this, all I had to do was:<br /> <br /> In ReportB, set the exact same scriptlet settings as<br /> in ReportA. Then, they both set the same type for<br /> REPORT_SCRIPTLET, and the exception never happens.<br /> <br /> If it is possible to not send ReportB the<br /> REPORT_SCRIPTLET parameter at all, that would be<br /> best, I suppose. I'm going to see if I can do that.<br /> But, it would sure be nice if I didn't need to spend<br /> time doing all this..<br /> <br /> --<br /> Jason Brittain |
Posted on June 9, 2007 at 8:44am
Okay, I found a fix. Wherever you have a <subreport>
element to include a subreport, instead of doing this:
element to include a subreport, instead of doing this:
Code: |
<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression><br /> </td></tr></tbody></table><br /> <br /> .. do this instead:<br /> <br /> <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre><parametersMapExpression><![CDATA[new HashMap($P{REPORT_PARAMETERS_MAP})]]></parametersMapExpression><br /> </td></tr></tbody></table><br /> <br /> If I do that, with the subreport's .jrxml file not<br /> using any scriptlet at all, the problem goes away.<br /> No more exception about the REPORT_SCRIPTLET.<br /> <br /> This is mentioned in passing in the docs, but nothing<br /> is said about what might happen if you do not do it,<br /> and no mention about this particular exception.<br /> *sigh*<br /> <br /> --<br /> Jason Brittain |