How to avoid of missing cell’s border when a record is separated between 2 pages?

You can put the staticText element without text behind the textField element. You should set stretchType property with RelativeToTallestObject value and isPrintWhenDetailOverflows property with true value. The sample: <detail> <band height=”20″ splitType=”Stretch”> <staticText> <reportElement stretchType=”RelativeToTallestObject” x=”0″ y=”0″ width=”100″ height=”20″ isPrintWhenDetailOverflows=”true”/> <box> <leftPen lineWidth=”1.0″/> <bottomPen lineWidth=”1.0″/> <rightPen lineWidth=”1.0″/> </box> <textElement/> <text><![CDATA[]]></text> </staticText> <textField> <reportElement stretchType=”RelativeToTallestObject” x=”0″ … Read more

How to view an image from blob column in Oracle with JasperReports?

Without seeing how you’re calling the blob to embed the image within your report code… Use blob.getBinaryStream(). Convert the stream using javax.imageio.ImageIO.read( InputStream ). For example: javax.imageio.ImageIO.read( blob.getBinaryStream() ) This will return an instance of BufferedImage, which subclasses java.awt.Image, and should be a suitable object to embed in the report. The blob variable shown in … Read more

iReport external font

Here is my working sample. The font definition file (I dig it from the font’s jar file): <?xml version=”1.0″ encoding=”UTF-8″?> <fontFamilies> <fontFamily name=”Arial”> <normal><![CDATA[fonts/arial.ttf]]></normal> <bold><![CDATA[fonts/arialbd.ttf]]></bold> <italic><![CDATA[fonts/ariali.ttf]]></italic> <boldItalic><![CDATA[fonts/arialbi.ttf]]></boldItalic> <pdfEncoding><![CDATA[Identity-H]]></pdfEncoding> <pdfEmbedded><![CDATA[false]]></pdfEmbedded> </fontFamily> </fontFamilies> The jar file is in the application’s classpath. And here is my java code: String defaultPDFFont = “Arial”; JRProperties.setProperty(“net.sf.jasperreports.awt.ignore.missing.font”, “true”); JRProperties.setProperty(“net.sf.jasperreports.default.font.name”, defaultPDFFont); JasperReport jasperReport … Read more

Dynamic column cell width

While not perfect, you could flag the field to stretch with overflow. This would at least give you all the data. In your jrxml file it would be similar to: <textField isStretchWithOverflow=”true” hyperlinkType=”None”> <reportElement style=”Report Sub-Title” x=”0″ y=”84″ width=”802″ height=”20″/> <textElement/> <textFieldExpression class=”java.lang.String”> <![CDATA[“For the period …]]> </textFieldExpression> </textField> I’m afraid I don’t know of … Read more

Automatically open the printer dialog after providing PDF download

With JasperReports When using JasperReports, simply add this parameter to JasperReports exporter: exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT, “this.print();”); This basically instructs Adobe Acrobat to execute the script this.print() when opening the PDF. See also page 79-80 of Adobe Acrobat Scripting Guide. Below is an extract of relevance: Printing PDF Documents It is possible to use Acrobat JavaScript to specify … Read more