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

black_lotus

Members
  • Posts

    19
  • 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 black_lotus

  1. So I tried appending some extra characters to the end of the text inside the JRDesignTextField (one, then two, etc.)... no change. Then I tried adding a blank extra character to the beginning and end, and that seems to work. Go figure.
  2. I have a few JRDesignTextField's that are added to my report programmatically. Some of the text in the fields is too long and requires stretching vertically over multiple lines. The fields stretch, however some don't seem to stretch enough and some of the words gets cut off. The fields are wide enough to hold at least one word per line. Below is the code I use for the field. Is there something I need to add/change in order for the stretch to work properly? Thanks. Code:JRDesignBand columnHeaderBand = new JRDesignBand();columnHeaderBand.setHeight(22);columnHeaderBand.setSplitAllowed(false); textField = new JRDesignTextField();textField.setWidth(75);textField.setX(((colWidth - textField.getWidth()) / 2) + colWidth * (i + 3) - 30);textField.setY(6);textField.setPositionType(JRElement.POSITION_TYPE_FLOAT);textField.setStyle(headerStyle);textField.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_RIGHT);textField.setVerticalAlignment(JRAlignment.VERTICAL_ALIGN_MIDDLE); textField.setEvaluationTime(JRDesignExpression.EVALUATION_TIME_NOW);textField.setStretchWithOverflow(true);expression = new JRDesignExpression();expression.setValueClass(java.lang.String.class);expression.setText(""" + myObject.get(i).getName() + """);textField.setExpression(expression);columnHeaderBand.addElement(textField); Post Edited by some_one at 06/28/2010 16:16
  3. Hi, This is what I tried based on the sample. However I get runtime errors. Its as if it looking for a variable called "asdf" Code: textField= new JRDesignTextField(); textField.setWidth(86); textField.setHeight(12); textField.setX( ((colWidth - textField.getWidth()) / 2) + colWidth * (i + 3) - 10); textField.setY(6); textField.setPositionType(JRElement.POSITION_TYPE_FLOAT); textField.setStyle(headerStyle); textField.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_RIGHT); textField.setVerticalAlignment(JRAlignment.VERTICAL_ALIGN_MIDDLE); textField.setStretchWithOverflow(true); expression = new JRDesignExpression(); expression.setValueClass(java.lang.String.class); expression.setText("asdf"); textField.setExpression(expression); columnHeaderBand.addElement(textField);net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:C:\Program Files\glassfish-v2ur2\domains\domain1\config\SingleQuoteR2_1250259885312_565276.java:269: cannot find symbolsymbol : variable asdflocation: class SingleQuoteR2_1250259885312_565276 value = (java.lang.String)(asdf);//$JR_EXPR_ID=23$ ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\SingleQuoteR2_1250259885312_565276.java:269: illegal start of type value = (java.lang.String)(asdf);//$JR_EXPR_ID=23$ ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\SingleQuoteR2_1250259885312_565276.java:417: cannot find symbolsymbol : variable asdflocation: class SingleQuoteR2_1250259885312_565276 value = (java.lang.String)(asdf);//$JR_EXPR_ID=23$ ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\SingleQuoteR2_1250259885312_565276.java:417: illegal start of type value = (java.lang.String)(asdf);//$JR_EXPR_ID=23$ ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\SingleQuoteR2_1250259885312_565276.java:565: cannot find symbolsymbol : variable asdflocation: class SingleQuoteR2_1250259885312_565276 value = (java.lang.String)(asdf);//$JR_EXPR_ID=23$ ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\SingleQuoteR2_1250259885312_565276.java:565: illegal start of type value = (java.lang.String)(asdf);//$JR_EXPR_ID=23$
  4. But then how do I set the text/value of the textfield? Normally, if I generate a report solely from a template, I pass parameters to fill the textfields via JasperFillManager.fillReport(). But in this case I need to programmatically set the text myself. Static text fields allow me to do this via setText() but I don't see anything similar for textfields. Does this mean I have to fill them using fillReport()? thanks!
  5. Actually I needed to add it to the servers classpath - the global lib directory. That fixed things. Thanks
  6. I am dynamically creating the columnHeader band and populating it with some JRDesignStaticText elements. Some of the text is larger than the width of the element and therefore is not displaying fully. So I set the stretchType property to STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT but it does not seem to change anything. Is there something else I should look at? thanks Post Edited by some_one at 08/13/2009 19:49
  7. I'd like to dynamically create the "detail" band and set it in the JasperDesign object. In previous versions, one could set that band with JasperDesign.setDetail(JRBand detail) but this method is now deprecated and replaced by JRBaseReport.getDetailSection() according to api docs 3.5. I don't see how to set it though via a get method. Thanks
  8. I'm getting the following error when calling JasperFillManager.fillReportToFile() java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log; I have the commons-logging-1.1.jar in my classpath and there doesn't appear to be any conflicting duplicate jars. any ideas? thanks
  9. I've taking most of the code from one of the demo's (NoMmlDesignApp) and incorporated it into my app. When I run it and reach the point of compiling the JasperDesign object, several errors occur which I do not understand. Can someone give me some insight into the below. Code:net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:4: package net.sf.jasperreports.engine does not existimport net.sf.jasperreports.engine.*;^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:5: package net.sf.jasperreports.engine.fill does not existimport net.sf.jasperreports.engine.fill.*;^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:18: cannot find symbolsymbol: class JREvaluatorpublic class NoXmlDesignReport_1246382681156_165035 extends JREvaluator ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:25: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_LOCALE = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:26: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_JASPER_REPORT = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:27: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_VIRTUALIZER = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:28: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_TIME_ZONE = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:29: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_FILE_RESOLVER = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:30: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_SCRIPTLET = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:31: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_PARAMETERS_MAP = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:32: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_CONNECTION = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:33: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_CLASS_LOADER = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:34: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_DATA_SOURCE = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:35: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_URL_HANDLER_FACTORY = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:36: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_IS_IGNORE_PAGINATION = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:37: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_FORMAT_FACTORY = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:38: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_MAX_COUNT = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:39: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_TEMPLATES = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:40: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:41: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 private JRFillVariable variable_PAGE_NUMBER = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:42: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 private JRFillVariable variable_COLUMN_NUMBER = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:43: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 private JRFillVariable variable_REPORT_COUNT = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:44: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 private JRFillVariable variable_PAGE_COUNT = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:45: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 private JRFillVariable variable_COLUMN_COUNT = null; ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:68: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_LOCALE = (JRFillParameter)pm.get("REPORT_LOCALE"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:69: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_JASPER_REPORT = (JRFillParameter)pm.get("JASPER_REPORT"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:70: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_VIRTUALIZER = (JRFillParameter)pm.get("REPORT_VIRTUALIZER"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:71: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_TIME_ZONE = (JRFillParameter)pm.get("REPORT_TIME_ZONE"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:72: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_FILE_RESOLVER = (JRFillParameter)pm.get("REPORT_FILE_RESOLVER"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:73: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_SCRIPTLET = (JRFillParameter)pm.get("REPORT_SCRIPTLET"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:74: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_PARAMETERS_MAP = (JRFillParameter)pm.get("REPORT_PARAMETERS_MAP"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:75: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_CONNECTION = (JRFillParameter)pm.get("REPORT_CONNECTION"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:76: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_CLASS_LOADER = (JRFillParameter)pm.get("REPORT_CLASS_LOADER"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:77: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_DATA_SOURCE = (JRFillParameter)pm.get("REPORT_DATA_SOURCE"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:78: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_URL_HANDLER_FACTORY = (JRFillParameter)pm.get("REPORT_URL_HANDLER_FACTORY"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:79: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_IS_IGNORE_PAGINATION = (JRFillParameter)pm.get("IS_IGNORE_PAGINATION"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:80: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_FORMAT_FACTORY = (JRFillParameter)pm.get("REPORT_FORMAT_FACTORY"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:81: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_MAX_COUNT = (JRFillParameter)pm.get("REPORT_MAX_COUNT"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:82: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_TEMPLATES = (JRFillParameter)pm.get("REPORT_TEMPLATES"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:83: cannot find symbolsymbol : class JRFillParameterlocation: class NoXmlDesignReport_1246382681156_165035 parameter_REPORT_RESOURCE_BUNDLE = (JRFillParameter)pm.get("REPORT_RESOURCE_BUNDLE"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:100: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 variable_PAGE_NUMBER = (JRFillVariable)vm.get("PAGE_NUMBER"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:101: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 variable_COLUMN_NUMBER = (JRFillVariable)vm.get("COLUMN_NUMBER"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:102: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 variable_REPORT_COUNT = (JRFillVariable)vm.get("REPORT_COUNT"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:103: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 variable_PAGE_COUNT = (JRFillVariable)vm.get("PAGE_COUNT"); ^C:\Program Files\glassfish-v2ur2\domains\domain1\config\NoXmlDesignReport_1246382681156_165035.java:104: cannot find symbolsymbol : class JRFillVariablelocation: class NoXmlDesignReport_1246382681156_165035 variable_COLUMN_COUNT = (JRFillVariable)vm.get("COLUMN_COUNT");
  10. Can anyone point me to where I can find code examples (not xml design) of how to use a JRCrosstab? thanks
  11. I've read through the iReport manual concerning crosstabs, but I'm still not sure how to achieve what I need. Basically I have an array of javabeans with fields like age, year, amount. There is also a field which is an array of doubles. This field varies in size. It generally has between 1-3 values. So I need to display all of the content in these beans in a table. It would look something like below. Can you provide a description on how to accomplish this please? Thanks! Code: Post Edited by some_one at 05/21/2009 14:14 Post Edited by some_one at 05/21/2009 14:15
  12. I'm not sure that will help me. I don't want any row headers, just column headers. It seems to force me to select a row header. The column headers will vary based on user selections (between 3-7).
  13. I have a report with several parameters and static fields. There is also a tabular section with a varying number of columns and rows. I will only know at run-time how many columns there are and so they need to be added to report programatically I guess. They will be added to the detail section. How do I add them programatically though? I've seen samples on how to do it when the whole report has no xml template, but I am using iReport to create a template. Can I get a JasperDesign object from a template or something similar? Or do I need to insert a subreport which will be created programatically and then inserted into the template? Thanks
  14. So this is the structure of my template: I have a title, page header, column header, and detail. The detail is a set of tabular data. After the detail I need to put in a paragraph but I dont want it to be part of the page footer because it should not repeat on each page. It should appear once and only once after the table of numerical data. How can I achieve this? Should it be part of the summary? thanks
  15. Using iReport 2.0.5 I have a parameter in the pageHeader band and it that varies in size and so I have checked off "Stretch with overflow". There is content (a line and textfields) below this parameter. When the size of the parameter field gets to be a few lines long, the content below does not move down relative to the size of the parameter and it just gets overritten. How do I resolve this? Thanks
  16. In older versions of iReport there existed a "compile" button to compile reports into .jaspers. In iReport 3.5 this has been removed. How now do I compile a report. I noticed that by pre-viewing a report, a .jasper is generated but this is a pain in the butt as I must enter dummy parameter values. Is there another way that I have missed? thanks
×
×
  • Create New...