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

schmatte

Members
  • Posts

    8
  • Joined

  • Last visited

schmatte's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hello, would like to use a subreport to show a list of data in three textfields in an band with the options isStretchwithOverflow="true", stretchType="relativeToTallestObject" and verticalAlignment="Bottom" to format the output (see Code). With this settings I've got the problem, if the text of the first field contains a specific number of characters, the textfield-width-calculation doesn't work properly. For instance the text of line "Umcodierung Postfach nach Postfach:" is located in the pdf-output in one line only, but nevertheless this field has stretched, that's why the content of the other fields "9" and "Sdg." moved to the next line. But this is incorrect. The same problem occured in line "Umcodierung Postfach nach Straße". The other outputs (with longer or shorter first textfield-content) are correct. I tested it with JasperReport 3.7.2, 3.7.5 and the latest 4.0.1, but everytime I've got the same problem with the pdf-output. For me it seems like a bug of JasperReport, isn't? Regards Code:<?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="subReportIlvmAnschriftenLeseergebnis" pageWidth="770" pageHeight="688" orientation="Landscape" columnWidth="770" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <style name="StyleColumn" isDefault="false" fontName="Verdana" fontSize="10" pdfFontName="Helvetica"/> <style name="StyleColumnTwo" isDefault="false" backcolor="#D1D1D1" fontName="Verdana" fontSize="10" pdfFontName="Helvetica"/> <!--style name="ParentBackground" backcolor="#FFCC00" fontName="Verdana" pdfFontName="Helvetica" fontSize="10" isDefault="true"/--> <style name="ParentBackground" fontName="Verdana" pdfFontName="Helvetica" fontSize="10" isDefault="true"/> <style name="BigLetter" style="ParentBackground" fontSize="30"/> <style name="MediumLetter" style="ParentBackground" fontSize="20"/> <style name="NormalLetter" style="ParentBackground" fontSize="11"/> <style name="Default" isDefault="true" style="ParentBackground"/> <field name="name" class="java.lang.String"/> <field name="anzahl" class="java.lang.Long"/> <field name="einheit" class="java.lang.String"/> <columnHeader> <band height="30"> <staticText> <reportElement style="NormalLetter" mode="Transparent" x="0" y="1" width="195" height="29"/> <textElement> <font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/> </textElement> <text><![CDATA[Test:]]></text> </staticText> </band> </columnHeader> <detail> <band height="15"> <elementGroup> <textField isStretchWithOverflow="true"> <reportElement stretchType="RelativeToTallestObject" style="StyleColumn" mode="Opaque" x="0" y="1" width="195" height="14"/> <textElement textAlignment="Left" verticalAlignment="Bottom"> <font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement stretchType="RelativeToTallestObject" style="StyleColumn" mode="Opaque" x="195" y="1" width="60" height="14"/> <textElement textAlignment="Right" verticalAlignment="Bottom"/> <textFieldExpression class="java.lang.Long"><![CDATA[$F{anzahl}]]></textFieldExpression> </textField> <textField> <reportElement stretchType="RelativeToTallestObject" style="StyleColumn" x="260" y="1" width="50" height="14"/> <textElement verticalAlignment="Bottom" /> <textFieldExpression class="java.lang.String"><![CDATA[$F{einheit}]]></textFieldExpression> </textField> </elementGroup> </band> </detail></jasperReport>
  2. No, I tried the same with Apache POI 3.6 directly. Here I've got the same problem, but only with cells, which doesn't have any content. The cells, which contained some content (for instance plain text) were still full editable, afterwards a border has been added.
  3. I followed up a matter the problem and found out that there exist a magic factor 1.1574074074074074074074074074074e-5 to set the correct time in Excel (24h in Excel = 1). Now there exist the next problem with JasperReport, if I would like to set the needed Double-value. JasperReports 3.7.1. creates the xls-File but, if I open this file an error-screen pop up with a message 'File-error. Possible lost of some formats of number.' (see source and screenshot in attachment bugReportExcelPatternOneSecond.zip) and the value of the cell is 0. That's why there still exist a problem with the generation of xls and jasperReport. I tried the same with Apache Poi 3.6. without problems: FileOutputStream outTwo = new FileOutputStream("dateFormat.xls"); HSSFWorkbook hssfworkbook = new HSSFWorkbook(); HSSFSheet sheetTwo = hssfworkbook.createSheet("new sheet"); HSSFCellStyle cs = hssfworkbook.createCellStyle(); HSSFDataFormat df = hssfworkbook.createDataFormat(); cs.setDataFormat(df.getFormat("[h]:mm:ss")); HSSFRow rowTwo = sheetTwo.createRow((short) 0); HSSFCell cellTwo = rowTwo.createCell((short) 0); Double value = new Double(70 * 1.1574074074074074074074074074074e-5); cellTwo.setCellValue(value); cellTwo.setCellStyle(cs); hssfworkbook.write(outTwo); Could someone of the JasperReport-developers investigate the problem with JasperReport and give a feedback, please?
  4. Hi, we use the pageFooter-section to print out some text at each bottom of the page. This works fine with PDF, but in Excel the position of the page footer is incorrect. On the first page no pageFooter appears, instead of the pageFooter of the first side is in the middle of the second side (we created a report with 3 sides) and so on. No pageFooter has in Excel the correct position. Does there exist an additional option or something else to get the expected position of the pageFooter in Excel with JasperReports 3.7.1? Regards Code:<?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="excelPageFooter" pageWidth="950" pageHeight="768" orientation="Landscape" columnWidth="950" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <field name="line" class="java.lang.String"/> <detail> <band height="20"> <textField> <reportElement x="0" y="0" width="140" height="20"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{line}]]></textFieldExpression> </textField> </band> </detail> <pageFooter> <band height="27"> <staticText> <reportElement x="770" y="7" width="40" height="20"/> <textElement/> <text><![CDATA[seite]]></text> </staticText> <textField> <reportElement x="810" y="7" width="20" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <staticText> <reportElement x="830" y="7" width="40" height="20"/> <textElement/> <text><![CDATA[von]]></text> </staticText> <textField evaluationTime="Report"> <reportElement x="870" y="7" width="30" height="20"/> <textElement/> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> <staticText> <reportElement x="900" y="7" width="50" height="20"/> <textElement/> <text><![CDATA[seiten]]></text> </staticText> </band> </pageFooter></jasperReport>
  5. Hello, I've found a problem in JasperReports 3.7.1. I would like to subtract two date-fields with a formula in excel: <textField pattern="[h]:mm:ss"> <reportElement x="730" y="10" width="134" height="20"> <property name="net.sf.jasperreports.export.xls.formula" value="Q13-F13"/> </reportElement> <textElement/> <textFieldExpression class="java.util.Date"/> </textField> The contents of the cells are the following: Q13 24.03.2010 14:53:20 F13 24.03.2010 14:52:40 The shown result in Excel of the textField is: 0,000462963 This value of the cell is as same as the expected value of 40 seconds, but the output-format of the cell is wrong. The expected format with the given pattern is 0:00:40. I can get this output-style only, if I change the format of the result-cell in Excel manually. I tried it with and without the class-information of the textFieldExpression, but the result was still the same. Does anybody know, why Excel/JasperReports doesn't evaluate the given pattern "[h]:mm:ss"? Thanks in advance. Regards.
  6. Hello, I've got a problem while using JExcelApiExporter of JasperReports 3.7.1, because the border of the created cell in the excel-stylesheet is fixed. In the created excel-file I can't open the context-menu of the cell - with the content of the staticText -, to change any settings. Nevertheless the color of the cell-font or the content is editable, but not the cell-border. I use Excel 2003 SP3. 1.) Is this a common problem of excel, which doesn't depend on the version? 2.) Does there exist another jasper-template-tag to create borders, which avoid this border-problem and to get fully editable excel-cells? Regards. Template: <?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="firstReport"> <detail> <band height="20"> <staticText> <reportElement mode="Transparent" x="120" y="0" width="275" height="20"/> <box> <pen lineWidth="1"/> </box> <text><![CDATA[Text with border]]></text> </staticText> </band> </detail> </jasperReport> Exporter-parameters: xlsExporter.setParameter(JRExporterParameter.JASPER_PRINT, print); xlsExporter.setParameter(JExcelApiExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE); xlsExporter.setParameter(JRXlsAbstractExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); xlsExporter.setParameter(JRXlsAbstractExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, Boolean.TRUE); xlsExporter.setParameter(JRXlsExporterParameter.IS_IGNORE_CELL_BORDER, false); xlsExporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, false);
×
×
  • Create New...