Jump to content
We've recently updated our Privacy Statement, available here ×

samp7673

Members
  • Posts

    10
  • Joined

  • Last visited

samp7673's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. So I developed a report in iReport and I had used a query in the report during development then for my production environment I have a servlet compiling the report and sending in an arraylist of pojos containing the data that is similar to what would be returned if a query were run. Any way, I had to make some adjustments to the jrxml file and I thought I had done them correctly and I am now getting an error with the following stack trace: java.lang.NoSuchMethodError: org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; goalsreport_1258427805087_322903.<init>(calculator_goalsreport_1258427805087_322903)I am not sure where they are getting the casting of java.lang.Class to java.lang.Object. Does this look familiar to anyone or do you have any suggestions.Mi
  2. So I had some success since the original post. I am thinking having the collection as a static member of the action class is what is preventing the datasource not found error.
  3. So I have successfully in the past passed into a jasper report a collection of beans that I use in the report and renders correctly for pdf format. Building off that example I expected to do more. I believed the steps were to have a bean class, an action class that took several of those beans and put them into a collection, then the action class would have getter/setter for the collection, and in the struts config, define the datasource for the jasper result to use as a datasource, the collection name. The first time it worked, and subsequent attempts have had problems, well at least the same exception: java.lang.RuntimeException: No dataSource specified... org.apache.struts2.views.jasperreports.JasperReportsResult.initializeProperties(JasperReportsResult.java:416) org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:239) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) There's not much to go on here for me. I am thinking I have added items to the collection, but the getters and setters are not correct, or the collection must be declared as a static member of the action class, or I am defining datasource incorrectly within the struts config. I will say, this report was built with a sql statement in iReport and now I am trying to use it in the struts web framework, and I removed a query tag and the description children fromt the field definition elements. I still define the fields that now should be supplied by the collection of beans. Teodord, if you end up looking at this one, if you need more exact information don't hesitate to ask. Mike
  4. So here it is: <?xml version="1.0" encoding="UTF-8"?> <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="assessment_report" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30"> <field name="subtopic" class="java.lang.String"/> <field name="lastname" class="java.lang.String"/> <field name="score" class="java.lang.Double"/> <field name="goal" class="java.lang.Double"/> <field name="grade" class="java.lang.Integer"/> <field name="subject" class="java.lang.String"/> <field name="topic" class="java.lang.String"/> <field name="id" class="java.lang.Integer"/> <background> <band/> </background> <title> <band height="84"> <line> <reportElement x="0" y="8" width="555" height="1"/> </line> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/> </line> <staticText> <reportElement x="1" y="9" width="424" height="35" forecolor="#0066CC"/> <textElement textAlignment="Left"> <font size="26" isBold="true"/> </textElement> <text><![CDATA[Assessment Report]]></text> </staticText> <textField> <reportElement x="46" y="52" width="70" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{lastname}]]></textFieldExpression> </textField> <staticText> <reportElement x="232" y="51" width="35" height="20"/> <textElement/> <text><![CDATA[Grade]]></text> </staticText> <textField> <reportElement x="267" y="51" width="49" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{grade}]]></textFieldExpression> </textField> <staticText> <reportElement x="316" y="51" width="40" height="20"/> <textElement/> <text><![CDATA[subject]]></text> </staticText> <textField> <reportElement x="356" y="51" width="57" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{subject}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band/> </pageHeader> <columnHeader> <band height="50"> <staticText> <reportElement x="1" y="-32" width="45" height="20"/> <textElement/> <text><![CDATA[student:]]></text> </staticText> <textField> <reportElement x="1" y="0" width="186" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{topic}]]></textFieldExpression> </textField> </band> </columnHeader> <detail> <band height="213" isSplitAllowed="false"> <barChart> <chart> <reportElement x="1" y="0" width="424" height="213"/> <chartTitle/> <chartSubtitle/> <chartLegend position="Right"/> </chart> <categoryDataset> <categorySeries> <seriesExpression><![CDATA["Student's Current Score"]]></seriesExpression> <categoryExpression><![CDATA[$F{subtopic}]]></categoryExpression> <valueExpression><![CDATA[$F{score}]]></valueExpression> <labelExpression><![CDATA["Student's Current Score"]]></labelExpression> <itemHyperlink/> </categorySeries> <categorySeries> <seriesExpression><![CDATA["Program Goal"]]></seriesExpression> <categoryExpression><![CDATA[$F{subtopic}]]></categoryExpression> <valueExpression><![CDATA[$F{goal}]]></valueExpression> <labelExpression><![CDATA["Program Goal"]]></labelExpression> <itemHyperlink/> </categorySeries> </categoryDataset> <barPlot> <plot> <seriesColor seriesOrder="0" color="#33FF33"/> <seriesColor seriesOrder="1" color="#6666FF"/> </plot> <categoryAxisFormat> <axisFormat> <labelFont/> <tickLabelFont/> </axisFormat> </categoryAxisFormat> <valueAxisFormat> <axisFormat> <labelFont/> <tickLabelFont/> </axisFormat> </valueAxisFormat> </barPlot> </barChart> </band> </detail> <columnFooter> <band/> </columnFooter> <pageFooter> <band height="38"> <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Right"> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band/> </summary> </jasperReport> The 2 chart examples I had scene, both had charts in the detail band so I has assumed that was ok but may be I missed something. Mike
  5. So I have a fairly simple bar chart. I create a query to get the 2 different series. The chart foes in the detail band. The bars on the chart seem to come up good enough and the legend is fine but, the chart itself gets repeated 2 extra times. I thought may be it was because I was using fields in the column band and not parameters but that did not resolve the problem. Is it coming from a default group by setting and extra charts are just a part of that? Mike
  6. Teodord, I think I find it for now. When drawing up the report in iReport, I was retrieving content from a jdbc connection. I guess how I was receiving it was not too important but in the field declarations at the beginning of the report, each field had a child with description. I had another example that was working. I noticed it wasn't using descriptions. So I cut those. Also, I cut the doctype statement at the type. I also had to cut the query element out as well being that I was passing in a collection of beans. Mike
  7. So I am doing chart development and my goal was to avoid having sql statements in jrxml files. I was relying on an example of going from a struts action to generate the report where a list of beans is passed in that is set up in the config file. I am confident the beans contain data and I've had some success doing this but as development gets more complex I don't know what to do about the java.lang.IllegalArgumentException: Null 'key' argument errors. The stack trace in the browser is not givng me much to go on; specifically what field is causing the problem. How can I tell what field it's complaining about? Right now, I have been using a sql query off a database to do development of layout than switching to the list of beans for integrated testing. I strip out the <query> taq when I do this. Is this not the correct way to do this work? I do not think the group architect will allow for straight sql off the database from within the report. Mike
  8. Matt, in an effort to keep things simple I was trying to use a csv file. What do I use for a table name for the sql command and then in the csv datasource tab, there is no offer to enter a query. I think I may switch over to a database table to see what that does. Mike
  9. OK so I am getting the error, Error filling print... Null 'key' argument. java.lang.IllegalArgumentException: Null 'key' argument. at org.jfree.data.DefaultKeyedValues.setValue(DefaultKeyedValues.java:229) which I know has something to do with an expression in a chart being returned null. At least that's my best guess after seeing another post on this forum. Now I have my fields declared: <field name="id" class="java.lang.Integer"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="lastname" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="firstname" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="grade" class="java.lang.Integer"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="subject" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="topic" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="subtopic" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="score" class="java.lang.Double"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="goal" class="java.lang.Double"> <fieldDescription><![CDATA[]]></fieldDescription> </field> then my chart defined <barChart> <chart> <reportElement x="123" y="38" width="296" height="139"/> <chartTitle/> <chartSubtitle/> <chartLegend/> </chart> <categoryDataset> <categorySeries> <seriesExpression><![CDATA["Actual"]]></seriesExpression> <categoryExpression><![CDATA[$F{subtopic}]]></categoryExpression> <valueExpression><![CDATA[$F{score}]]></valueExpression> <labelExpression><![CDATA["Actual"]]></labelExpression> <itemHyperlink/> </categorySeries> <categorySeries> <seriesExpression><![CDATA["Goal"]]></seriesExpression> <categoryExpression><![CDATA[$F{subtopic}]]></categoryExpression> <valueExpression><![CDATA[$F{goal}]]></valueExpression> <labelExpression><![CDATA["Goal"]]></labelExpression> <itemHyperlink/> </categorySeries> </categoryDataset> <barPlot> <plot/> <categoryAxisFormat> <axisFormat> <labelFont/> <tickLabelFont/> </axisFormat> </categoryAxisFormat> <valueAxisFormat> <axisFormat> <labelFont/> <tickLabelFont/> </axisFormat> </valueAxisFormat> </barPlot> </barChart> So I am wondering if it is getting the null on the hard coded strings. If I understand the bar chart correctly, the seriesExpression is what is one of what could be several seiries of bars on the chart. Hard coding a string I wouldn't think would be a problem.
  10. Well I could use a little help on this. So I was doing a simple bar chart called from a struts action. When the chart gets drawn, I get several broken document icons on my page and the bar chart is not displayed. These symbols are at every level of the document report. It's like it can't find a graphics library on the classpath or something. Has any one else seen this problem or have any ideas? The data is in an array list of java beans put on the value stack by an action. The raw content is making it to the report but the jasper graphics are not there. I can load up some code if that is neccessary. Mike
×
×
  • Create New...