Jump to content

Ajenjo

Members
  • Posts

    30
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by Ajenjo

  1. Hi. The solution is the report property columnCount. In this case: columnCount="2". (By default, the reporting engine creates report with one column on each page.) JasperReports allows creating reports with more than one column on each page, like in the following picture, where we can see the layout of a report with two columns.
  2. Perfect !!!!! That's the solution. Thanks so much again.
  3. Thanks for your reply mennei. I'll create my report with these two columns and told you the result. Cheers
  4. Ok, I read in Strech sample the next: When filling report templates horizontally, dynamic text fields inside the detail section do not stretch to their entire text content, because this might cause misalignment on the horizontal axis of subsequent detail sections. The detail band actually behaves the same as the page and column footers, preserving its declared height when horizontal filling is used. Are some form to print in two columns with large fields in detail section ???????? Thanks.
  5. Hi. I need your help. I have to create a report of general conditions with two columns for page, like page 2 in http://ec.europa.eu/europeaid/work/framework-contract/enpi/documents/3_2_general_conditions_en.pdf I see the HorizontalReport example, but in my case some text has a bold, italic or underline style... I'm thinking create a report with printOrder="Horizontal" with one line in detail section (for example with the filed 'text') with a 50% of page width and use differents <textField> for each styles: <textField> <reportElement x="40" y="2" width="130" height="11"> <printWhenExpression><![CDATA[new Boolean($F{style}.intValue() == 0)]]></printWhenExpression> </reportElement> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{text}]]></textFieldExpression> </textField> <textField> <reportElement x="40" y="2" width="130" height="11" style="Arial_Bold"> <printWhenExpression><![CDATA[new Boolean($F{OrderID}.intValue() == 1)]]></printWhenExpression> </reportElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{text}]]></textFieldExpression> </textField> (...) What you say??? Thanks Post Edited by Ajenjo at 01/26/2012 15:20 Post Edited by Ajenjo at 01/26/2012 15:25 Post Edited by Ajenjo at 01/26/2012 15:27
  6. Cheers. I've a styled textFileld in my report; the size, forecolor, etc... tags works fine but no isBold (when export file to PDF). Why ??? $text = <style size="11" forecolor="#747678">Text text text text</style><style isItalic="true" size="11">italic text</style><style size="11" forecolor="#747678">text text </style><style isBold="true" size="20" forecolor="#CCFF33">bold text </style><style size="11" forecolor="#747678">text text</style><style isBold="true" size="11" forecolor="#747678"> text text text </style><style size="11" forecolor="#747678">text text text text text </style><style isBold="true" isUnderline="true" size="11" forecolor="#747678">bold underline text</style><style size="11" forecolor="#747678"> tex tex text text text</style> <style size="11" forecolor="#747678">Text </style><style isBold="true" size="11" forecolor="#747678">bold text</style><style size="11" forecolor="#747678"> text</style> (...) <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="2" y="1" width="551" height="14" isPrintWhenDetailOverflows="true"> <property name="net.sf.jasperreports.export.pdf.force.linebreak.policy" value="true"/> <property name="net.sf.jasperreports.print.keep.full.text" value="true"/> </reportElement> <textElement textAlignment="Justified" markup="styled"> <font fontName="Tahoma" size="16" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{text}]]></textFieldExpression> </textField> (...) Can you help me ? Thanks. Jasperreport 4.0.1
  7. Hi. I have a subreport with 3 columns. Depending on the user's action is hidden some of the columns. My question is, how I can be able to hide or show columns in runtime for these reports? I do it with this code: File sourceFile = new File(rootJasperFiles + "RequestProposal_Products.jasper"); JasperReport sourceJasperReport = (JasperReport)JRLoader.loadObject(sourceFile); JRStaticText unitsLabelBox = (JRStaticText)sourceJasperReport.getColumnHeader().getElementByKey("unitslabel.box"); unitsLabelBox.setWidth(0); JRTextField unitsLabelTextField = (JRTextField)sourceJasperReport.getColumnHeader().getElementByKey("unitslabel.textfield"); unitsLabelTextField.setWidth(0); JRBand[] jrbands = (JRBand[])sourceJasperReport.getDetailSection().getBands(); JRFrame unitsFrame = (JRFrame)jrbands[0].getElementByKey("units.frame"); unitsFrame.setWidth(0); JRTextField unitsTextField = (JRTextField)jrbands[0].getElementByKey("units.textfield"); unitsTextField.setWidth(0); jasperPrint = JasperFillManager.fillReport(rootJasperFiles + "RequestProposal.jasper", pars, dataSource); But no works, I think that the subreport has the changes but I fill the "parent" report with no changes ¿?¿?¿? Can you help me, thanks.
  8. I have a problem with Jasper Reports & Weblogic. My deploy on Tomcat works fine, but in Weblogic show the next exception: net.sf.jasperreports.engine.JRException: Error loading expression class : .. Caused by: java.lang.ClassCastException: MYREPORT_1290416522329_455758 cannot be cast to net.sf.jasperreports.engine.fill.JREvaluator at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.loadEvaluator(JRAbstractJavaC .. Weblogic 10.3.3.0 Jasper Reports 4.0.1 Can you help me? Thanks.... Post Edited by Ajenjo at 05/30/2011 08:13
  9. Hi. (iReport 3.5.3) I was reading this topic but I haven't gotten it to work. When I create the JAR with ttf, jasperreports_extension.properties, and the file with fonts (font.xml) I don´t know where put it in my system (C:\Program Files\Jaspersoft\iReport-nb-3.5.3\ireport\modules\ext\ ??????). I've tried "everything". In my jrxml: (...) <band height="16" splitType="Stretch"> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="2" y="0" width="551" height="14" isPrintWhenDetailOverflows="true"/> <textElement textAlignment="Justified" markup="html"> <font fontName="arial"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{text}]]></textFieldExpression> </textField> </band> (...) In font.xml: <?xml version="1.0" encoding="UTF-8"?> <fontFamilies> <fontFamily name="Arial"> <normal><![CDATA[arial.ttf]]></normal> <bold><![CDATA[arialbd.ttf]]></bold> <italic><![CDATA[ariali.ttf]]></italic> <boldItalic><![CDATA[arialbi.ttf]]></boldItalic> <pdfEmbedded><![CDATA[true]]></pdfEmbedded> </fontFamily> <fontFamily name="Tahoma"> <normal><![CDATA[fonts/tahoma.ttf]]></normal> <bold><![CDATA[fonts/tahomabd.ttf]]></bold> <pdfEmbedded><![CDATA[true]]></pdfEmbedded> </fontFamily> </fontFamilies> In jasperreports_extension.properties: net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory net.sf.jasperreports.extension.simple.font.families.myfamily=fonts.xml Please somebody to help me step by step (I am very clumsy...). Thanks.
  10. I see this and I want do it. [file name=Horizontal_filling.zip size=21214] Post edited by: Ajenjo, at: 2008/06/16 08:52
  11. There is (in the example) 5 columns, but the report fill the detail section in the same mode as Vertical. You told me about "horizontal" sample in the JasperReports distribution. Can you tell me where is this??? Thanks. Post edited by: Ajenjo, at: 2008/06/16 08:51
  12. Hi. I need print with Horizontal Filling, but I can´t do it work correctly. Example: Code: Is this option implementted? Thanks.
  13. I tried to put a style element ( <style name="estilo" hAlign="Right"/> ) Code: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD JasperReport//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="albaran" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20"> <style name="estilo" hAlign="Right"/> <property name="ireport.scriptlethandling" value="2"/> (...) to use it in reportElement Code:[code] (...) <reportElement stretchType="RelativeToBandHeight" style="estilo" x="450" y="0" width="82" height="15" backcolor="#CCCCCC"/> (...) but show me the error : net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException: The content of element type "jasperReport" must match "(property*,import*,template*,reportFont*,style*,subDataset*,parameter*,queryString?,field*,sortField*,variable*,filterExpression?,group*,background?,title?,pageHeader?,columnHeader?,detail?,columnFooter?,pageFooter?,lastPageFooter?,summary?,noData?)". at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:226) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.loadJasperDesign(IReportCompiler.java:1775) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:503) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) Caused by: org.xml.sax.SAXParseException: The content of element type "jasperReport" must match "(property*,import*,template*,reportFont*,style*,subDataset*,parameter*,queryString?,field*,sortField*,variable*,filterExpression?,group*,background?,title?,pageHeader?,columnHeader?,detail?,columnFooter?,pageFooter?,lastPageFooter?,summary?,noData?)". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) Any help? Post edited by: Ajenjo, at: 2008/04/24 09:51 Post edited by: Ajenjo, at: 2008/04/24 09:57 Post edited by: Ajenjo, at: 2008/04/24 09:59
  14. Hi. I have to show a number right aligned. But it not do it, it appears in the left. The code: Code: (...) <textField isStretchWithOverflow="true" pattern="#,##0.00" hyperlinkType="None"> <reportElement stretchType="RelativeToBandHeight" x="450" y="0" width="82" height="15" backcolor="#CCCCCC"/> <textElement textAlignment="Right" verticalAlignment="Bottom"> <font isStrikeThrough="false"/> </textElement> <textFieldExpression class="java.lang.Float"><![CDATA[$F{importe}]]></textFieldExpression> </textField> (...) I write it as a String but have the same result. Any idea? Thanks
  15. Post edited by: Ajenjo, at: 2008/03/27 08:44
  16. Post edited by: Ajenjo, at: 2008/03/27 08:36
  17. Post edited by: Ajenjo, at: 2008/03/27 08:44
  18. Post edited by: Ajenjo, at: 2008/03/27 08:45
  19. Hi. I have two variables to sum two fields in FLOAT. Code: (...) <variable name="precio_total" class="java.lang.Float" resetType="Group" resetGroup="AlbaranGrupo" calculation="Sum"> <variableExpression><![CDATA[$F{precio}]]></variableExpression> <initialValueExpression><![CDATA[new java.lang.Float(0)]]></initialValueExpression> </variable> <variable name="importe_total" class="java.lang.Float" resetType="Group" resetGroup="AlbaranGrupo" calculation="Sum"> <variableExpression><![CDATA[$F{importe}]]></variableExpression> <initialValueExpression><![CDATA[new java.lang.Float(0)]]></initialValueExpression> </variable> (...) And I want to put these numbers with two decimals. Example .- 12.60, 34,35, 4,00... What's the way? And how can I do this.- Code:[code] <variable name="precio_total" class="java.lang.Float" calculation="Sum"> <variableExpression><![CDATA[($F{precio}.floatValue() * $F{cantidad}.floatValue())]]></variableExpression> <initialValueExpression><![CDATA[new java.lang.Float(0)]]></initialValueExpression> </variable> That's, other operations with fields available. Thanks Post edited by: Ajenjo, at: 2008/03/27 09:59
  20. Hi. I have a class with these atributtes. Code: /** * Constructor for required fields */ public BaseAlbaranCuadernosLineas ( java.lang.Integer id, com.siega.vo.Albarancuadernos idAlbarancuadernos, java.lang.String concepto, java.lang.Integer cantidad, java.lang.Float precio, java.lang.Float iva, java.lang.Float importe) { (...) As you see, I have type Integer, Float and String. In the .jrxml are the following fields. Code:[code] (...) <field name="concepto" class="java.lang.String"/> <field name="cantidad" class="java.lang.Integer"/> <field name="precio" class="java.lang.Float"/> <field name="iva" class="java.lang.Float"/> <field name="importe" class="java.lang.Float"/> (...) But when I compile the file, show the next error: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Cannot cast from Float to String value = (java.lang.String)(((java.lang.Float)field_iva.getValue()));//$JR_EXPR_ID=12$ <---------------------------------------------------------> 2. Cannot cast from Float to String (...) And when I change the types to String the error show that it´s not good value for the type. Error evaluating expression : Source text : $F{cantidad} I can´t change the types because I have to do some operations with the values. Any idea? Thanks Post edited by: Ajenjo, at: 2008/03/25 18:06
  21. Ok. Here is the solution. Post edited by: Ajenjo, at: 2008/03/24 12:01
  22. Ajenjo

    Solution

    Sorry but I don´t want to create a new post :S Post edited by: Ajenjo, at: 2008/03/24 11:44
  23. Thanks CBox I have try the "RelativeToTallestObject" attribute but it do the same... I use <frame> but don´t work. :( Code: (...) <detail> <band height="15"> <frame> <reportElement x="0" y="0" isPrintRepeatedValues="true" stretchType="RelativeToTallestObject" width="782" height="13"/> <line> <reportElement isPrintRepeatedValues="true" stretchType="RelativeToTallestObject" x="0" y="0" width="1" height="13"/> </line> <textField hyperlinkType="None"> <reportElement stretchType="RelativeToBandHeight" x="1" y="0" width="34" height="13"/> <textElement textAlignment="Center"> <font isStrikeThrough="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{codigo}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" hyperlinkType="None"> <reportElement stretchType="RelativeToBandHeight" x="35" y="0" width="170" height="13"/> <textElement> <font isStrikeThrough="false"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{descripcion}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true" hyperlinkType="None"> <reportElement stretchType="RelativeToBandHeight" x="205" y="0" width="42" height="13"/> <box> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center"/> <textFieldExpression class="java.lang.String"><![CDATA[]]></textFieldExpression> </textField> </frame> <line direction="BottomUp"> <reportElement positionType="FixRelativeToBottom" x="0" y="14" width="782" height="1"/> </line> </band> </detail> (...) I thinnk put the lines in background, but if in a page the registers have a few rows, the lines would appear after tese lines where aren't content. There is the posibility to print lines without being cut in the final of the page? Post edited by: Ajenjo, at: 2008/03/19 11:16 Post edited by: Ajenjo, at: 2008/03/19 12:53
  24. Thanks CBox. I have one line as you told me ... Code: ... but I have the same problem, when the description continues in the next page, the line don´t print. I think it happends because the field don´t have text and then it don´t print in the next page. Maybe I don´t make the code correctly. Thanks again.
×
×
  • Create New...