formatting - How to create a report with fields in between paragraph text? -
in shown report, text in black color static , text in red fields replaced value dynamically java.
in above picture, line 1 , 2 have no problem.
but paragraph not sure use? should use static-text box or text field? if use part static-text box , part dynamic, becoming clumsy , difficult maintain line spacing.
so please advise how design following report in jasper studio 5.6.
use textfield
, string concatenation on text, when need number format use numberformat api or decimalformat api
if need break line, set bold text can use html achive setting markup="html"
on textelement
example
<?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="test" pagewidth="595" pageheight="842" whennodatatype="allsectionsnodetail" columnwidth="555" leftmargin="20" rightmargin="20" topmargin="20" bottommargin="20" uuid="0ef33a9d-fd2b-46cc-9ec4-c6906db8097b"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="testnumber" class="java.lang.double" isforprompting="false"> <defaultvalueexpression><![cdata[new double(10000.23445)]]></defaultvalueexpression> </parameter> <title> <band height="57" splittype="stretch"> <textfield> <reportelement x="0" y="0" width="373" height="57" uuid="2f795f8a-43fa-4b89-a173-76854a13ba48"/> <textelement markup="html"/> <textfieldexpression><![cdata["just use textfield , string concat other text " + java.text.numberformat.getnumberinstance().format($p{testnumber}) + " see can format , remeber if set html can <br/> break line , <b>bold</b> text"]]></textfieldexpression> </textfield> </band> </title> </jasperreport>
output
Comments
Post a Comment