bobz28
Members-
Posts
34 -
Joined
-
Last visited
Content Type
Profiles
Forum
Events
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Downloads
Everything posted by bobz28
-
Anyone.... please help!!!
-
Hi all, I have multiple subreports defined and everything is working great except that the report always prints out an extra report with null value. Does anyone know why? Thanks, Bob
-
Hi Can I pass a collection of custom datasource as list to report and subreports? I tried this but then I got the following error: Caused by: net.sf.jasperreports.engine.JRException: Incompatible net.sf.jasperreports.engine.data.JRBeanCollectionDataSource value assigned to parameter REPORT_DATA_SOURCE in the masterReport dataset.
-
Well, I bundled the classes into a jar file and included it in the classpath and it works fine. Couldn't include individual class though... weird, don't know why...
-
Can somebody help...!!!! I included the abc.myservice.ClassBService class in the classpath and when I compile the template I get java.util.zip.ZipException: error in opening zip file...
-
Thanks for your response... When I included the abc.myservice.ClassBService class in the classpath. I get java.util.zip.ZipException: error in opening zip file... Weird...Dod you have any ideas? Thanks-
-
Hi all, I tried including the package but still get an error: java.lang.ClassNotFoundException: abc.myservice.ClassBService Any idea? Thanks-
-
Hi, Can someone help show me how to pass diff datasource to subreport. I am having a problem where I want to pass an array of DataSource to master report. How can I pass datsource one by one from master report to the subreport. i.e: subds[0], subds[1]...subds[n]... Thanks--- Here is what I have in the controller code: ============================ HibernateQueryResultDataSource ds = (master datasource) HibernateQueryResultDataSource subds = new HibernateQueryResultDataSource[input.size()]; for (int i=0; i < input.size(); i++){ List<?> reportQuery = getReport(input.get(i)); String[] fields = new String[] {"a", "b", "c"}; subds = new HibernateQueryResultDataSource(reportQuery, fields); } model.put("dataSource", ds); model.put("subDataSource", subds); return model;
-
Problem subreports and multiple datasources
bobz28 replied to 2002 JI Open Discussion's topic in Products
Hi, I am having a similar problem where I pass an array of DataSource to master report. How can I pas datsource one by one from master report to the subreport. i.e: subds[0], subds[1]...subds[n]... Thanks--- Here is what I have in the controller code: ============================ HibernateQueryResultDataSource ds = (master datasource) HibernateQueryResultDataSource subds = new HibernateQueryResultDataSource[input.size()]; for (int i=0; i < input.size(); i++){ List<?> reportQuery = getReport(input.get(i)); String[] fields = new String[] {"a", "b", "c"}; subds = new HibernateQueryResultDataSource(reportQuery, fields); } model.put("dataSource", ds); model.put("subDataSource", subds); return model; -
Hi All, Well, I think I can create a subreport to handle this issue, but is there a way to call and pass it diff datasources? Thanks-
-
Hi, Can somebody help... How can I append one report after another in Spring Hibernate framework? Here is what is look like in the controller: Map<?,?> model = new HashMap<?,?>(); List<?> report = getReport(); String[] fields = new String[] {"a", "b", "c"}; HibernateDataSource ds = new HibernateDataSource(report, fileds); model.put("title", title); model.put("dataSource", ds); ... return model; Thanks a lot. Post Edited by bobz28 at 08/25/2010 14:43
-
Hi, I am using Spring+Hibernate, how can I appending one report after another in Spring+Hibernate framework? Thanks, Bob
-
Hi shrije, Thanks for your reply, I am using Jasper with Spring framework and the Jasper template is the same for all reports... Can code similar to this happen inside the template or a scriptless? Bob
-
Hi All, I am trying to create a template for a report that can be from 1 to many (around 10 reports) in one report output. Depending on the user input (~10 drop down lists and each list if selected will eventually populate a report). Ex. if user select inputs from 5 drop down lists then I will have to generate 5 reports, one after another, if they select 10 then create 10... What is a best way to accomplishing this? Thanks- Bob
-
Lucian, I found a work around for this issue by adding a check for the returned column in question and convert it to Integer... i.e: ==== public Object getFieldValue(JRField field) throws JRException{ Object value = null; int index = getFieldIndex(field.getName()); if (index !=-1){ //This block is added... Object[] values = (Object[])currentValue; if("columnInQuestion".equalsIgnoreCase(field.getName())) { Integer myInt = new Integer(values[index].toString()); value = myInt; }else{ value = values[index]; } } return value; }
-
Hi Lucian, I am using Jaspperreports-3.1.0 and couldn't find the property file in net.sf.jasperreports.compiler.temp.dir directory. Thanks, Bob
-
Can some body help??? I am stuck...
-
Hi Lucian, I made the change and re-run...But don't know where to look for the generated Java file...Where should it be? Thanks, Bob
-
Lucian, I ran the debug and got the value for "b" field is BigDecimal. I am expecting a numeric value instead... Do you have idea, suggestion? Thanks, Bob
-
Hi Lucian, My Jasper works is on a diff network so I can't cut and paste it here, but something like this: net.sf.jasperreports.engine.fill.JRExpressionEvaluationException: Error evaluation exception Source text: $F{b}. at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java: 197) net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java: 574) net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java: 542) ... ... net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java: 368) Truncated. See log file for complete Starcktrace java.lang.ClassCastException: java.math.BigDecimal at the-report_12.....evaluate(the-report_12......:201) net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java: 186) ... net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java: 835) Truncated. See log file for complete Starcktrace I ran a debugger and found the values for the 3 fields a, b, and c. The a and c fields values are as normal as String results, but the b field is returned as BigDecimal. Is it normal? Thanks again for your help. Bob
-
Hi Lucian, How can I create a text field $F{b}.getClass().getName()? you mean in JRXML file? Because, as soon as I include the b field in my hibernate query and in my code, I get the error as I posted above. Thanks, Bob
-
Lucian, Thanks for your response. Yes I tried to change the data type from Number, int to BigDecimal...etc. But I still the ClassCastException error when evaluate field. Below is the simplyfied version of my JRXML. Thanks- <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="myTemplate"> <parameter name="TITLE" class="java.lang.String"/> <field name="a" class="java.lang.String"/> <field name="b" class="java.lang.Number"/> <field name="c" class="java.lang.String"/> <detail> <band height="40"> <textField> <reportElement x="0" y="0" width="150" height="40"/> <textFieldExpression class="java.lang.String"> <![CDATA[$F{a}]]> </textFieldExpression> </textField> <textField> <reportElement x="150" y="0" width="150" height="40"/> <textFieldExpression class="java.lang.Number"> <![CDATA[$F{b}]]> </textFieldExpression> </textField> <textField> <reportElement x="300" y="0" width="150" height="40"/> <textFieldExpression class="java.lang.String"> <![CDATA[$F{c}]]> </textFieldExpression> </textField> </band> </detail> </jasperReport>
-
Does anyone have any answer?
-
Hi, I am using Jasper Report with Hibernate and Spring env. Everything seems to work great excepts that when my hibernate query has a field of NUMBER type (Oracle), the report throws ClassCastException when evaluates the JRField. Here is brief of what I have: 1. Query in the hibernate mapping file(hbm.xml file): i.e SELECT a, b, c from myTable; (where a and c are VARCHAR2 and b is NUMBER. I named mySelect1). 2. Created a Class (myHQDS) to implement JRDataSource interface. 3. Code in the program: List report = session.find("mySelect1");Map parameters = new HashMap();parameters.put("Title", "The Report");...Load and compile the reportString[] fields = new String[] { "a", "b", "c"};myHQDS ds = new myHQDS(report, fields);JasperPrint jasperPrint = JasperManager.fillReport(jasperReport, parameters, ds);JasperManager.printReportToPdfFile(jasperPrint, "the-report.pdf");[/code]4. Error encountered: net.sf.jasperreports.engine.fill.JRExpressionEvaluationException: Error evaluation exception Source text: $F{b}. ... java.lang.ClassCastException: java.math.BigDecimal at the-report_12.....evaluate(the-report_12......:201) net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java: 186) I changed the filed name in the mapping file as well as the java object from int, Integer to java.lang.Number ...etc, but still I have the error when evaluate this filed. If I commeded this field out, it works perfectly fine. Can some body help??? Thanks in advance, Bob
-
Lucian, It works fine... the problem wasn't in the properties file, the mapping wasn't configured correctly... Thanks for your replied. Bob