fashist Posted November 28, 2006 Share Posted November 28, 2006 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) Link to comment Share on other sites More sharing options...
teodord Posted December 12, 2006 Share Posted December 12, 2006 Hi, What version of JasperReports are you using and on what Web server are you deploying it? Thank you,Teodor Link to comment Share on other sites More sharing options...
kgentile1010 Posted December 15, 2006 Share Posted December 15, 2006 Hi, I'm seeing this issue also. I'm using iReport/JasperReports 1.2.8, so not running through a WebApp. Thank you so much for your help. Kgentile Link to comment Share on other sites More sharing options...
kgentile1010 Posted December 15, 2006 Share Posted December 15, 2006 Hi, I'm seeing this issue also. I'm using iReport/JasperReports 1.2.8, so not running through a WebApp. Thank you so much for your help. Kgentile Link to comment Share on other sites More sharing options...
mattcvincent Posted December 18, 2006 Share Posted December 18, 2006 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. Link to comment Share on other sites More sharing options...
zmanning Posted March 24, 2007 Share Posted March 24, 2007 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. Link to comment Share on other sites More sharing options...
lucianc Posted March 26, 2007 Share Posted March 26, 2007 Can you explain again what are you doing? "I export multiple reports" is rather vague. A relevant code fragment would help. Regards,Lucian Link to comment Share on other sites More sharing options...
GalinaM Posted May 18, 2007 Share Posted May 18, 2007 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: Code:..........protected void setParameterValues(Map parameterValues) throws JRException {..........// scriptlet = (JRAbstractScriptlet) parameterValues.get(JRParameter.REPORT_SCRIPTLET);// if (scriptlet == null)// { scriptlet = createScriptlet(); parameterValues.put(JRParameter.REPORT_SCRIPTLET, scriptlet);// } scriptlet.setData(parametersMap, fieldsMap, variablesMap, groups);........} Code:[code]createScriptlet() was never called for subreports because Code:[code]scriptlet was initialized to Code:[code]new JRDefaultScriptlet() (!= null) for the parent report. I am guessing the intention was to force subreports to use the parent report's scriptlet in more recent versions of jasperreports. Link to comment Share on other sites More sharing options...
svntdeepak Posted May 24, 2007 Share Posted May 24, 2007 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. Link to comment Share on other sites More sharing options...
GalinaM Posted May 30, 2007 Share Posted May 30, 2007 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! Link to comment Share on other sites More sharing options...
lucianc Posted May 31, 2007 Share Posted May 31, 2007 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 usingCode:<parametersMapExpression>$P{REPORT_PARAMETERS_MAP}</parametersMapExpression>for the subreport? Regards,Lucian Link to comment Share on other sites More sharing options...
markdr Posted June 6, 2007 Share Posted June 6, 2007 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 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 Link to comment Share on other sites More sharing options...
jasonb Posted June 9, 2007 Share Posted June 9, 2007 After nearly a day tinkering to try to work aroundthis 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 asubreport, and also has its own scriptlet. ReportB uses a data source passed in from ReportA, butdoes not need any scriptlet, and does not declare one. In ReportA's <subreport> tag to include ReportB, Ihave some simple markup: Code:<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression><subreportParameter name="SUBREPORT_DIR"><subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression></subreportParameter><dataSourceExpression><![CDATA[$P{REPORT_SCRIPTLET}.getMyOutputDataSource()]]></dataSourceExpression>.. and the getMyDataSource() call in there does work.That wasn't the problem. The problem was that somehow, ReportA is passing inits own definition of REPORT_SCRIPTLET, which ReportBdid not define at all, and the report engine probablyautomatically chooses the wrong type for it. Whenthe automatic type and the type from ReportA do notmatch up, the exception is thrown. To fix this, all I had to do was: In ReportB, set the exact same scriptlet settings asin ReportA. Then, they both set the same type forREPORT_SCRIPTLET, and the exception never happens. If it is possible to not send ReportB theREPORT_SCRIPTLET parameter at all, that would bebest, I suppose. I'm going to see if I can do that.But, it would sure be nice if I didn't need to spendtime doing all this.. --Jason Brittain Link to comment Share on other sites More sharing options...
jasonb Posted June 9, 2007 Share Posted June 9, 2007 Okay, I found a fix. Wherever you have a <subreport>element to include a subreport, instead of doing this: Code:<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression> .. do this instead: Code:[code]<parametersMapExpression><![CDATA[new HashMap($P{REPORT_PARAMETERS_MAP})]]></parametersMapExpression> If I do that, with the subreport's .jrxml file notusing any scriptlet at all, the problem goes away.No more exception about the REPORT_SCRIPTLET. This is mentioned in passing in the docs, but nothingis said about what might happen if you do not do it,and no mention about this particular exception.*sigh* --Jason Brittain Link to comment Share on other sites More sharing options...
beherca Posted June 21, 2010 Share Posted June 21, 2010 I solved the problem !!! When you create the prameter in the iReport, make sure that you changing the Parameter class type in the Properties Panel. Link to comment Share on other sites More sharing options...
leiming19877 Posted November 24, 2010 Share Posted November 24, 2010 应该是å‚æ•°ç±»åž‹å®šä¹‰å’Œä¼ é€’çš„å‚æ•°ä¸åŒ¹é…çš„åŽŸå› 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